Skip to main content
xbot
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

CLI / TUI Channel

The CLI is xbot’s default channel — a full-featured terminal user interface (TUI) built with Bubble Tea. It’s the most powerful way to interact with the agent.

Quick Switch Panel

Two modes

Standalone mode (local)

The CLI runs the agent directly on your machine. No server needed.

xbot-cli                # Launch interactive TUI
xbot-cli "your question" # One-shot Q&A
echo "question" | xbot-cli  # Pipe mode

Remote mode

The CLI connects to a server over WebSocket. The agent runs server-side.

# Use the auto-configured connection from the installer
xbot-cli

# Manually point to a server
xbot-cli --server ws://your-server:8082

In Remote mode, your CLI shares the same Agent instance with other CLI users, Feishu users, and web users.

Setup wizard

On first run, a setup wizard launches automatically. Re-run it anytime with /setup.

Warning
Input box tip: Use arrow keys to highlight the input field → press Enter to enter edit mode → type your text → press Enter again to confirm. Typing without entering edit mode has no effect.

Slash commands

Type these in the TUI:

CommandDescription
/setupRe-run the configuration wizard
/settingsOpen settings panels (sandbox, memory, etc.)
/channelChannel configuration panel — visually manage Web/Feishu/QQ/NapCat channels
/modelView or switch the current LLM model
/modelsList available models
/contextInspect token usage
/clearClear conversation and memory
/newStart a new conversation
/sessionsList or switch sessions
/rewindRewind the conversation
/helpShow all commands

Themes

The CLI supports 9 built-in color schemes. Switch via the Setup wizard or /settings:

midnight · dracula · catppuccin · nord · gruvbox · tokyo · rose · rosepine · default

Rich rendering

The TUI renders markdown, syntax-highlighted code blocks, and Mermaid diagrams inline:

Mermaid diagram rendering

Keyboard shortcuts

Main interface

ShortcutAction
EnterSend message (or enter/confirm edit in input fields)
Ctrl+CCancel current generation
Ctrl+DQuit
Ctrl+KOpen command palette
Ctrl+PQuick subscription switch
Ctrl+TOpen session panel
Ctrl+NNext model
Ctrl+EExpand/collapse long messages
Ctrl+OExpand/collapse tool summaries
Ctrl+JInsert newline
/ Scroll through history
TabAuto-complete slash commands
^Open background task panel (when tasks are running)
/Start typing a slash command

Panels (general)

ShortcutAction
/ Navigate options
EnterSelect / confirm
EscClose panel / return to parent panel
Ctrl+CForce-close panel
Mouse wheelScroll panel content

Settings panel

ShortcutAction
EnterEdit selected item (toggle / dropdown / text input)
Ctrl+SSave settings
EscClose panel
SpaceSwitch dropdown to custom input

From the Settings panel, you can enter sub-panels (Runner config, Danger zone). Press Esc to return.

Panel navigation stack

Panels support push/pop navigation. Entering Panel B from Panel A means Esc returns to A, not directly to the main view:

Settings → Runner config (Esc → back to Settings)
Settings → Danger zone (Esc → back to Settings)

Mouse support

The CLI supports mouse interaction:

ActionDescription
ClickSelect options, buttons, toggle switches
Scroll wheelScroll panels or chat history
Click inputFocus the text input area

In the AskUser split panel, the scroll wheel auto-routes based on position:

  • Scrolling in the upper chat area → browse message history
  • Scrolling in the lower Q&A area → scroll question content

Agent interaction panel (AskUser)

When the agent needs user input, an AskUser split panel appears:

┌─ Chat History (scrollable) ────────────────────┐
│ ... history ...                                  │
├─ AskUser Panel ────────────────────────────────┤
│ ❓ Please choose an option:                      │
│                                                  │
│   ☑ Option A                                     │
│   ☐ Option B                                     │
│   ☐ Option C                                     │
│   ▸ Other: [custom input________]                │
│   ▸ [Submit]                                     │
└──────────────────────────────────────────────────┘

AskUser shortcuts

ShortcutAction
/ Move cursor between options
SpaceToggle checkbox
EnterToggle checkbox / submit (on Submit button)
←→ / TabSwitch question tabs (multiple questions)
Ctrl+SSubmit directly
EscCancel
Mouse wheelScroll Q&A content
Shift+↑↓Scroll chat history above

The title bar shows current operation hints, and the bottom bar displays scroll progress. The cursor auto-scrolls the content when it reaches the panel edge.

Background task panel

Press ^ (caret) to open the background task panel when tasks are running:

ShortcutAction
↑↓Select task
EnterView task log
DelTerminate task
EscReturn to list / close panel

Session panel (Ctrl+T)

Manage multiple conversation sessions:

ShortcutAction
↑↓Select session
EnterSwitch to session / view message preview
DelDelete session (confirmation required)
EscReturn to list / close panel

Real-time progress display

While the agent is working, the TUI shows live updates:

  • Thinking state: dynamic reasoning indicator during deep thought
  • Tool calls: execution status and result summary for each tool
  • Iteration progress: current iteration number and completed tools
  • Streaming output: agent’s reply rendered character by character

Use Ctrl+O to expand/collapse tool execution summaries, and Ctrl+E to expand/collapse long messages.

Bottom hint bar

The TUI always displays the most relevant shortcuts in the bottom bar, adapting dynamically to context:

  • Idle: command palette, auto-complete, subscription switch, etc.
  • Processing: cancel operation
  • In panel: panel-specific hints (e.g., Ctrl+S to save in Settings)

The hint bar is clickable (mouse), providing quick access to /session, Ctrl+K, Ctrl+N, and more.

AI-native configuration

xbot’s agent can adjust its own TUI configuration and interface using built-in tools:

ToolCapability
configAI reads/writes xbot config (theme, layout, subscriptions, etc.); takes effect at runtime
tui_controlAI controls the TUI: switch/close sessions, adjust sidebar width, switch themes, execute slash commands

Typical scenario: you say “switch my theme to dracula and make the sidebar a bit narrower” → the agent calls config set theme dracula + tui_control set_layout sidebar_width 25 → the UI changes instantly.

See also