Terminal UI (TUI)
cagent’s default interface is a rich, interactive terminal UI with file attachments, themes, session management, and more.
Launching the TUI
# Launch with a config
$ cagent run agent.yaml
# Start with an initial message
$ cagent run agent.yaml "Help me refactor this code"
# Auto-approve all tool calls
$ cagent run agent.yaml --yolo
# Enable debug logging
$ cagent run agent.yaml --debug
Slash Commands
Type / during a session to see available commands, or press Ctrl+K for the command palette:
| Command | Description |
|---|---|
/new |
Start a new conversation |
/compact |
Summarize and compact the conversation history |
/copy |
Copy the conversation to clipboard |
/export |
Export the session as HTML |
/sessions |
Browse and load past sessions |
/model |
Change the model for the current agent |
/theme |
Change the color theme |
/think |
Toggle thinking/reasoning mode |
/yolo |
Toggle automatic tool call approval |
/title |
Set or regenerate session title |
/attach |
Attach a file to your message |
/shell |
Open a shell |
/star |
Star/unstar the current session |
/cost |
Show cost breakdown for this session |
/eval |
Create an evaluation report |
/exit |
Exit the application |
File Attachments
Attach file contents to your messages using the @ trigger:
- Type
@to open the file completion menu - Start typing to filter files (respects
.gitignore) - Select a file to insert the reference
# In the chat input:
Explain what the code in @pkg/agent/agent.go does
The agent receives the full file contents in a structured <attachments> block, while the UI shows just the reference.
Runtime Model Switching
Change the AI model during a session with /model or Ctrl+M:
- Press Ctrl+M or type
/model - Select from config models or type a custom
provider/model - The model switch is saved with the session and restored on reload
Use model switching to try a more capable model for complex tasks, or a cheaper one for simple queries — without modifying your YAML config.
Editable Messages
Edit any previous user message to branch the conversation. Click on a past message to modify it — the agent will re-process from that point, while the original session history is preserved. This is great for exploring alternative approaches without losing your work.
Session Management
cagent automatically saves your sessions. Use /sessions to browse past conversations:
- Browse past sessions with search and filtering
- Star important sessions with
/star - Branch conversations by editing any previous user message — preserving the original session history
- Resume sessions with
cagent run config.yaml --session <id> - Relative refs:
--session -1for the last session,-2for the one before
Session Title Editing
Customize session titles to make them more meaningful and easier to find. By default, cagent auto-generates titles based on your first message, but you can override or regenerate them at any time.
Using the /title command:
/title # Regenerate title using AI (based on recent messages)
/title My Custom Title # Set a specific title
Using the sidebar:
- Click the pencil icon (✎) next to the session title in the sidebar
- Type your new title
- Press Enter to save, or Escape to cancel
Manually set titles are preserved and won’t be overwritten by auto-generation. Title changes are persisted immediately to the session.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+K | Open command palette |
| Ctrl+M | Switch model |
| Ctrl+R | Reverse history search (search previous inputs) |
| Ctrl+L | Start audio listening mode (voice input) |
| Ctrl+Z | Suspend TUI to background (resume with fg) |
| Ctrl+X | Clear queued messages |
| Escape | Cancel current operation |
| Enter | Send message (or newline with Shift+Enter) |
| Up/Down | Navigate message history |
History Search
Press Ctrl+R to enter incremental history search mode. Start typing to filter through your previous inputs. Press Enter to select a match, or Escape to cancel.
Theming
Customize the TUI appearance with built-in or custom themes:
# Switch themes interactively
/theme
Built-in Themes
default, catppuccin-latte, catppuccin-mocha, dracula, gruvbox-dark, gruvbox-light, nord, one-dark, solarized-dark, tokyo-night
Custom Themes
Create theme files in ~/.cagent/themes/ as YAML. Theme files are partial overrides — you only need to specify the colors you want to change. Any omitted keys fall back to the built-in default theme values.
# ~/.cagent/themes/my-theme.yaml
name: "My Custom Theme"
colors:
# Backgrounds
background: "#1a1a2e"
background_alt: "#16213e"
# Text colors
text_bright: "#ffffff"
text_primary: "#e8e8e8"
text_secondary: "#b0b0b0"
text_muted: "#707070"
# Accent colors
accent: "#4fc3f7"
brand: "#1d96f3"
# Status colors
success: "#4caf50"
error: "#f44336"
warning: "#ff9800"
info: "#00bcd4"
# Optional: Customize syntax highlighting colors
chroma:
comment: "#6a9955"
keyword: "#569cd6"
literal_string: "#ce9178"
# Optional: Customize markdown rendering colors
markdown:
heading: "#4fc3f7"
link: "#569cd6"
code: "#ce9178"
Applying Themes
In user config (~/.config/cagent/config.yaml):
settings:
theme: my-theme # References ~/.cagent/themes/my-theme.yaml
At runtime: Use the /theme command to open the theme picker and select from available themes. Your selection is saved globally in ~/.config/cagent/config.yaml under settings.theme and persists across sessions.
Custom themes auto-reload when you save changes to the file — no restart needed. This makes it easy to tweak colors in real-time.
All user themes are applied on top of the default theme. If you want to customize a built-in theme (e.g., dracula), copy its full YAML from the built-in themes on GitHub into ~/.cagent/themes/ and edit the copy. Otherwise, omitted values will use default colors, not the original theme's colors.
Tool Permissions
When an agent calls a tool, cagent shows a confirmation dialog by default. You can:
- Approve once — Allow this specific call
- Always allow — Permanently approve this tool/command for the session
- Deny — Reject the tool call
Granular permissions: The permission system supports pattern-based matching. When you “Always allow” a specific tool command, only that exact pattern is auto-approved — other commands from the same tool still require confirmation. This lets you auto-approve safe, read-only operations while maintaining control over destructive ones.
Use --yolo or the /yolo command to auto-approve all tool calls. You can also toggle this mid-session. For aliases, set --yolo when creating the alias: cagent alias add fast agentcatalog/coder --yolo.