Skip to content

Custom Commands

LingXiao supports extending CLI and WebUI interaction through the Slash command system. Slash commands are a shared command surface for TUI, Web chat input, and ACP session/command.

The complete flow from user input to execution:

  1. Detection: Web/TUI input detects a /-prefixed command
  2. Registry lookup: slash_registry finds command metadata
  3. Dispatch: dispatcher.ts executes callback or forwards to SessionManager
  4. Return result: CommandResult returned to client

Each Slash command is registered via SlashCommandDefinition:

FieldDescription
nameUnique command name
descUser-facing description
usageOptional usage string
handledBytui-local (client-side) or callback (backend callback)
includeInSuggestionsWhether to appear in autocomplete
includeInHelpWhether to appear in /help
categoryHelp grouping
argCompleterOptional argument completion
HandlerMeaningDescription
tui-localClient handles itNo backend callback
callbackBackend callbackDispatched via dispatcher.ts

Configure custom commands in ~/.lingxiao/settings.json or project-level .lingxiao/settings.json:

{
"commands": {
"deploy": {
"description": "Deploy to production",
"prompt": "Execute deployment: build, test, push image"
},
"review": {
"description": "Code review",
"prompt": "Review current workspace code changes and suggest improvements"
}
}
}

Custom commands start with / and work in both TUI and WebUI. Enter /deploy to trigger the corresponding prompt.

LingXiao includes 66 built-in Slash commands covering session management, agent control, permissions, MCP, plugins, etc.:

CommandDescription
/newCreate new session
/sessionsList all sessions
/forkFork current session
/exitExit program
/quitExit program
CommandDescription
/agentsView agent list
/rolesView role definitions
/boardView task board
/poolView agent pool
CommandDescription
/permissionView current permission mode
/modeSwitch permission mode
CommandDescription
/mcp listList configured MCP servers
/mcp search <query>Search marketplace MCP entries
/mcp install <entry-id>Install marketplace MCP entry
/mcp tools [server-id]View server tools
/mcp call <server-id> <tool-name> [args]Call server tool
/mcp resources [server-id]View server resources
/mcp read-resource <server-id> <uri>Read server resource
/mcp prompts [server-id]View server prompts
/mcp get-prompt <server-id> <prompt-name> [args]Get server prompt
/mcp templates [server-id]List resource templates
/mcp snapshot [server-id]View capability snapshot
/mcp add-remote <id> <url> [name]Add remote HTTP server
/mcp add-stdio <id> <command> [args...]Add stdio server
CommandDescription
/helpShow help
/configView config
/skillsView skills list
/pluginsManage plugins
/marketplaceAccess marketplace
  1. New commands must be added to slash_registry.ts
  2. Commands with handledBy: 'callback' must have callback behavior in dispatcher.ts
  3. Web autocomplete must be updated only after the backend registry exists
  4. Synonymous commands (e.g., /quit and /exit) are registered as separate entries; command names are not normalized