tny ask
One turn, then exit. Built for scripts, agents, and CI.
Shape
One turn, then exit. Stdout is assistant Markdown. Stderr is progress, tool lines, and diagnostics. Interactive prompts are never the only path.
tny ask "summarize this repository"printf 'summarize src/\n' | tny ask --stdintny ask --json --no-save "list the public CLI"tny ask --resume last "now add tests"Exit codes
| Code | Meaning |
|---|---|
| 0 | Finished |
| 1 | Startup or config |
| 2 | Run failed |
| 130 | Interrupted |
JSON mode
--json writes one object to stdout. Field names are stable:
{
"output": "…",
"exit_code": 0,
"provider": "openai",
"model": "provider/model",
"session_id": "…",
"steps": 1,
"tool_calls": [{"name": "read_file", "status": "success"}]
}
Scripts and CI
tny ask never blocks on an approval. Unresolved permissions fail the run unless you pass --auto (native loop) or stay on the default --yolo.
When the prompt is piped on stdin, connect overlaps the read so the provider is already warming while the prompt arrives.
Native HTTP profiles accept --image PATH (repeatable, max 16; 8 MiB each) after magic-byte MIME validation, subject to configured image-input policy. A 17th flag exits before files or backend connection. libtny ABI 1 does not expose image attachments yet.