CLI behavior backed by the dottxt SDK.
-h, --help: Show help--version: Print version--json: Emit machine-readable JSON--verbose: Emit expanded diagnostics onstderr
--json error format:
{"error": {"message": "..."}}In --json mode, stdout is machine-readable. Failures emit only that JSON
object and exit with code 1.
In --json mode, success JSON is printed to stdout and error JSON is printed
to stderr.
0: Success1: Runtime/config/input errors2: Usage/argument errors fromclick
Store API credentials.
- Resolution order:
DOTTXT_API_KEY, then stdin (non-TTY), then interactive prompt (TTY only) - Stdin example:
dottxt login < key.txt - Fails when no key is available from any source
Delete locally stored credentials.
List available models from the API.
- Default: one model ID per line (
* (default)appears whenDOTTXT_MODELmatches) --json: full records--verbose: debug diagnostics onstderr(stdout unchanged)--author NAME: filter by model author- Set a shell default model:
export DOTTXT_MODEL=<model-id>
Run one generation.
-m, --model TEXT: model id (required unlessDOTTXT_MODELis set)DOTTXT_MODEL: optional default model id forgenerate(--modeloverrides)-s, --schema FILE: schema file path (required)[PROMPT]: literal prompt text
Prompt rules:
- If
[PROMPT]is provided, it is used. - Otherwise, stdin is read.
- Command fails if neither positional prompt nor stdin is provided.
Output rules:
--json: full generation payload on stdout--verbose: debug diagnostics onstderr(stdout unchanged)- If the selected model is unavailable for your key, generate returns a
targeted error with guidance to run
dottxt modelsand setDOTTXT_MODELor pass--model