Command Line Reference

Complete command line reference for lsbot.

Table of Contents


Global Options

These options are available for all commands:

FlagDefaultDescription
-h, --helpShow help for any command
--loginfoLog level: trace, debug, info, warn, error, fatal, panic
-y, --yesfalseAuto-approve all operations (skip confirmation prompts)
--no-filesfalseDisable 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.

lsbot channels <subcommand>

channels add

Add or update credentials for a platform channel.

lsbot channels add --channel <name> [credential flags]

Required flag: --channel <name> — the platform to configure.

Platform credential flags:

ChannelFlags
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:

# Add Telegram
lsbot channels add --channel telegram --token 123456:ABC-xxx

# Add Slack
lsbot channels add --channel slack \
  --bot-token xoxb-xxx \
  --app-token xapp-xxx

# Add Discord
lsbot channels add --channel discord --token MTxxxxxxxx

# Add WeCom
lsbot channels add --channel wecom \
  --corp-id CORP_ID \
  --agent-id AGENT_ID \
  --secret SECRET \
  --token TOKEN \
  --aes-key AES_KEY \
  --port 8080

# Enable built-in web chat UI on port 8080
lsbot channels add --channel webapp --port 8080

channels list

Show a table of all platforms with their configuration status.

lsbot channels list

Output:

CHANNEL       STATUS  DETAIL
-------       ------  ------
telegram      ✓       123456:ABC-xxx
slack         ✓       xoxb-xxx...
discord       ✗
feishu        ✗
...

channels remove

Remove all credentials for a platform from ~/.lingti.yaml.

lsbot channels remove --channel <name>

Example:

lsbot channels remove --channel telegram

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.

lsbot agents <subcommand>

agents add

Add a new agent to ~/.lingti.yaml. Creates the workspace directory if it doesn't exist.

lsbot agents add <id> [flags]

Arguments: <id> — unique agent identifier (required, positional).

Flags:

FlagDefaultDescription
--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
--defaultfalseMark as the default agent
--allow-tools <list>Comma-separated tool whitelist (empty = allow all)
--deny-tools <list>Comma-separated tool blacklist

Examples:

# Add a default agent using inherited AI settings
lsbot agents add main --default

# Add a work agent with a specific model and custom instructions
lsbot agents add work \
  --model claude-opus-4-6 \
  --instructions "You are a focused work assistant. Be concise."

# Add an agent that reads instructions from a file
lsbot agents add support \
  --instructions ~/.lingti/support-instructions.txt \
  --workspace ~/my-support-workspace

# Add a restricted agent that can only use read-only tools
lsbot agents add readonly \
  --allow-tools "read,glob,grep,shell_read"

# Add an agent that cannot write or edit files
lsbot agents add safe \
  --deny-tools "write,edit,shell"

agents list

List all configured agents. Add --bindings to also show routing bindings.

lsbot agents list [--bindings]

Flags:

FlagDescription
-b, --bindingsAlso show routing bindings table

Example output:

ID            DEFAULT   MODEL                 PROVIDER              WORKSPACE
--            -------   -----                 --------              ---------
main          ✓         (inherited)           (inherited)           /Users/alex/.lingti/agents/main
work                    claude-opus-4-6       (inherited)           /Users/alex/.lingti/agents/work

AGENT         PLATFORM      CHANNEL_ID
-----         --------      ----------
main          telegram
work          slack         C_WORK_CHANNEL

agents bind

Add routing bindings that direct messages from a platform (or specific channel) to a named agent.

lsbot agents bind [--agent <id>] --bind <spec> [--bind <spec> ...]

Flags:

FlagDescription
--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 Telegram
  • slack:C_WORK — only messages from the Slack channel with ID C_WORK

Examples:

# Bind all Telegram traffic to the default agent
lsbot agents bind --bind telegram

# Bind a specific Slack channel to the 'work' agent
lsbot agents bind --agent work --bind slack:C_WORK_CHANNEL

