Skip to main content
Browse the documentation

CLI reference

Running snaga

Interactive, one-shot, and scripted — plus the flags that change how a run behaves and how it reports back.

snaga

Starts an interactive session in the current directory. Everything below changes that, and every flag here is a top-level option: it goes before a subcommand, not after.

snaga --yolo connect        # correct
snaga connect --yolo        # error: unexpected argument

One task, no prompt

snaga -p "add a test for the empty-list case in cart.rs"

Runs a single turn and exits. Combine with output formats to make it scriptable:

--output-formatBehaviour
texthuman-readable stream (default)
jsonone result object when the turn finishes
stream-jsonone JSON event per line, as they happen

With json or stream-json, stdout carries nothing but the payload — banners, notices and progress all go to stderr. That is what makes this safe to pipe:

snaga -p --output-format json "list the public API of this crate" | jq .

Answering the agent from a script

A turn that needs a confirmation will otherwise be denied, since there is no one to ask. To answer programmatically, opt in explicitly:

--input-format stream-json

Then send one JSON object per line on stdin:

{"type":"confirm","id":"<tool call id>","approve":true}

This is opt-in rather than implied by --output-format stream-json, because a turn waiting on a front-end that is not listening would wait forever.

Sessions

snaga --continue           # reopen the most recent session here
snaga --resume <id>        # reopen a specific one
snaga --resume             # restore the most recent interrupt checkpoint

Bare --resume is the older meaning and is kept: it restores an interrupt checkpoint rather than reopening a session by id.

snaga sessions list        # id, start time, message count, opening request
snaga sessions show <id>   # print the transcript
snaga sessions fork <id>   # copy to a new id, leaving the original alone

fork is the one to reach for before an experiment you might regret: branch the session, try the risky direction in the copy, and the original is untouched.

Speed and scope

FlagEffect
--fastSkip the capability probe, use a minimal system prompt. Also skips checkpoint saving — wrong choice for anything you may want to undo
--verifyAfter the turn, syntax-check every modified file and smoke-test a frontend if one was written. Reports; does not auto-retry
--turn-timeout <secs>Wall-clock ceiling for one turn. Default 300 interactive, 900 in bridge mode. Excludes stalls and approval waits
--max-tokens, -t/--temperaturePer-response limits
-d/--working-dirWork somewhere other than the current directory

Safety flags

FlagEffect
--yoloSkip every confirmation — consent prompts and tool approvals alike
--danger-full-accessNo sandbox at all
--require-sandboxRefuse to start if no sandbox backend exists — for CI
--sandbox-image <IMAGE>Run tool execution inside an ephemeral Docker container; the working directory is mounted at /workspace and the container is destroyed at exit

See Permissions and safety for what these move.

Output detail

FlagEffect
-v, -vv, -vvvProgressively more about LLM requests and tool execution
--hide-thinkingKeep the reasoning header and summary, drop the body
--no-tuiLine-mode input instead of the raw-mode editor — for screen readers, scripting, and terminals without raw mode
--event-log <FILE>Write all events to a JSON file

Autonomy

snaga --autonomy goal.toml
snaga --autonomy-resume <goal-id>
snaga --profile robotics
snaga --autonomy goal.toml --rollback-baseline <label>

Covered in Autonomous runs.