TUI
The TUI is ka’s home surface, built on ratatui with a hand-rolled markdown renderer: streaming text, collapsed tool rows, live meters, and mouse support, all in the same process as the engine.
Starting
Section titled “Starting”ka # fresh sessionka -c # this terminal's latest sessionka --session 3f9c # by id prefixka -i "fix the tests" # run one prompt, then open the TUI resumed on that strandWith eval "$(ka shell-integration)" in .zshrc/.bashrc, the just-exited session’s resume command lands in the live shell’s history after every run: exit, press ↑ then Enter, and you are back in the exact session you left.
| Key | Action |
|---|---|
Enter |
Send, or steer mid-turn (checked between stream deltas) |
+text + Enter, or Alt+Q |
Queue the draft until the turn settles (Ctrl+Q recalls the last queued item into the draft) |
Esc |
Close a popup or the path completion first; otherwise abort turn / re-pin transcript to tail |
Ctrl-C |
Abort turn |
↑ / ↓ |
Input history |
Ctrl-P / Ctrl-N |
Input history |
PgUp / PgDn |
Scroll transcript (title shows ↑N above) |
⇧Enter / Ctrl-J |
Newline in the draft |
| bracketed paste | Multi-line paste arrives as one draft |
Steers and queued items post a visible ack line while the turn runs; nothing you type is lost or silently dropped. Queued slash commands replay through the slash dispatcher in order when the turn settles; entries that no longer parse are skipped, and commands that cannot run headlessly (picker-openers like bare /model) are refused at enqueue time with a reason, so they never mis-run as prompts.
Capture is the default: tool cards, the ▲▼ jump arrows, and the bottom-strip buttons respond to clicks, the wheel scrolls at line granularity, and a plain left-drag over the transcript highlights those rows and copies them to your system clipboard on release (OSC 52; a toast confirms). ⇧drag still selects natively in your terminal.
Ctrl+M (or [tui] mouse = "native" in config) flips to native mode: nothing is captured, so drag selects and pastes with the terminal’s own bindings and the wheel scrolls via alternate-scroll; click-only affordances fall back to their keys (Ctrl+O, Ctrl+↑/↓). The choice persists.
Slash commands
Section titled “Slash commands”/help lists everything with keys. The highlights:
- Model & mode:
/model [sel](picker when empty),/mode [tier],/thinking [level](reasoning-level picker: off | low | medium | high | max, model-dependent; Enter persists, the named form is session-scoped),/settings(persist withs),/provider,/key,/usage,/context - Session:
/session(alias/resume, type-to-filter picker),/new,/fork,/tree,/export,/rewind [N],/name <word>(set a memorable alias;ka --session <name>resumes on it),/transfer [focus](digest the live context into a fresh handoff strand that carries only the summary) - Work:
/plan <task>,/build,/review,/ship,/approve,/compact [focus] - Background work & debugging:
/tasks(picker over background delegates, bash jobs, and debug sessions; Enter pages the selected task’s full result),/debug(live debug sessions: breakpoints and console tail) - Safety:
/undo,/checkpoint,/restore,/spills - Toggles:
/features(panel: ↑↓ choose, Enter toggles,ssaves the set as your user-layer default;/features on|off <spec>toggles directly),/sandbox off|fs(bash sandbox live;fsrecomputes the policy from[sandbox] allow_write). The status bar shows⊘ Nwhile N specs are disabled - Extensions:
/agents,/mcp,/prompt,/memory,/image /quit(alias/exit)
Plus your custom commands from .ka/commands/*.md, which appear in the / popup and /help like builtins.
Rendering
Section titled “Rendering”Markdown with headers, lists, inline code, and fenced blocks with syntax coloring behind a quiet rail. Each tool call renders as one boxed, state-tinted card (violet while running, sage on success, coral on failure) with a ▸/▾ fold marker; clicking a card (capture mode) or Ctrl+O expands its full output in place. Multi-line thinking collapses to its first line plus a count; click a block or Alt+T to toggle it. Every turn closes with a single verdict row (✓ done · 2.1s · 1.2k in · $0.0042), and small actions ack as toasts instead of transcript rows. Rendered rows are cached per entry: streaming redraws only the live region, which keeps the TUI snappy on huge transcripts. NO_COLOR is honored.