tufty.aitufty.ai CLI
Reference

Error Codes

Every code in the failure envelope, what it means and what to do.

On failure, stdout holds:

{ "ok": false, "code": "...", "message": "...", "details": { } }
  • Branch on code in code; message is for people.
  • For errors returned by the API, details.status is the HTTP status. When the server supplies its own error code it goes in details.serverCode, with extra information in details.serverDetails.
  • Exit codes: see Exit codes.

Authentication

codeExitMeaningWhat to do
no_api_key1No API key found. Non-interactive environments (CI, agents, pipes) never start a sign-inRun tufty login, set TUFTY_API_KEY, or tufty auth set <key>
unauthorized1The key is invalid or revoked (HTTP 401)Get a new key on the API keys page
forbidden1Access denied (HTTP 403)Check which account the key belongs to
not_configured1tufty auth get found no keySign in or save a key first
login_expired1The authorization request expired or was declinedRun tufty login again
login_timeout1Authorization wasn't completed within 30 minutesRun tufty login again

Credits

codeExitMeaningWhat to do
insufficient_balance1Not enough credits (HTTP 402). details.required is what this step needs; stderr also prints the top-up linkTop up under Account settings → Credits, then run again

Requests and the server

codeExitMeaningWhat to do
invalid_request1The server rejected the request (HTTP 400). details.serverCode gives the reason, e.g. unknown_template, reference_not_allowedCheck the inputs; tufty tools describe <id> shows the current options
not_found1Not found (HTTP 404), usually a mistyped runIdCheck the runId
cli_version_too_low1The CLI is older than the server supports (HTTP 426)Run npm install -g @tufty/cli@latest
server_error1Server error (HTTP 5xx), or a response that couldn't be parsedRetry later
http_error1Any other unsuccessful HTTP statusCheck details.status and retry later
network_error1Couldn't reach the server; details.url is the request URLCheck the network, proxy or --base-url
manifest_unavailable1Couldn't load the tool manifest, and there's no local cacheCheck the network and retry

Commands and inputs

All of these exit with code 2.

codeMeaningWhat to do
usage_errorInvalid arguments: unknown option, value not among the choices, missing option value, non-positive --timeout, and so on. Errors from argument parsing carry details.commanderCodeCheck tufty <tool> -h
unknown_commandNo such command; details.suggestions lists close matchesFix the command name
tool_not_foundNo tool with that id for tufty tools describe; details.availableTools lists them allFix the tool id
missing_inputFewer inputs than the tool needs; details has flag, min, gotAdd the missing inputs
too_many_inputsMore inputs than allowed, or more than 4 images joined with + for one productPass fewer inputs
too_many_imagesProducts × models × --count exceeds 16; details has pairs, count, maxSplit into several runs or lower --count
file_not_foundA local file doesn't exist; details.path is the pathCheck the path
invalid_videoThe video is truncated or missing its moov index; details.filename is the fileRe-export or re-download the video
invalid_inputA malformed data: URLCheck the data: URL

Runs

codeExitMeaningWhat to do
task_failed1Generation failed on the server; details has runId, tool, serverCodeRetry, or try different input images or --notes
timeout1Not finished within --timeout; details.runId is the run. The run isn't cancelledRun tufty status <runId> --wait

Transfers and other

codeExitMeaningWhat to do
upload_failed1Uploading to storage failedRetry later
download_failed1Downloading an input URL, or an output for --save, failed after 3 attempts; details.url is the URLCheck the URL or network and retry
internal_error1Something unexpected went wrongRetry with --verbose and send us the output

On this page