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:
Detection : Web/TUI input detects a /-prefixed command
Registry lookup : slash_registry finds command metadata
Dispatch : dispatcher.ts executes callback or forwards to SessionManager
Return result : CommandResult returned to client
Each Slash command is registered via SlashCommandDefinition:
Field Description 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
Handler Meaning Description tui-localClient handles it No backend callback callbackBackend callback Dispatched via dispatcher.ts
Configure custom commands in ~/.lingxiao/settings.json or project-level .lingxiao/settings.json:
"description" : " Deploy to production " ,
"prompt" : " Execute deployment: build, test, push image "
"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.:
Command Description /newCreate new session /sessionsList all sessions /forkFork current session /exitExit program /quitExit program
Command Description /agentsView agent list /rolesView role definitions /boardView task board /poolView agent pool
Command Description /permissionView current permission mode /modeSwitch permission mode
Command Description /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
Command Description /helpShow help /configView config /skillsView skills list /pluginsManage plugins /marketplaceAccess marketplace
New commands must be added to slash_registry.ts
Commands with handledBy: 'callback' must have callback behavior in dispatcher.ts
Web autocomplete must be updated only after the backend registry exists
Synonymous commands (e.g., /quit and /exit) are registered as separate entries; command names are not normalized