Scripting
Use print mode to run one prompt and exit, without opening the terminal interface.
tatu -p "Explain the purpose of this project."The final answer goes to stdout; tool progress and errors go to stderr. Add -q to hide progress, not errors. Tatu still runs tools with your permissions: print mode is not a read-only mode.
Read from stdin
Section titled “Read from stdin”Use -p - to read the whole prompt from stdin. For example, pipe a diff into a review prompt:
{ printf 'Review this diff for bugs:\n\n'; git diff; } | tatu -p - -qYou can also redirect a file:
tatu -p - < prompt.txtAttach images
Section titled “Attach images”Add -image for each image you want to send with the prompt:
tatu -p "Explain this error screen." -image error.pngSee Images for model support and image handling.
Use a shell script
Section titled “Use a shell script”Print mode saves the conversation by default. Add -no-session when you do not want a saved conversation:
#!/bin/shif tatu -p "Summarize the changes in this project." -q -no-session > summary.md; then printf 'Saved summary.md\n'else code=$? printf 'Tatu failed with exit code %s\n' "$code" >&2 exit "$code"fiExit code 0 means the run finished, not that an answer passed your own checks. Code 1 means an error or the model-call limit, 2 means invalid command-line usage, and 130 means interrupted. An interrupt aborts the run; a second interrupt exits immediately.
JSON output
Section titled “JSON output”Add -json with -p to write one JSON object per line instead of the final answer:
tatu -p "Explain main.go." -jsonThe first line describes the session state; later lines report events. One event line is:
{"type":"agent_start"}-rpc serves a session over stdin and stdout for programs that control it.