# Bind multiple platforms to one agent at once
lsbot agents bind --agent work \
  --bind slack:C_WORK \
  --bind discord:1234567890

agents unbind

Remove routing bindings for an agent.

lsbot agents unbind [--agent <id>] (--bind <spec> [...] | --all)

Flags:

FlagDescription
--agent <id>Agent ID (defaults to the config default agent)
--bind <spec>Specific binding to remove (repeatable)
--allRemove all bindings for this agent

Examples:

# Remove a specific binding
lsbot agents unbind --agent work --bind slack:C_WORK

# Remove all bindings for an agent
lsbot agents unbind --agent work --all

gateway

The unified run command. Starts all configured platform bots and the WebSocket server in a single process.

What gateway does:

  1. Reads ~/.lingti.yaml for platform credentials and agent definitions
  2. Registers all configured platforms (Telegram, Slack, Discord, etc.)
  3. Starts the WebSocket server on :18789 (unless --no-ws)
  4. Routes incoming messages to the correct agent based on bindings
  5. Writes ~/.lingti/gateway.pid for use by gateway restart
lsbot gateway [flags]
lsbot gateway restart

Flags:

FlagEnv VarDefaultDescription
--addrGATEWAY_ADDR:18789WebSocket server address
--auth-tokenGATEWAY_AUTH_TOKENSingle WebSocket auth token
--auth-tokensGATEWAY_AUTH_TOKENSComma-separated WebSocket auth tokens
--no-wsfalseDisable WebSocket server (platform bots only)
--providerAI_PROVIDERclaudeAI provider
--api-keyAI_API_KEYAI API key (required)
--base-urlAI_BASE_URLCustom AI API base URL
--modelAI_MODELModel name
--instructionsPath to custom instructions file
--call-timeoutAI_CALL_TIMEOUT90AI API call timeout in seconds
--debug-dirBROWSER_DEBUG_DIRDirectory for browser debug screenshots
--webapp-portWEBAPP_PORT0Web 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

# Step 1: Save credentials once
lsbot channels add --channel telegram --token 123456:ABC-xxx
lsbot channels add --channel slack --bot-token xoxb-... --app-token xapp-...

# Step 2: (Optional) Configure agents and routing
lsbot agents add main --default
lsbot agents add work --model claude-opus-4-6
lsbot agents bind --bind telegram               # → main (default)
lsbot agents bind --agent work --bind slack     # → work agent

# Step 3: Start everything
lsbot gateway --api-key sk-ant-xxx

Using flags directly (Docker / CI)

Flags override ~/.lingti.yaml, so you can run without a config file:

lsbot gateway \
  --api-key sk-ant-xxx \
  --telegram-token 123456:ABC-xxx \
  --slack-bot-token xoxb-xxx \
  --slack-app-token xapp-xxx

Or via environment variables:

export AI_API_KEY=sk-ant-xxx
export TELEGRAM_BOT_TOKEN=123456:ABC-xxx
lsbot gateway

Disable WebSocket server

# Platform bots only — no WebSocket API
lsbot gateway --no-ws --api-key sk-ant-xxx

# Or via env var (empty string disables it)
GATEWAY_ADDR="" lsbot gateway --api-key sk-ant-xxx

Web chat UI

# Serve web chat UI on port 8080 in addition to everything else
lsbot gateway --webapp-port 8080 --api-key sk-ant-xxx

Reload config without restart

After saving changes to ~/.lingti.yaml (e.g. adding a channel), signal the running gateway to reload:

lsbot gateway restart

This sends SIGHUP to the running gateway process via ~/.lingti/gateway.pid.

gateway restart

lsbot 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.

