Features How it works Docs Pricing Compare LeanCTX Discord

TUI Commands

LeanCTL's full-screen terminal UI supports slash commands, keyboard shortcuts, file attachments, and inline shell commands.

Slash Commands

Type / or press Ctrl+P to access commands. Commands are organized by category.

Sessions

CommandShortcutDescription
/newCtrl+NStart a new conversation
/sessionsCtrl+SBrowse past sessions
/resume <n>Resume session by number
/delete <n>Delete a session
/exportCtrl+X XExport chat as markdown

Models & Providers

CommandShortcutDescription
/modelCtrl+LOpen model picker
/model <name>Switch to a specific model
/model <provider>/<model>Switch provider and model
/connectSetup guide for all providers
/connect listShow configured providers
/connect testTest current connection
/connect add <name> --type <type>Add a new provider
/thinking <mode>Set thinking mode: auto, always, never, manual

Tools & MCP

CommandShortcutDescription
/mcpShow MCP server status
/mcp add <name> <cmd>Add MCP server
/mcp reloadReconnect all servers
/verboseCtrl+EToggle tool detail output

Code & Git

CommandShortcutDescription
/diffCtrl+X DGit diff of session changes
/undoCtrl+X UUndo file changes (git restore)
/redoCtrl+X RRedo undone changes

Context & Savings

CommandShortcutDescription
/contextShow context token usage
/compact [focus]Ctrl+X CCompress conversation to save tokens
/costShow API cost & token savings
/statsToken savings statistics (today)
/wrapped [period]Savings report (day/week/month)
/knowledge [query]Knowledge base status or search
/benchmark [file]Token compression benchmark
/lab [key value]Tune lean-ctx compression parameters

Settings

CommandDescription
/yoloToggle auto-approve for all tool executions
/theme <name>Switch TUI theme (or open theme picker)
/initCreate LEANCTL.md project instructions file
/sidebarToggle sidebar visibility
/verboseToggle detailed tool output (alias: /details)
/lab [key value]View or tune LeanCTX compression parameters
/clearClear conversation (keep context)
/exitQuit LeanCTL

Custom Commands

Any /command that doesn't match a built-in will look for a markdown file in .leanctl/commands/ or ~/.leanctl/commands/. The file content is sent as a prompt with $ARGUMENTS replaced by the command arguments. See Configuration for details.

Keyboard Shortcuts

General

KeyAction
EnterSend message
Shift+EnterNew line in input
Ctrl+CQuit (with confirmation)
Ctrl+DQuit immediately
EscCancel current action (press twice)
TabToggle Build/Plan mode

Navigation

KeyAction
Ctrl+NNew session
Ctrl+SBrowse sessions
Ctrl+LModel info / picker
Ctrl+PCommand palette
Ctrl+BToggle sidebar (files in context)
Ctrl+TExpand thinking output
Ctrl+EToggle tool details
Ctrl+OOpen external editor ($VISUAL or $EDITOR, fallback: vim)
PageUp / PageDownScroll chat

Text Editing

KeyAction
Alt+←/→Jump by word
Ctrl+AMove to line start
Ctrl+WDelete word backwards
Ctrl+KDelete to end of line
Ctrl+UDelete to start of line

Quick Actions (Ctrl+X, then key)

SequenceAction
Ctrl+X NNew session
Ctrl+X LSession picker
Ctrl+X YCopy last message
Ctrl+X XExport chat
Ctrl+X CCompact context
Ctrl+X DGit diff
Ctrl+X UUndo
Ctrl+X RRedo
Ctrl+X SToggle mouse scroll
Ctrl+X QQuit

Inline Features

File attachments with @

Reference files in your prompt to include their content as context:

@src/auth.ts fix the token validation bug
@package.json @tsconfig.json update the build config

Multiple @ references can be used in a single prompt.

Shell commands with !

Run a shell command and attach its output to your prompt:

!npm test — fix the failing tests
!git log --oneline -5 — summarize recent changes

Model Picker

Press Ctrl+L or type /model to open the interactive model picker. It shows:

  • All configured models from your [[providers]] registry
  • Local Ollama models (auto-detected)
  • Provider type and tier indicators

Type to filter, use arrow keys to navigate, and press Enter to select.

Build & Plan Modes

Toggle between modes with Tab:

  • Build mode (default): The AI has access to all 23 tools — read, write, edit, run commands, git, web, etc.
  • Plan mode: The AI only has access to read-only tools (no writes, no command execution, no task). It analyzes your request and proposes a plan without making changes.

Permission Dialog

When the AI wants to edit a file or run a command, a permission dialog appears showing:

  • The tool name and permission level
  • A diff preview for file edits (unified or split view for wide terminals)
  • Three options: Allow (a), Always Allow (s), or Deny (d)

"Always Allow" grants permission for that tool for the rest of the session. Use /yolo or leanctl --yolo to skip all dialogs.

Toggle with Ctrl+B or /sidebar. Shows "Files in Context" — all files the AI has read during the session, extracted from read_file tool calls.

Session Picker

Press Ctrl+S or type /sessions to browse past sessions. The picker supports:

  • Resume a previous session
  • Search sessions by title
  • Rename sessions
  • Delete sessions

Undo & Redo

LeanCTL uses git stash internally for undo/redo. When you type /undo, it restores files to their state before the AI's last changes. /redo re-applies them. Requires a git repository.

Use /undo msg to remove the last chat message without reverting file changes.

Adding Providers via /connect

The /connect command provides an interactive way to add and manage providers without editing config files:

# Setup guide
/connect

# Add a provider interactively
/connect anthropic
/connect openai
/connect ollama

# Add with full parameters
/connect add myserver --type openai --url https://my-api.com/v1 --key sk-... --model gpt-4.1

# Test connection
/connect test

# List all providers
/connect list

# Remove a provider
/connect remove myserver