Command Line Reference
Complete command line reference for lsbot.
Table of Contents
Global Options
These options are available for all commands:
| Flag | Default | Description |
|---|---|---|
-h, --help | Show help for any command | |
--log | info | Log level: trace, debug, info, warn, error, fatal, panic |
-y, --yes | false | Auto-approve all operations (skip confirmation prompts) |
--no-files | false | Disable all file operation tools |
Commands
channels
Manage platform channel credentials stored in ~/.lingti.yaml. Credentials saved here are automatically loaded by gateway — no flags needed at startup.
channels add
Add or update credentials for a platform channel.
Required flag: --channel <name> — the platform to configure.
Platform credential flags:
| Channel | Flags |
|---|---|
telegram | --token |
slack | --bot-token, --app-token |
discord | --token |
feishu | --app-id, --app-secret |
dingtalk | --client-id, --client-secret |
wecom | --corp-id, --agent-id, --secret, --token, --aes-key, --port |
whatsapp | --phone-id, --access-token, --verify-token |
line | --channel-secret, --channel-token |
teams | --app-id, --app-password, --tenant-id |
matrix | --homeserver-url, --user-id, --access-token |
mattermost | --server-url, --token, --team-name |
signal | --api-url, --phone-number |
imessage | --bluebubbles-url, --bluebubbles-password |
twitch | --token, --channel-name, --bot-name |
nostr | --private-key, --relays |
zalo | --app-id, --secret-key, --access-token |
nextcloud | --server-url, --username, --password, --room-token |
googlechat | --project-id, --credentials-file |
webapp | --port, --auth-token |
Examples:
channels list
Show a table of all platforms with their configuration status.
Output:
channels remove
Remove all credentials for a platform from ~/.lingti.yaml.
Example:
agents
Manage named agents and their routing bindings. Each agent has its own isolated workspace, AI model, and instructions. Routing bindings control which agent handles messages from which platform or channel.
agents add
Add a new agent to ~/.lingti.yaml. Creates the workspace directory if it doesn't exist.
Arguments: <id> — unique agent identifier (required, positional).
Flags:
| Flag | Default | Description |
|---|---|---|
--workspace <dir> | ~/.lingti/agents/<id> | Working directory for this agent |
--model <id> | (inherited) | Model override (e.g. claude-opus-4-6) |
--provider <name> | (inherited) | AI provider override |
--api-key <key> | (inherited) | API key override |
--instructions <text-or-path> | Inline instructions text, or path to a file | |
--default | false | Mark as the default agent |
--allow-tools <list> | Comma-separated tool whitelist (empty = allow all) | |
--deny-tools <list> | Comma-separated tool blacklist |
Examples:
agents list
List all configured agents. Add --bindings to also show routing bindings.
Flags:
| Flag | Description |
|---|---|
-b, --bindings | Also show routing bindings table |
Example output:
agents bind
Add routing bindings that direct messages from a platform (or specific channel) to a named agent.
Flags:
| Flag | Description |
|---|---|
--agent <id> | Agent ID (defaults to the config default agent) |
--bind <spec> | Binding spec: <platform> or <platform>:<channelID> (repeatable) |
Binding spec format:
telegram— all messages from Telegramslack:C_WORK— only messages from the Slack channel with IDC_WORK
Examples:
agents unbind
Remove routing bindings for an agent.
Flags:
| Flag | Description |
|---|---|
--agent <id> | Agent ID (defaults to the config default agent) |
--bind <spec> | Specific binding to remove (repeatable) |
--all | Remove all bindings for this agent |
Examples:
gateway
The unified run command. Starts all configured platform bots and the WebSocket server in a single process.
What gateway does:
- Reads
~/.lingti.yamlfor platform credentials and agent definitions - Registers all configured platforms (Telegram, Slack, Discord, etc.)
- Starts the WebSocket server on
:18789(unless--no-ws) - Routes incoming messages to the correct agent based on bindings
- Writes
~/.lingti/gateway.pidfor use bygateway restart
Flags:
| Flag | Env Var | Default | Description |
|---|---|---|---|
--addr | GATEWAY_ADDR | :18789 | WebSocket server address |
--auth-token | GATEWAY_AUTH_TOKEN | Single WebSocket auth token | |
--auth-tokens | GATEWAY_AUTH_TOKENS | Comma-separated WebSocket auth tokens | |
--no-ws | false | Disable WebSocket server (platform bots only) | |
--provider | AI_PROVIDER | claude | AI provider |
--api-key | AI_API_KEY | AI API key (required) | |
--base-url | AI_BASE_URL | Custom AI API base URL | |
--model | AI_MODEL | Model name | |
--instructions | Path to custom instructions file | ||
--call-timeout | AI_CALL_TIMEOUT | 90 | AI API call timeout in seconds |
--debug-dir | BROWSER_DEBUG_DIR | Directory for browser debug screenshots | |
--webapp-port | WEBAPP_PORT | 0 | Web chat UI port (0 = disabled) |
All platform credential flags are also available (--telegram-token, --slack-bot-token, etc.) as overrides — these take precedence over ~/.lingti.yaml. See the Platform Flags section.
Typical workflow
Using flags directly (Docker / CI)
Flags override ~/.lingti.yaml, so you can run without a config file:
Or via environment variables:
Disable WebSocket server
Web chat UI
Reload config without restart
After saving changes to ~/.lingti.yaml (e.g. adding a channel), signal the running gateway to reload:
This sends SIGHUP to the running gateway process via ~/.lingti/gateway.pid.
gateway restart
Reads ~/.lingti/gateway.pid, sends SIGHUP to the process. The gateway logs [Gateway] Received SIGHUP, reloading config... and re-reads its configuration.
Platform Flags
All platform credentials can be passed as flags to gateway for one-off overrides or Docker deployments. They follow the same 3-tier priority: CLI flag > environment variable > ~/.lingti.yaml.
| Platform | Flag | Env Var |
|---|---|---|
| Slack | --slack-bot-token | SLACK_BOT_TOKEN |
| Slack | --slack-app-token | SLACK_APP_TOKEN |
| Telegram | --telegram-token | TELEGRAM_BOT_TOKEN |
| Discord | --discord-token | DISCORD_BOT_TOKEN |
| Feishu | --feishu-app-id | FEISHU_APP_ID |
| Feishu | --feishu-app-secret | FEISHU_APP_SECRET |
| DingTalk | --dingtalk-client-id | DINGTALK_CLIENT_ID |
| DingTalk | --dingtalk-client-secret | DINGTALK_CLIENT_SECRET |
| WeCom | --wecom-corp-id | WECOM_CORP_ID |
| WeCom | --wecom-agent-id | WECOM_AGENT_ID |
| WeCom | --wecom-secret | WECOM_SECRET |
| WeCom | --wecom-token | WECOM_TOKEN |
| WeCom | --wecom-aes-key | WECOM_AES_KEY |
| WeCom | --wecom-port | WECOM_PORT |
--whatsapp-phone-id | WHATSAPP_PHONE_NUMBER_ID | |
--whatsapp-access-token | WHATSAPP_ACCESS_TOKEN | |
--whatsapp-verify-token | WHATSAPP_VERIFY_TOKEN | |
| LINE | --line-channel-secret | LINE_CHANNEL_SECRET |
| LINE | --line-channel-token | LINE_CHANNEL_TOKEN |
| Teams | --teams-app-id | TEAMS_APP_ID |
| Teams | --teams-app-password | TEAMS_APP_PASSWORD |
| Teams | --teams-tenant-id | TEAMS_TENANT_ID |
| Matrix | --matrix-homeserver-url | MATRIX_HOMESERVER_URL |
| Matrix | --matrix-user-id | MATRIX_USER_ID |
| Matrix | --matrix-access-token | MATRIX_ACCESS_TOKEN |
| Mattermost | --mattermost-server-url | MATTERMOST_SERVER_URL |
| Mattermost | --mattermost-token | MATTERMOST_TOKEN |
| Mattermost | --mattermost-team-name | MATTERMOST_TEAM_NAME |
| Signal | --signal-api-url | SIGNAL_API_URL |
| Signal | --signal-phone-number | SIGNAL_PHONE_NUMBER |
| iMessage | --bluebubbles-url | BLUEBUBBLES_URL |
| iMessage | --bluebubbles-password | BLUEBUBBLES_PASSWORD |
| Twitch | --twitch-token | TWITCH_TOKEN |
| Twitch | --twitch-channel | TWITCH_CHANNEL |
| Twitch | --twitch-bot-name | TWITCH_BOT_NAME |
| NOSTR | --nostr-private-key | NOSTR_PRIVATE_KEY |
| NOSTR | --nostr-relays | NOSTR_RELAYS |
| Zalo | --zalo-app-id | ZALO_APP_ID |
| Zalo | --zalo-secret-key | ZALO_SECRET_KEY |
| Zalo | --zalo-access-token | ZALO_ACCESS_TOKEN |
| Nextcloud | --nextcloud-server-url | NEXTCLOUD_SERVER_URL |
| Nextcloud | --nextcloud-username | NEXTCLOUD_USERNAME |
| Nextcloud | --nextcloud-password | NEXTCLOUD_PASSWORD |
| Nextcloud | --nextcloud-room-token | NEXTCLOUD_ROOM_TOKEN |
| Google Chat | --googlechat-project-id | GOOGLE_CHAT_PROJECT_ID |
| Google Chat | --googlechat-credentials-file | GOOGLE_CHAT_CREDENTIALS_FILE |
| Webapp | --webapp-port | WEBAPP_PORT |
serve
Start the MCP (Model Context Protocol) server for integration with Claude Desktop, Cursor, and other MCP clients.
Configuration for Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
relay
Connect to the lsbot cloud relay service — no public server needed. See Gateway vs Relay.
Supported platforms: feishu, slack, wechat, wecom
| Flag | Env Var | Default | Description |
|---|---|---|---|
--platform | RELAY_PLATFORM | Platform: feishu, slack, wechat, wecom (required) | |
--user-id | RELAY_USER_ID | Your user ID from /whoami | |
--provider | AI_PROVIDER | claude | AI provider |
--api-key | AI_API_KEY | AI API key (required) | |
--server | RELAY_SERVER_URL | wss://bot.lingti.com/ws | Relay server URL |
--insecure | false | 跳过 TLS 证书验证(适用于企业代理拦截 HTTPS 的情况) |
doctor
Run diagnostic checks on configuration, credentials, connectivity, and required tools.
Checks: config file, AI API key, AI connectivity, platform credentials, required binaries, browser CDP, MCP servers, temp directory.
skills
Manage modular skill extensions.
version
Show version information.
router (deprecated)
⚠️
routeris deprecated. The command is still present but prints a migration guide and exits. Usegatewayinstead — it includes all router functionality plus the WebSocket server.
Running lsbot gateway (with or without flags) prints:
Migration is straightforward: every flag that router accepted (--telegram-token, --api-key, --provider, --webapp-port, etc.) is available on gateway with the same name.
Environment Variables
AI Provider
| Variable | Description |
|---|---|
AI_PROVIDER | Provider name: claude, deepseek, kimi, qwen, etc. |
AI_API_KEY | API key |
AI_BASE_URL | Custom base URL |
AI_MODEL | Model name override |
AI_CALL_TIMEOUT | API call timeout in seconds (default: 90) |
Legacy aliases (also accepted):
| Variable | Maps to |
|---|---|
ANTHROPIC_API_KEY | AI_API_KEY |
ANTHROPIC_OAUTH_TOKEN | AI_API_KEY |
ANTHROPIC_BASE_URL | AI_BASE_URL |
ANTHROPIC_MODEL | AI_MODEL |
Gateway (WebSocket Server)
| Variable | Default | Description |
|---|---|---|
GATEWAY_ADDR | :18789 | Listen address |
GATEWAY_AUTH_TOKEN | Single auth token | |
GATEWAY_AUTH_TOKENS | Comma-separated auth tokens |
Browser Debug
| Variable | Description |
|---|---|
BROWSER_DEBUG | Set to 1 or true to enable debug screenshots |
BROWSER_DEBUG_DIR | Directory for debug screenshots |
Webapp
| Variable | Description |
|---|---|
WEBAPP_PORT | Web chat UI port (0 = disabled) |
AI Providers
Claude (Anthropic)
DeepSeek
Kimi (Moonshot)
See AI-PROVIDERS.md for the full list of 16+ supported providers.
Configuration File
All settings can be stored in ~/.lingti.yaml. The 3-tier resolution order is:
CLI flag > environment variable > ~/.lingti.yaml
Example configuration with agents and bindings:
See CONFIGURATION.md for the complete config file reference.
See Also
- gateway.md — WebSocket protocol reference
- CONFIGURATION.md — Full config file reference
- chat-platforms.md — Platform-specific setup guides
- AI-PROVIDERS.md — All supported AI providers