PlatformFlagEnv Var
Slack--slack-bot-tokenSLACK_BOT_TOKEN
Slack--slack-app-tokenSLACK_APP_TOKEN
Telegram--telegram-tokenTELEGRAM_BOT_TOKEN
Discord--discord-tokenDISCORD_BOT_TOKEN
Feishu--feishu-app-idFEISHU_APP_ID
Feishu--feishu-app-secretFEISHU_APP_SECRET
DingTalk--dingtalk-client-idDINGTALK_CLIENT_ID
DingTalk--dingtalk-client-secretDINGTALK_CLIENT_SECRET
WeCom--wecom-corp-idWECOM_CORP_ID
WeCom--wecom-agent-idWECOM_AGENT_ID
WeCom--wecom-secretWECOM_SECRET
WeCom--wecom-tokenWECOM_TOKEN
WeCom--wecom-aes-keyWECOM_AES_KEY
WeCom--wecom-portWECOM_PORT
WhatsApp--whatsapp-phone-idWHATSAPP_PHONE_NUMBER_ID
WhatsApp--whatsapp-access-tokenWHATSAPP_ACCESS_TOKEN
WhatsApp--whatsapp-verify-tokenWHATSAPP_VERIFY_TOKEN
LINE--line-channel-secretLINE_CHANNEL_SECRET
LINE--line-channel-tokenLINE_CHANNEL_TOKEN
Teams--teams-app-idTEAMS_APP_ID
Teams--teams-app-passwordTEAMS_APP_PASSWORD
Teams--teams-tenant-idTEAMS_TENANT_ID
Matrix--matrix-homeserver-urlMATRIX_HOMESERVER_URL
Matrix--matrix-user-idMATRIX_USER_ID
Matrix--matrix-access-tokenMATRIX_ACCESS_TOKEN
Mattermost--mattermost-server-urlMATTERMOST_SERVER_URL
Mattermost--mattermost-tokenMATTERMOST_TOKEN
Mattermost--mattermost-team-nameMATTERMOST_TEAM_NAME
Signal--signal-api-urlSIGNAL_API_URL
Signal--signal-phone-numberSIGNAL_PHONE_NUMBER
iMessage--bluebubbles-urlBLUEBUBBLES_URL
iMessage--bluebubbles-passwordBLUEBUBBLES_PASSWORD
Twitch--twitch-tokenTWITCH_TOKEN
Twitch--twitch-channelTWITCH_CHANNEL
Twitch--twitch-bot-nameTWITCH_BOT_NAME
NOSTR--nostr-private-keyNOSTR_PRIVATE_KEY
NOSTR--nostr-relaysNOSTR_RELAYS
Zalo--zalo-app-idZALO_APP_ID
Zalo--zalo-secret-keyZALO_SECRET_KEY
Zalo--zalo-access-tokenZALO_ACCESS_TOKEN
Nextcloud--nextcloud-server-urlNEXTCLOUD_SERVER_URL
Nextcloud--nextcloud-usernameNEXTCLOUD_USERNAME
Nextcloud--nextcloud-passwordNEXTCLOUD_PASSWORD
Nextcloud--nextcloud-room-tokenNEXTCLOUD_ROOM_TOKEN
Google Chat--googlechat-project-idGOOGLE_CHAT_PROJECT_ID
Google Chat--googlechat-credentials-fileGOOGLE_CHAT_CREDENTIALS_FILE
Webapp--webapp-portWEBAPP_PORT

serve

Start the MCP (Model Context Protocol) server for integration with Claude Desktop, Cursor, and other MCP clients.

lsbot serve

Configuration for Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "lsbot": {
      "command": "/path/to/lsbot",
      "args": ["serve"]
    }
  }
}

relay

Connect to the lsbot cloud relay service — no public server needed. See Gateway vs Relay.

lsbot relay [flags]

Supported platforms: feishu, slack, wechat, wecom

