Headless Mode¶
Run the agent without the TUI for scripting and automation.
Usage¶
A message argument is required.
Output Format¶
Text (default)¶
- stdout — final assistant message only (written once the turn completes)
- stderr — tool activity, thinking, token usage, errors. Use
-v/--verboseto include tool output
When both stdout and stderr are terminals (interactive use), the final message is printed to stderr so it appears alongside tool output. When either stream is piped or redirected, the final message goes to stdout — giving you a clean answer suitable for files or downstream commands.
JSON¶
Every EngineEvent is emitted as a JSON line (JSONL) to stdout.
Color¶
ANSI colors in stderr output respect NO_COLOR, TERM=dumb, and TTY detection.
Override with --color:
smelt --headless --color=never "fix the bug" 2>log.txt
smelt --headless --color=always "fix the bug" 2>&1 | less -R
Permissions¶
In headless mode, permission behavior depends on the mode:
- Yolo mode — all permissions auto-approved
- Other modes — unapproved tool calls are denied (no interactive prompt)
For fully autonomous scripting, combine with --mode yolo:
Examples¶
Pipe the final answer to a file:
Stream structured events for programmatic consumption:
Use in a CI pipeline: