Skip to content
TUI Guide

TUI Guide

The interactive terminal UI is built on Bubble Tea v2.

This page is the canonical reference for slash commands and keybindings. Queue, /tasks, /ps, and /batch are in TUI Multitasking. Package layout, message dispatch, and the agent-turn loop are in Architecture → TUI.

Layout

An empty conversation shows the centered Ulmi wordmark:

╻ ╻╻  ┏┳┓╻
┃ ┃┃  ┃┃┃┃
┗━┛┗━╸╹ ╹╹

Type a message below it to start a conversation.

┌──────────────────────────────────────────────────────────┐
│ ~/projects/ulmi   model: … agent: build  ctx 4.2K  $0.003 │ ← Status bar
├──────────────────────────────────────────────────────────┤
│  > Refactor the auth module                              │
│                                                          │
│  ✓ read    internal/auth/login.go                        │
│  ✓ edit    internal/auth/login.go                        │
│  ✓ bash    go test ./internal/auth/...                   │
│                                                          │
│  All tests pass.                                         │   ← Chat / messages
├──────────────────────────────────────────────────────────┤
│ Message queue                                            │   ← Queued follow-ups
│  · 1. after auth, update the migration                   │     (when agent busy)
├──────────────────────────────────────────────────────────┤
│ Running tasks                                            │   ← Active sub-agents only
│  ▶ implementer  running                                  │     (auto-hides when idle)
│  tab focus  /tasks all  ctrl+x b toggle                  │
├──────────────────────────────────────────────────────────┤
│ > Now add tests for the new branch                       │   ← Input box
├──────────────────────────────────────────────────────────┤
│ Ctrl+X H help · Ctrl+X N new · / commands · Esc cancel   │   ← Hints
└──────────────────────────────────────────────────────────┘

Compact Queue and Running tasks strips sit above the composer. TUI Multitasking covers focus, keys, and /tasks.

Slash commands

Type / in the input box to open the command picker. Use the arrow keys to navigate, Tab or Enter to confirm, Esc to cancel.

CommandAliasesDescription
/helpOpen the keybindings / commands help overlay (←/→ to page).
/new/clearStart a fresh session (clears the chat, keeps the system prompt).
/modelSwitch model: bare /model opens the picker; /model provider/id switches inline.
/modeOpen the mode picker (build / plan / ask + custom). Active mode is pre-selected.
/agentsBrowse sub-agent jobs across sessions (multitasking).
/attachAttach to a sub-agent by short or full job ID.
/export-subtaskExport a sub-agent transcript by job ID.
/detailsToggle the session-statistics panel (tokens, cost, tool calls).
/statusExtended status: model, agent, mode, context %, permissions, MCP.
/contextContext-window breakdown (system / tools / conversation), cache hit-rate, and compact hint.
/thinkingToggle display of reasoning / thinking blocks (Claude only).
/tool-output/tools-outputToggle compact vs full tool result bodies in the chat.
/sessions/resumeBrowse and resume saved sessions.
/compact/summarizeCompact the conversation by replacing older messages with a summary.
/exportExport the current session to ulmi-<date>.md in the cwd.
/themesOpen the theme picker.
/editor/editOpen $EDITOR to compose a long prompt.
/initRun config init and write ulmi.yaml to cwd.
/undoRevert the last file mutation.
/redoRe-apply the last undone mutation.
/diffInteractive diff viewer: git changes and per-turn edits.
/mcpView and manage MCP server connections.
/skillsBrowse and invoke workspace skills.
/tasks/subagents, /bgMonitor background sub-agent jobs (multitasking).
/ps/shells, /bashesList and attach to shell sessions (multitasking).
/batchFan-out parallel sub-agents (multitasking).
/planSwitch to plan mode (read-only research + plan). Optional prompt: /plan refactor auth.
/askSwitch to ask mode (read-only Q&A). Optional prompt: /ask how does X work?.
/buildSwitch back to build mode (full tools).
/permissions/permsEdit permission preset, globals, and rules (session + persist).
/forkClone the current session into a new parallel branch.
/goalSet, show, or clear a sticky session goal (/goal clear).
/usage/costShow session token usage and estimated cost (same panel as /details).
/copyCopy the last assistant reply to the clipboard (also Ctrl+Y).
/exit/quit, /qQuit Ulmi (asks for confirmation if streaming). After exit, prints a resume hint; with tui.print_history_on_exit (default true) also dumps the chat transcript to the terminal scrollback.