FlagEnv VarDefaultDescription
--platformRELAY_PLATFORMPlatform: feishu, slack, wechat, wecom (required)
--user-idRELAY_USER_IDYour user ID from /whoami
--providerAI_PROVIDERclaudeAI provider
--api-keyAI_API_KEYAI API key (required)
--serverRELAY_SERVER_URLwss://bot.lingti.com/wsRelay server URL
--insecurefalse跳过 TLS 证书验证(适用于企业代理拦截 HTTPS 的情况)

doctor

Run diagnostic checks on configuration, credentials, connectivity, and required tools.

lsbot doctor

Checks: config file, AI API key, AI connectivity, platform credentials, required binaries, browser CDP, MCP servers, temp directory.


skills

Manage modular skill extensions.

lsbot skills list
lsbot skills install <name>
lsbot skills remove <name>

version

Show version information.

lsbot version

router (deprecated)

⚠️ router is deprecated. The command is still present but prints a migration guide and exits. Use gateway instead — it includes all router functionality plus the WebSocket server.

Running lsbot gateway (with or without flags) prints:

WARNING: 'router' is deprecated and will be removed in a future release.
Use the new 'channels', 'agents', and 'gateway' commands instead:

  # 1. Save your platform credentials to ~/.lingti.yaml
  lsbot channels add --channel telegram --token YOUR_BOT_TOKEN
  lsbot channels add --channel slack --bot-token xoxb-... --app-token xapp-...

  # 2. Add an agent (optional — skip if using env vars / flags only)
  lsbot agents add main --default

  # 3. Start everything
  lsbot gateway --api-key YOUR_API_KEY

  # Or keep passing flags/env vars directly (all router flags work on gateway):
  lsbot gateway --telegram-token YOUR_BOT_TOKEN --api-key YOUR_API_KEY

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

VariableDescription
AI_PROVIDERProvider name: claude, deepseek, kimi, qwen, etc.
AI_API_KEYAPI key
AI_BASE_URLCustom base URL
AI_MODELModel name override
AI_CALL_TIMEOUTAPI call timeout in seconds (default: 90)

Legacy aliases (also accepted):

VariableMaps to
ANTHROPIC_API_KEYAI_API_KEY
ANTHROPIC_OAUTH_TOKENAI_API_KEY
ANTHROPIC_BASE_URLAI_BASE_URL
ANTHROPIC_MODELAI_MODEL

Gateway (WebSocket Server)

VariableDefaultDescription
GATEWAY_ADDR:18789Listen address
GATEWAY_AUTH_TOKENSingle auth token
GATEWAY_AUTH_TOKENSComma-separated auth tokens

Browser Debug

VariableDescription
BROWSER_DEBUGSet to 1 or true to enable debug screenshots
BROWSER_DEBUG_DIRDirectory for debug screenshots

Webapp

VariableDescription
WEBAPP_PORTWeb chat UI port (0 = disabled)

AI Providers

Claude (Anthropic)

export AI_PROVIDER=claude
export AI_API_KEY=sk-ant-api03-xxx
export AI_MODEL=claude-sonnet-4-6  # optional

DeepSeek

export AI_PROVIDER=deepseek
export AI_API_KEY=sk-xxx

Kimi (Moonshot)

export AI_PROVIDER=kimi
export AI_API_KEY=sk-xxx
export AI_MODEL=moonshot-v1-8k  # optional

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:

ai:
  provider: claude
  api_key: sk-ant-xxx
  model: claude-sonnet-4-6

platforms:
  telegram:
    token: "123456:ABC-xxx"
  slack:
    bot_token: xoxb-xxx
    app_token: xapp-xxx

agents:
  - id: main
    default: true
    workspace: ~/.lingti/agents/main

  - id: work
    workspace: ~/.lingti/agents/work
    model: claude-opus-4-6
    instructions: "You are a focused work assistant. Keep answers brief."
    deny_tools: [write, edit, shell]

bindings:
  - agent_id: main
    match:
      platform: telegram
  - agent_id: work
    match:
      platform: slack
      channel_id: C_WORK_CHANNEL

See CONFIGURATION.md for the complete config file reference.


See Also