11 KiB
CAI TUI Commands Reference
⚡ CAI-Pro Exclusive Feature
The Terminal User Interface (TUI) is available exclusively in CAI-Pro. To access this feature and unlock advanced multi-agent workflows, visit Alias Robotics for more information.
This comprehensive guide documents all commands available in the CAI Terminal User Interface (TUI), including command palette actions, keyboard shortcuts, and CLI-style commands.
Command Categories
CAI TUI commands are organized into the following categories:
- Agent Management
- Model Management
- Terminal Control
- History and Memory
- Session Management
- Parallel Execution
- MCP Integration
- Utility Commands
- Navigation and UI
Agent Management
/agent or /a
Switch between agents or list all available agents.
Syntax:
/agent [agent_name]
/a [agent_name]
Examples:
# List all available agents
/agent
# Switch to red team agent
/agent redteam_agent
# Switch to bug bounty agent
/a bug_bounter_agent
Available Agents (Community Edition):
redteam_agent- Offensive security testingblueteam_agent- Defensive security analysisbug_bounter_agent- Bug bounty huntingretester_agent- Retesting and validationone_tool_agent- Basic single-tool executiondfir_agent- Digital forensics and incident responsereporting_agent- Report generation and documentationreverse_engineering_agent- Binary analysis and reverse engineeringnetwork_security_analyzer_agent- Network security assessmentwifi_security_agent- WiFi security testingmemory_analysis_agent- Memory forensicsdns_smtp_agent- DNS and SMTP analysisreplay_attack_agent- Replay attack testingsubghz_sdr_agent- Sub-GHz and SDR analysisthought_agent- Reasoning and planning
Notes:
- Agent changes are immediate and affect only the active terminal
- Each terminal can run a different agent simultaneously
- Agent context is preserved when switching between terminals
Model Management
Model Selection via Dropdown
CAI TUI uses model dropdowns in each terminal header for model management. Models are configured via environment variables and aliases.
Available Models:
alias0- Primary model alias (configured viaCAI_MODEL)alias1- Secondary model aliasgpt-4o- OpenAI GPT-4 Optimizedgpt-4-turbo- OpenAI GPT-4 Turboclaude-3-5-sonnet-20241022- Anthropic Claude 3.5 Sonneto1-mini- OpenAI O1 Minio1-preview- OpenAI O1 Preview
How to Change Models:
- Click the model dropdown in any terminal header
- Select desired model from the list
- Model change takes effect immediately for that terminal
Environment Variables:
export CAI_MODEL=gpt-4o # Set default model
export CAI_OPENAI_API_KEY=sk-... # OpenAI API key
export CAI_ANTHROPIC_API_KEY=sk-... # Anthropic API key
Notes:
- Each terminal can use a different model
- Model costs are tracked separately per terminal
- Switching models mid-conversation preserves history
Terminal Control
Terminal-Specific Commands
Send commands to specific terminals using the T<num>: prefix.
Syntax:
T<terminal_number>:<command>
Examples:
# Switch agent in Terminal 2
T2:/agent blueteam_agent
# Change model in Terminal 3
T3:/model gpt-4o
# Clear Terminal 1
T1:/clear
# Execute command in Terminal 4
T4:scan target.com for vulnerabilities
Keyboard Shortcut: Click the [+] button in the top bar
Notes:
- New terminals start with
redteam_agentby default - Maximum recommended terminals: 4 (for optimal UX)
- Terminals beyond 4 use scrollable layout
History and Memory
/history [number] [agent_name] or /h
Display conversation history for the current or specified agent.
Syntax:
/history [number] [agent_name]
Examples:
# Show last 10 messages
/history
# Show last 20 messages
/history 20
# Show history for specific agent
/history 10 redteam_agent
# Compact syntax
/h 5
Notes:
- Default shows last 10 interactions
- History includes both user prompts and agent responses
- History is terminal-specific
/flush [agent_name|all]
Clear agent message history.
Syntax:
/flush [agent_name|all]
Examples:
# Flush current agent history
/flush
# Flush specific agent
/flush redteam_agent
# Flush all agents
/flush all
Notes:
- Flushing is irreversible
- Agent context window is reset
- Useful for starting fresh conversations
/memory [subcommand] or /mem
Advanced memory management for agents.
Syntax:
/memory <subcommand>
/mem <subcommand>
Subcommands:
list
Show all saved memories.
/memory list
save [name]
Save current conversation as a memory.
/memory save "Authentication bypass research"
/mem save pentest_findings
apply <memory_id>
Apply a saved memory to the current agent.
/memory apply mem_12345
show <memory_id>
Display the content of a specific memory.
/memory show mem_12345
delete <memory_id>
Remove a memory permanently.
/memory delete mem_12345
merge <id1> <id2> [name]
Combine two memories into one.
/memory merge mem_12345 mem_67890 "Combined pentesting notes"
compact
AI-powered memory summarization.
/memory compact
status
Show memory system status and statistics.
/memory status
Notes:
- Memories persist across sessions
- Useful for resuming long-term research projects
- AI-powered summarization reduces token usage
Session Management
/save <filename>
Save the current conversation to a file.
Syntax:
/save <filename>
Supported Formats:
- JSON (
.json) - Markdown (
.md)
Examples:
# Save as JSON
/save pentest_session.json
# Save as Markdown
/save findings_report.md
# Save with full path
/save ~/Documents/cai_sessions/project_alpha.json
Notes:
- Saves all terminal conversations
- Includes agent names, models, and timestamps
- Cost information is preserved
/load <filename> or /l
Load a previously saved conversation.
Syntax:
/load <filename>
/l <filename>
Examples:
# Load JSON session
/load pentest_session.json
# Load Markdown report
/load findings_report.md
# Compact syntax
/l ~/cai_sessions/old_session.json
Notes:
- Restores agent context and history
- Compatible with both JSON and Markdown formats
- Loading does not affect current cost tracking
Utility Commands
/cost [agent_name]
Display API usage costs and token statistics.
Syntax:
/cost [agent_name]
Examples:
# Show costs for active terminal
/cost
# Show costs for specific agent
/cost redteam_agent
# Show total session costs
/cost all
Output Includes:
- Total cost (USD)
- Input tokens used
- Output tokens used
- Cost per interaction
- Model pricing rates
- Terminal breakdown
/help [command] or /?
Get help for commands.
Syntax:
/help [command]
/? [command]
Examples:
# General help
/help
# Help for specific command
/help agent
/help parallel
/? mcp
/env
Display environment variables relevant to CAI.
Syntax:
/env
Output Includes:
CAI_MODEL- Default modelCAI_AGENT_TYPE- Default agentCAI_MAX_TURNS- Maximum interaction turnsCAI_TRACING- Tracing statusCAI_GUARDRAILS- Guardrails enabledCAI_PRICE_LIMIT- Cost limitCAI_TUI_MODE- TUI mode settings- API keys (masked)
/shell or $
Execute shell commands directly from the TUI.
Syntax:
/shell <command>
$<command>
Examples:
# List files
/shell ls -la
# Check network
$ping -c 3 target.com
# Run nmap scan
$nmap -sV 192.168.1.1
Notes:
- Commands execute in the system shell
- Output is displayed in the terminal
- Use with caution - no sandboxing
/kill
Terminate the currently executing agent operation.
Syntax:
/kill
Keyboard Shortcut: Ctrl+C
Notes:
- Stops agent mid-execution
- Partial responses are discarded
- Agent context is preserved
/clear
Clear the terminal output.
Syntax:
/clear
Keyboard Shortcut: Ctrl+L
Notes:
- Clears visual output only
- Conversation history is preserved
- Cost tracking continues
Keyboard Shortcut: Ctrl+Q
Notes:
- Prompts for confirmation if agents are running
- Unsaved sessions will be lost
- Graceful shutdown of all terminals
Navigation and UI
Command Palette
Access the command palette for quick command search and execution.
Keyboard Shortcut: Ctrl+P
Features:
- Fuzzy search for commands
- Command descriptions
- Keyboard navigation (arrow keys, Enter)
- Recent commands
- Theme switching
Sidebar Toggle
Show or hide the sidebar.
Keyboard Shortcut: Ctrl+S
Alternative: Click the [≡] button in the top bar
Tab Navigation
Switch between main TUI tabs (Terminal, CTR, Help).
Keyboard Shortcuts:
Ctrl+1- Show Terminal tabCtrl+2- Show CTR tabCtrl+Tab- Cycle through tabs
Alternative: Click tab headers in the top bar
Theme Cycling
Cycle through available visual themes.
Keyboard Shortcut: Ctrl+Shift+T
Available Themes:
- Default (dark)
- Light
- High Contrast
- Minimal
- Custom (if configured)
Terminal View Toggle
Toggle between showing all terminals and only the focused one.
Keyboard Shortcut: Ctrl+T
Use Cases:
- Focus mode for single-agent work
- Maximize screen real estate
- Presentation mode
Queue Display
Show the prompt queue status.
Keyboard Shortcut: Ctrl+Shift+Q
Alternative: Switch to Queue tab in sidebar (Alt+2)
Clear Input
Clear the prompt input field.
Keyboard Shortcut: Ctrl+U
Broadcast Prompt
Send the same prompt to all active terminals simultaneously.
Keyboard Shortcut: Ctrl+Shift+A
Use Cases:
- Parallel agent execution
- Comparing agent responses
- Team-based workflows
Cancel Operations
Cancel running operations.
Keyboard Shortcuts:
Ctrl+C- Cancel execution in focused terminalEscape- Cancel all running agents (press twice to exit)
Next Steps
- Terminals Management - Advanced multi-terminal workflows
- Keyboard Shortcuts - Complete keyboard reference
- User Interface Guide - Visual components and layouts
- Teams Configuration - Using and customizing teams
For questions or issues, visit CAI GitHub Issues.
Last updated: October 2025 | CAI TUI v0.6+