Session modes (/mode, /plan, /ask, /build)

Switch via /mode (picker), /plan / /ask / /build, or Shift+Tab:

ModeToolsWritesIntent
build (default)From active agentPer permission policyNormal coding
planRead-only (read, glob, grep, list, webfetch, websearch, question)Hard-deniedResearch and produce a plan
askRead-only (same set)Hard-deniedAnswer questions without a plan ritual

Cycle modes with Shift+Tab. The status bar shows mode: plan / mode: ask when not in build mode. Plan/ask hard-deny mutating tools even if an allow rule would otherwise permit them.

/permissions

Opens an overlay to edit:

  • Preset: manual (default) → accept_edits (auto-allow file edits) → dont_ask (Ask becomes Deny)
  • Category defaults: edit (write/edit/delete/patch) and bash
  • Per-tool levels: every built-in tool (plus any extras from config) — ask / allow / deny
  • Rules: add (a), delete (x), cycle levels (←/→)
  • Persist (p or Enter on Persist): write to ~/.config/ulmi/config.yaml

Changes apply to the current session immediately; Persist writes the global config.

/model, /status, /context, /usage

CommandBehaviour
/model <id>Switch to provider/model (or a configured group name) without opening the picker. Bare /model opens the picker.
/statusOne panel: directory, model, agent, mode, permission preset, context fill, usage, MCP servers.
/contextEstimated context fill with a bar and breakdown (system prompt, tool schemas, conversation, skills). Shows prompt-cache hit-rate, auto-compact headroom, and a compact hint.
/usage (/cost)Opens the tokens/cost/tool-calls panel (same as /details). Safe to run while streaming.

/fork, /goal, /copy

CommandBehaviour
/forkSaves the current session (when a store is configured), clones history/tokens into a new session titled Fork of …, and switches the TUI to the fork. The original remains available under /sessions. Blocked while streaming or when there is no conversation yet.
/goalBare /goal shows the current sticky goal. /goal <text> sets it and injects it into the system prompt for subsequent turns. /goal clear (also none, --clear) removes it. Cleared on /new and when resuming another session; preserved across /fork in the live session.
/copyCopies the last assistant reply to the clipboard (same as Ctrl+Y). Warns if there is nothing to copy. Safe to run while streaming.

Custom slash commands

Commands are loaded at TUI start and attached to that App’s slash registry (tui.WithSlashRegistry). Two TUI instances in one process can hold different command sets.

Load markdown commands from (later dirs win):

  • ~/.claude/commands/, ~/.cursor/commands/, ~/.config/opencode/commands/, ~/.config/ulmi/commands/
  • Project: walk from git root → cwd; at each level the same four dirs, with .ulmi/commands/ preferred
---
description: Run tests and fix failures
agent: build
model: ollama/qwen3
argument-hint: [package]
allowed-tools: [bash, read, edit]
---
Run `go test {{args}} ./...` and fix any failures.
Git status: !`git status --short`

Filename (without .md) becomes the command name (review.md → /review). Template placeholders: {{args}} / $ARGUMENTS, and !`shell` (fails the command on shell error). allowed-tools applies for that turn only, then restores the agent tool set. Built-in names always win; load warnings and conflicts appear as chat notices at startup.

Multitasking (/tasks, /ps, /batch, queue)

While the agent is busy, follow-ups queue instead of dropping, background sub-agents show in a pinned strip, and ! / bash shells detach from the keyboard. Overlay keys, chrome focus, @agent:… mentions, and /batch flags: TUI Multitasking.

Shell mode

Prefix any input with ! to run a shell command directly in your terminal, without going through the LLM tool loop:

