CLI / REFERENCE
A terminal interface to the same runtime.
Use the interactive session for collaborative work, print mode for one-shot prompts, or JSON mode when another program needs the event stream.
The interactive surface
On a real terminal NAH runs an alternate-screen interface built on the same TUI library Pi uses: a scrollable transcript with the prompt pinned below it. That layout is the point — streamed output lives in its own region, so it can never land on the line you are typing.
running ──────────────────────────────
◆ read src/auth.ts
◆ grep validateToken
3 matches
assistant text streams here…
steer › actually use the jose libraryWhile a turn runs you can keep typing. Submitting steers that turn instead of queueing a new one; a slash command is held until the turn settles. Cmd+C or Ctrl+Shift+C copies the selection, and plain Ctrl+C aborts.
One session per run
Each run of nah starts a new session in its own file, so a fresh run never silently appends onto the previous one's transcript. The first run in a directory uses its own id; later runs get suffixed ids.
nah # new session
nah -c # resume the most recent
nah --session a1b2c3d4e5f6 # resume exactly this one
nah --session ./notes.jsonl # or an explicit pathResuming replays the earlier turns into the transcript pane, so the history is visible before you type.
Run modes
nah # interactive
nah "fix the flaky test" # run prompt, then open the UI
nah -p "summarize this diff" # print answer and exit
nah --mode json "inspect auth" # JSONL events to stdout
git diff | nah -p "review this" # include stdin as prompt contextUse @path arguments to include file contents in the initial prompt, and --cwd to select the workspace root.
Common options
-m, --modelprovider:model-id, such as anthropic:claude-sonnet-4-5 or openai:gpt-4.1.-c, --continueResume the most recent session for this working directory.--session <id|path>Resume exactly that session, by id or by file path.--no-sessionKeep the session in memory; do not persist it.--no-tuiUse the line renderer instead of the alternate-screen TUI.-y, --yoloAllow mutating tool calls without prompting.--permissionsSet ask, yolo, or readonly behavior.--sandbox [name]Use a Blaxel sandbox; requires BL_API_KEY and BL_WORKSPACE.-h, --helpPrint the full CLI help.Permission modes
Interactive mode defaults to ask. Answer y once, a to allow that whole tool for the session, or A for only that exact call. Print and JSON modes default to yolo, since the process cannot pause for an interactive prompt. Specify --permissions readonly to make those modes read-only.
nah --permissions readonly -p "summarize src/auth"
nah --permissions ask --mode json "inspect only"Session commands
Within interactive mode, use these slash commands to manage the active session. Typing / opens a filtered command modal; press Enter to insert a command. Arguments are typed freely and nothing is suggested until the command is submitted.
/help Show commands
/model <spec> Switch model
/memory Show memory tiers and what was injected
/permissions [mode] Set ask, yolo, or readonly
/stats Show session token usage
/compact Compact the transcript using truncation
/clear Drop the current transcript
/session <id> Switch to another saved session
/session new|off Start a JSONL session file or stop persisting
/quit ExitPlans, sessions, and undo
For substantial multi-step work, the CLI gives the agent a task_ledger tool. It can discover executable checks, save an ordered plan and acceptance commands, record check attempts and exit codes, and track progress across turns. Use /task to inspect the saved plan and /task clear to remove it.
Conversations are stored as append-only JSONL entries under ~/.nah/sessions, one file per session. /session list shows every session for the directory with timestamps, and /session <id> switches to one without leaving the running agent — the transcript is rebuilt from the restored history. Switching clears the current turn's undo history, which no longer describes the transcript on screen.
Memory is separate from the transcript: it is stored per working directory and survives into later sessions. /memory shows the tiers and what was injected into each prompt.
Interactive turns keep recovery information for tool changes. Use /diff to inspect workspace changes and /undo to undo the last turn; /undo <step> targets a particular step from the latest turn.
/task Show the active plan
/task clear Clear the plan
/branches List branches, sizes, and which is active
/branch List branches
/branch <name> Switch to a branch, or fork one if new
/branch main Return to the original transcript
/session list List sessions for this directory
/diff Show workspace changes
/undo [step] Undo the last turn or a stepSwitching or forking a branch restores its transcript into the pane, so the scrollback always matches the conversation being continued. A name that does not exist forks a new branch from the current transcript and says so, rather than appearing to switch to something.
Branches are siblings rather than a tree: every branch derives from the session's base transcript, so /branch main always returns you to the original.
Delegate independent work
The interactive CLI provides a delegate_task tool for bounded, independent subtasks. A child starts from committed HEAD in a temporary detached Git worktree, so it cannot see uncommitted parent changes. The parent receives the child status, metrics, changed paths, and diff, then reviews and integrates any changes itself. Delegation requires approval under the ask permission mode and is limited to three concurrent children.