tufty.aitufty.ai CLI
Reference

Exit Codes

Tell success, runtime errors and usage errors apart by exit code.

Exit codeMeaningTypical codes
0Success, including -h / --help and -V / --version—
1Runtime or API error: authentication, credits, network, server, failed run, timeoutunauthorized, insufficient_balance, network_error, task_failed, timeout
2Usage error: a mistyped command or flag, or invalid inputusage_error, unknown_command, missing_input, too_many_images, file_not_found

With exit code 2, retrying the same command won't help — fix it first. With 1, let the code decide whether to top up, re-authenticate or retry later. Which code falls in which group: Error codes.

Stdout holds a JSON envelope whether the command succeeds or fails, so you can use it alongside the exit code:

tufty pet-dressup --product ./sweater.jpg --model ./corgi.jpg --save ./out > result.json
case $? in
  0) echo "done" ;;
  2) echo "fix the command: $(jq -r .message result.json)" ;;
  *) echo "failed: $(jq -r .code result.json)" ;;
esac