Sophon 2.0 is here
Sophon Docs
Command Line

Interactive ChatNEW

The Sophon CLI chat surface — the full-screen terminal chat, its fallbacks, slash commands, approval and question cards, and @-mentions.

Running sophon with no arguments drops you into the interactive chat — a full-screen conversation with your agent that streams responses, renders Markdown, runs slash commands, and lets you attach files and images without leaving the terminal. It's the surface you'll spend the most time in.

sophon              # bare invocation → interactive chat
sophon chat         # identical — explicit form

Entering and exiting

sophon chat accepts two options for picking up where you left off:

sophon chat --session <id>      # -s : resume an existing session by ID
sophon chat --agent  <id>       # -a : chat with a specific agent (default: from config)

Without --session the CLI creates a fresh session on connect; without --agent it uses defaultAgent from your config. The Gateway must be reachable at --gateway-url (default http://localhost:8080) — if the connection fails, the chat tells you to start it with sophon start.

To leave, type /exit, or press Ctrl+C twice within ~1.5 seconds. A single Ctrl+C clears the current line (or cancels a running task) and keeps you in the chat.

The full-screen surface takes over the terminal's alternate buffer, so exiting wipes its scrollback by design. On the way out it prints a resume card — the session id, this run's message count, the sophon chat --session <id> line to come back, and a pointer to /export if you wanted the transcript on disk.

The full-screen chat

Since v2.0.0 the full-screen chat is the default surface. It owns the whole screen and lays out like this:

│ ✦ Sophon · fix the parser        default · ● · indigo-core │  ← header
│                                                            │
│   …transcript (app-managed scrollback)…                    │
│                                                            │
│ ● main — analyzing repository (41s)                        │  ← status band
│ ┃ ⚠ email.send · HIGH · 42s   [A]pprove · [R]eject · …     │  ← attention card
│ ❯ type here (grows up to 6 rows)                           │  ← composer
│ ↩ send · ⌥↩ newline · / cmds · @ files                     │  ← footer
  • App-managed scrollback — the wheel, PgUp and PgDn scroll the transcript. Scrolling up releases follow and a ↓ latest chip appears; reaching the bottom, pressing End, or sending re-arms it.
  • Status band — the active turn shows its latest phase, and each delegated subagent gets its own row with name, task, and elapsed time.
  • Plan progress — while a task with an approved plan runs, the band shows ◆ plan 2/5 — <running step>, so the plan doesn't vanish the moment its approval card resolves. /plan expands it into a full-height overlay.
  • Live token usage — each completion carries its turn's usage (agent, model, tokens) and the idle footer keeps the run's cumulative total. Both stay blank until the provider reports usage, so you never see a made-up zero. /tokens shows the full breakdown.
  • Resumed history — resuming a session seeds the transcript with your recent messages behind a dim resumed · … divider.

Select and copy

Wheel scrolling needs mouse capture, which is exactly what normally defeats native drag-selection. Two ways out:

  • Hold Shift while dragging — Windows Terminal, VS Code, and most xterm-family terminals bypass capture for Shift.
  • Press F2 (or type /select) to release capture entirely. Plain drag then selects natively, a SELECT badge appears in the footer, and wheel scrolling pauses until F2 toggles it back.

Approval and question cards

Requests arrive as cards in a bottom stack, one at a time, with later ones queued behind:

  • Approvals show the risk level, the parameters, a scrollable preview, and a live countdown. A approves, R rejects, S skips (which hands the decision to the server's timeout), and E opens the call in $EDITOR when the tool allows editing.
  • Questions show numbered options — press a digit, Space to multi-select, Enter to send — and also accept free text typed straight into the composer.
  • Cards arm after a short delay and never steal keys mid-typing. Tab focuses a card explicitly, and a timeout is always rendered, never silently defaulted.

Approvals and questions raised inside a plan step or by a sub-agent are mirrored into your main chat here, labelled with the step they came from. See Approval Gates.

Dialogs

Three dialogs open over a dimmed backdrop: /theme previews the whole screen live before you commit, /resume with no argument opens a native session picker, and /plan shows the running plan windowed around the current step. Esc closes any of them.

Fallback surfaces

The full-screen chat is a policy default, not an assumption — runtime probes decide per terminal, and the fallbacks are the surfaces that used to be the default. Nothing is lost in a fallback but the layout.

#CheckOn failure
1Not the Dashboard's built-in terminalclassic prompt
2SOPHON_CLI_FULLSCREEN ≠ 0 / "fullScreen" ≠ falsepinned input
3Not accessibility mode (SOPHON_CLI_ACCESSIBLE=1, or an active Windows screen reader)classic prompt
4stdin and stdout not redirectedclassic prompt
5Window at least 70×18pinned input
6VT modes verifiably enablederror, with the opt-out to re-run with

Steps 1–5 degrade silently. Step 6 is the exception: the CLI is already connected by then, so rather than connect twice it exits and tells you to re-run with SOPHON_CLI_FULLSCREEN=0.

Shrinking the window below the minimum mid-session keeps the chat running — the layout squeezes instead of bailing out.

Pinned input is the first fallback and the previous default: the input zone is pinned to the bottom while the conversation scrolls above it, so the prompt never disappears mid-stream. You can keep typing while a task runs, and queued input is sent as soon as the current turn completes. It needs an interactive ANSI terminal of at least 40×12.

The classic prompt is the linear, framed surface underneath both. It is what a screen reader, a redirected pipe, or the Dashboard's built-in terminal gets.

CLI v2 was not removed — the pinned input zone and the classic prompt are the fallbacks, and SOPHON_CLI_PINNED=0 / SOPHON_CLI_V2=0 still work. Set SOPHON_CLI_FULLSCREEN=0 (or "fullScreen": false in ~/.sophon/config/cli.json) to drop straight back to pinned input. See Configuration.

If a crash ever leaves your terminal stranded in the alternate screen or in raw mode, run sophon doctor --reset-terminal — it blindly emits the full restore sequence.

Key bindings

KeyAction
EnterSend the message
Alt+EnterInsert a newline in the full-screen chat (Shift+Enter in the pinned and classic surfaces)
↑ / ↓Recall and walk through previous entries
← / → / Home / EndMove the cursor — or, with an empty draft in full screen, jump the viewport
PgUp / PgDn / wheelScroll the transcript (full screen)
F2Toggle select & copy mode (full screen)
oExpand the newest collapsed tool card (full screen, empty draft)
A / R / E / SAnswer the active approval card
digits / SpaceAnswer the active question card
TabFocus a card, or accept a slash / mention completion
DeleteForward-delete the character under the cursor
Ctrl+WDelete the previous word
Ctrl+UClear the whole line
Ctrl+CClear the draft → cancel active and queued tasks → press twice within ~1.5s to exit
Ctrl+TAttach an image (prompts for a path)
EscDismiss the open menu, dialog, or overlay

VT terminals can't tell Shift+Enter apart from Enter, which is why the full-screen chat uses Alt+Enter (⌥↩) for a newline. The pinned and classic surfaces keep Shift+Enter.

Pasted text is auto-detected (bracketed paste) and inserted as a single block, so multi-line snippets land intact instead of triggering a send per line.

Slash commands

Type / at the start of an empty line to open a searchable picker, or type the command directly. The picker only offers what actually runs on the surface you're on.

CommandWhat it does
/new [agent]Start a new session (optionally with a different agent)
/sessionsList recent sessions
/resume [id|title]Resume a session — with no argument in full screen, a native session picker
/agent <id>Switch to a different agent
/agentsList available agents
/provider [id|type] [modelId]List providers, or set a per-session provider/model override; /provider reset clears it
/mode [graph|classic|default]Show or set this session's execution mode
/thinking <auto|off|fast|full>Set the extended-thinking level (persists as defaultThinking)
/theme [name]Open the live-preview theme picker, or switch directly — full screen only
/tokensThis run's turn and token breakdown — full screen only
/selectToggle select & copy mode — full screen only
/clearReset the transcript view (the session is untouched)
/export [format] [path]Export the transcript (md / json / txt)
/attach <path>Upload a file and send it with your next message
/save [n] [path]Download the Nth attachment from the last batch
/planShow the current plan
/tasksList active tasks on the server
/approvalsList pending approvals
/auto-approve [on [none|low|medium|high] | off | show]Auto-approve requests up to a risk ceiling; the stored ceiling is kept when you turn it off
/cancelCancel the running task or plan
/canvas [<action>]Act on the agent's canvas frame for the current session
/helpShow all available commands
/exitLeave the chat

/theme, /tokens and /select belong to the full-screen session itself, so the pinned and classic surfaces neither offer nor accept them. On those surfaces, pick a theme with the SOPHON_THEME environment variable instead. /rename is currently broken from the chat — rename from the Dashboard until it is re-registered.

@-mentions

Type @ to open the file picker and pull a file reference into your message. Completion is wired to your current working directory and filters as you type: keep typing to narrow the list, browse with ↑/↓, and press Tab or Enter to insert the reference inline. Esc closes the picker but keeps the @filter text you typed in the buffer, so nothing is lost.

Agent (@agent:<id>) and session (@session:<id|title>) mention categories are on the roadmap — today @ completes files.

Pasting and image attach

Press Ctrl+T to attach an image — the CLI prompts for a path and queues the file. A confirmation line like [attached photo.png] is echoed, and the image is uploaded and sent alongside your next message. Use /attach <path> for non-image files (it uploads to Documents and sends immediately), and /save [n] to pull an attachment the agent sent back down to disk.

Rendering

Assistant output streams live and renders as themed Markdown — headings, bold, italic, lists, block quotes, tables, links, and fenced code blocks all render with syntax highlighting through the active theme. Intermediate phases (thinking, tool use, memory lookups, skill execution) surface as labeled status lines while the agent works. See Extended Thinking for how reasoning is produced.

Known gaps

Stated plainly, so you don't go looking for them:

  • Mouse support is wheel-only. Scrolling works; clicking a card or a tool block does not. Answer cards with the keyboard.
  • No Ctrl+R history search. ↑ and ↓ walk the full history stack.
  • No @agent: or @session: mentions. The picker completes file paths.
  • Newline is Alt+Enter in full screen, not Shift+Enter.
  • Very long output is trimmed. A single part elides its middle past ~2,000 rendered lines and the transcript trims its oldest entries past ~1,000, both marked where it happened. /export before you exit keeps everything.
  • Token counts are last-wins per turn — a turn that makes several model calls reports the latest usage the provider sent, not a summed total.
  • Code fences highlight per line while streaming, so a block comment or a long table can mis-color until the fence closes and the block re-parses whole.
  • /rename doesn't work from the chat — rename from the Dashboard.
  • Legacy conhost has no bracketed paste (a paste heuristic covers the common case) and scrolls by keyboard only.