! git status
! go test ./...

Shell mode:

  • Executes the command immediately (no permission prompt — it is your terminal).
  • Shows live output in a terminal card, then keeps a persistent result card in the chat (same rendering as agent bash tool calls).
  • Does not steal the keyboard; follow-ups queue while it runs. Attach via /ps when the command needs stdin.
  • Adds the command output to the conversation context so the agent can reference it in follow-up messages.
  • Uses an accent border and a dedicated placeholder while the input starts with !.
  • Exit shell mode on a bare ! prompt with Esc or Ctrl+U.

Configure in ulmi.yaml:

tui:
  shell_mode:
    enabled: true              # default: true
    respond_to_output: false   # default: false — set true to auto-trigger an LLM reply
    max_output_lines: 150      # truncate output stored in LLM history

Full keys: Configuration. Attach a running ! command with /ps (multitasking).

Keybindings

Ulmi uses a leader-key style: press the leader (default Ctrl+X) followed by a single letter for most actions. A few keys are direct bindings active at all times.

Leader-prefixed actions (default leader: Ctrl+X)

ComboAction
Ctrl+X then HHelp overlay
Ctrl+X then NNew session
Ctrl+X then MModels picker
Ctrl+X then AMode picker (/mode)
Ctrl+X then DDetails panel
Ctrl+X then LSessions picker
Ctrl+X then TThemes picker
Ctrl+X then BToggle Running tasks strip (or open /tasks if idle)
Ctrl+↓Same as Ctrl+X then B
Ctrl+X then EExternal editor ($EDITOR)
Ctrl+X then IRun config init
Ctrl+X then UUndo
Ctrl+X then RRedo
Ctrl+X then VExpand/collapse truncated tool output
Ctrl+X then FDiff viewer
Ctrl+X then QQuit

Direct bindings

KeyAction
Ctrl+OOpen the topmost visible file card in an external editor (edit/diff cards jump to the first changed line).
Ctrl+CCancel running stream / quit when idle.
Ctrl+YCopy the last assistant reply to the clipboard.
Ctrl+SToggle mouse capture (switch to select mode for OS-native text selection).
Ctrl+RReverse-search previous prompts (project-scoped).
Ctrl+↓Toggle Running tasks strip (or open /tasks if idle).
EnterSend the current input as a message (queues while the agent is busy).
! at startRun a shell command directly (shell mode).
TabAccept the highlighted slash/at/$ suggestion when a picker is open; otherwise cycle chrome focus among visible queue/tasks strips and the composer.
Shift+TabCycle session mode: build → plan → ask.
↑ / ↓In a focused strip: navigate items. With composer focus, non-empty queue and empty composer: edit last / focus queue. Otherwise recall previous prompts when the cursor is on the first/last line (or navigate pickers).
PgUp / PgDnScroll chat history.
EscClose the top overlay (or cancel slash-picker); return chrome focus to the composer when a strip is focused.

Prompt history

Submitted prompts (messages, / commands, and ! shell lines) are remembered for the current project directory:

  • ↑ / ↓ cycle history with a draft buffer (your unsubmitted text is restored when you move past the newest entry). When the message queue is non-empty, the composer is empty, and chrome focus is on the composer, ↑/↓ manage the queue first (see TUI Multitasking).
  • Recalling a previous / command (or $ / @ token) does not open the autocomplete picker: arrows keep walking history. The picker appears when you type / (or edit the recalled text).
  • History navigation is multiline-safe: while editing mid-prompt, arrows move the cursor; recall activates at the first/last visual row (or when empty).
  • Ctrl+R opens incremental reverse search over the same project history.
  • Persisted in SQLite at ~/.local/share/ulmi/prompt-history.db (see tui.prompt_history in the configuration guide).

The default bindings are listed above and can be overridden via tui.keybinds. Action names must match the keymap (new_session, models, sessions, quit, themes, mode, …). There is no compact action — use /compact. Ctrl+X then T is themes, not thinking (/thinking).

