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.
| Command | Aliases | Description |
|---|---|---|
/help | Open the keybindings / commands help overlay (←/→ to page). | |
/new | /clear | Start a fresh session (clears the chat, keeps the system prompt). |
/model | Switch model: bare /model opens the picker; /model provider/id switches inline. | |
/mode | Open the mode picker (build / plan / ask + custom). Active mode is pre-selected. | |
/agents | Browse sub-agent jobs across sessions (multitasking). | |
/attach | Attach to a sub-agent by short or full job ID. | |
/export-subtask | Export a sub-agent transcript by job ID. | |
/details | Toggle the session-statistics panel (tokens, cost, tool calls). | |
/status | Extended status: model, agent, mode, context %, permissions, MCP. | |
/context | Context-window breakdown (system / tools / conversation), cache hit-rate, and compact hint. | |
/thinking | Toggle display of reasoning / thinking blocks (Claude only). | |
/tool-output | /tools-output | Toggle compact vs full tool result bodies in the chat. |
/sessions | /resume | Browse and resume saved sessions. |
/compact | /summarize | Compact the conversation by replacing older messages with a summary. |
/export | Export the current session to ulmi-<date>.md in the cwd. | |
/themes | Open the theme picker. | |
/editor | /edit | Open $EDITOR to compose a long prompt. |
/init | Run config init and write ulmi.yaml to cwd. | |
/undo | Revert the last file mutation. | |
/redo | Re-apply the last undone mutation. | |
/diff | Interactive diff viewer: git changes and per-turn edits. | |
/mcp | View and manage MCP server connections. | |
/skills | Browse and invoke workspace skills. | |
/tasks | /subagents, /bg | Monitor background sub-agent jobs (multitasking). |
/ps | /shells, /bashes | List and attach to shell sessions (multitasking). |
/batch | Fan-out parallel sub-agents (multitasking). | |
/plan | Switch to plan mode (read-only research + plan). Optional prompt: /plan refactor auth. | |
/ask | Switch to ask mode (read-only Q&A). Optional prompt: /ask how does X work?. | |
/build | Switch back to build mode (full tools). | |
/permissions | /perms | Edit permission preset, globals, and rules (session + persist). |
/fork | Clone the current session into a new parallel branch. | |
/goal | Set, show, or clear a sticky session goal (/goal clear). | |
/usage | /cost | Show session token usage and estimated cost (same panel as /details). |
/copy | Copy the last assistant reply to the clipboard (also Ctrl+Y). | |
/exit | /quit, /q | Quit 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:
| Mode | Tools | Writes | Intent |
|---|---|---|---|
build (default) | From active agent | Per permission policy | Normal coding |
plan | Read-only (read, glob, grep, list, webfetch, websearch, question) | Hard-denied | Research and produce a plan |
ask | Read-only (same set) | Hard-denied | Answer 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) andbash - Per-tool levels: every built-in tool (plus any extras from config) —
ask/allow/deny - Rules: add (
a), delete (x), cycle levels (←/→) - Persist (
por 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
| Command | Behaviour |
|---|---|
/model <id> | Switch to provider/model (or a configured group name) without opening the picker. Bare /model opens the picker. |
/status | One panel: directory, model, agent, mode, permission preset, context fill, usage, MCP servers. |
/context | Estimated 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
| Command | Behaviour |
|---|---|
/fork | Saves 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. |
/goal | Bare /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. |
/copy | Copies 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
bashtool calls). - Does not steal the keyboard; follow-ups queue while it runs. Attach via
/pswhen 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 withEscorCtrl+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 historyFull 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)
| Combo | Action |
|---|---|
Ctrl+X then H | Help overlay |
Ctrl+X then N | New session |
Ctrl+X then M | Models picker |
Ctrl+X then A | Mode picker (/mode) |
Ctrl+X then D | Details panel |
Ctrl+X then L | Sessions picker |
Ctrl+X then T | Themes picker |
Ctrl+X then B | Toggle Running tasks strip (or open /tasks if idle) |
Ctrl+↓ | Same as Ctrl+X then B |
Ctrl+X then E | External editor ($EDITOR) |
Ctrl+X then I | Run config init |
Ctrl+X then U | Undo |
Ctrl+X then R | Redo |
Ctrl+X then V | Expand/collapse truncated tool output |
Ctrl+X then F | Diff viewer |
Ctrl+X then Q | Quit |
Direct bindings
| Key | Action |
|---|---|
Ctrl+O | Open the topmost visible file card in an external editor (edit/diff cards jump to the first changed line). |
Ctrl+C | Cancel running stream / quit when idle. |
Ctrl+Y | Copy the last assistant reply to the clipboard. |
Ctrl+S | Toggle mouse capture (switch to select mode for OS-native text selection). |
Ctrl+R | Reverse-search previous prompts (project-scoped). |
Ctrl+↓ | Toggle Running tasks strip (or open /tasks if idle). |
Enter | Send the current input as a message (queues while the agent is busy). |
! at start | Run a shell command directly (shell mode). |
Tab | Accept the highlighted slash/at/$ suggestion when a picker is open; otherwise cycle chrome focus among visible queue/tasks strips and the composer. |
Shift+Tab | Cycle 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 / PgDn | Scroll chat history. |
Esc | Close 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+Ropens incremental reverse search over the same project history.- Persisted in SQLite at
~/.local/share/ulmi/prompt-history.db(seetui.prompt_historyin 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 promptsThe <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 thantui.status_dir_depthsegments (default4), the leading segments are replaced with…. For example/home/user/work/org/repo/subbecomes…/org/repo/subat 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 astokens: 1.0k↑ 10↓ · 900 cache (90%) · $0.0042when 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 segmentsSee 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.
| Key | Action |
|---|---|
y | Allow once |
a | Always allow matching pattern (this session) |
A | Always global (save rule to global config) |
n / Esc | Deny |
Denied calls return an error to the model so it can adapt without crashing. See Permissions.
Themes
Ulmi ships with nine built-in themes:
| Name | Variant |
|---|---|
catppuccin-mocha (default) | Dark, warm pastels |
catppuccin-latte | Light variant of the above |
dracula | Dark, purple-toned |
nord | Arctic blue dark |
gruvbox | Retro warm dark |
solarized-dark | Classic Solarized dark |
solarized-light | Classic Solarized light |
tokyo-night | Neon dark |
one-dark | Atom 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.