tui:
  leader_key: ctrl+space
  keybinds:
    new_session:    "<leader>n"
    sessions:       "<leader>s"
    quit:           "<leader>x"
    copy_reply:     "ctrl+shift+c"  # direct binding (no <leader>)
    history_search: "ctrl+r"        # reverse-search previous prompts

The <leader> placeholder is substituted with the configured leader key at load time.

Status bar

The status bar shows:

  • Working directory (left) — the directory Ulmi was started in. The home directory prefix is shortened to ~. When the path is longer than tui.status_dir_depth segments (default 4), the leading segments are replaced with …. For example /home/user/work/org/repo/sub becomes …/org/repo/sub at depth 3.
  • Active model — provider/model name, highlighted in the theme’s primary colour.
  • Active agent — current agent name (e.g. build).
  • Token usage — input + output tokens accumulated for this session, shown as ctx N/MAX (P%) when the model has a known context window. Each assistant turn also has a footer such as tokens: 1.0k↑ 10↓ · 900 cache (90%) · $0.0042 when the provider reported cache reads.
  • Estimated cost — omitted for free / local models.

Configure the directory depth in your config:

tui:
  status_dir_depth: 3   # show only last 3 path segments

See Token Counting for how token numbers are computed.

Confirmation dialog

When the agent calls a tool with permission: ask (typically bash or edit), a confirmation strip appears above the composer showing the tool name, target (command or file path), and how many similar prompts are queued behind it. While a full-screen overlay (/models, /help, …) is open, the strip stays pending and does not take keys; close the overlay to return to the prompt.

KeyAction
yAllow once
aAlways allow matching pattern (this session)
AAlways global (save rule to global config)
n / EscDeny

Denied calls return an error to the model so it can adapt without crashing. See Permissions.

Themes

Ulmi ships with nine built-in themes:

NameVariant
catppuccin-mocha (default)Dark, warm pastels
catppuccin-latteLight variant of the above
draculaDark, purple-toned
nordArctic blue dark
gruvboxRetro warm dark
solarized-darkClassic Solarized dark
solarized-lightClassic Solarized light
tokyo-nightNeon dark
one-darkAtom One Dark

Switch in real time with /themes or set tui.theme: <name> in your config file. /themes updates the TUI instance palette (App.Theme()) and persists tui.theme. Built-in palettes ship with the binary; drop a YAML file into ~/.config/ulmi/themes/ to add your own (see below).

Custom themes

Drop a YAML file into ~/.config/ulmi/themes/<name>.yaml:

name: ocean
description: "Calm blue palette"
status_bar_bg: "#0f111a"
normal:        "#cdd6f4"
muted:         "#5b6275"
primary:       "#82aaff"
success:       "#c3e88d"
warning:       "#ffcb6b"
error:         "#ff5370"
info:          "#89ddff"
accent:        "#c792ea"
border:        "#1f2233"
border_focused: "#82aaff"

The custom themes are loaded at startup and appear alongside built-in themes in the picker.

Mouse support

Mouse capture is on by default (cell-motion mode), so the mouse wheel scrolls the chat immediately. Toggle with Ctrl+S to switch to select mode, which restores the terminal’s native text selection for copy/paste. While in select mode, PgUp/PgDn still scroll the chat history. To select text while mouse capture is on, use Shift+click/drag — most modern terminals pass shift-modified clicks through to the OS even when mouse capture is active.

External editor

/editor (or Ctrl+X E) opens the configured editor (tui.file_opener.editor, then $EDITOR, then $VISUAL, then vi) on a temp file seeded with whatever you have in the input box. When the editor exits cleanly, the file contents are sent as your next message. Quitting the TUI cancels the editor process (same as other app-lifetime I/O).

File cards (read, edit, and other path-bearing tools) can be opened with Ctrl+O or by clicking open in editor. Edit and /diff cards show a right-aligned line-number gutter; the column is padded to the largest line in that diff so going from 9→10 or 99→100 does not shift the change text. The red/green background covers each changed row as a whole (gutter, +/-, and code), padded to the card width.