CLI Reference
OpenSpider provides a full CLI for setup, daemon management, channel control, and tooling. All commands are available after running npm link in the project root.
openspider [command] [options]Core Commands
openspider onboard
Run the interactive setup wizard to configure your LLM provider, API keys, model, agent persona, and optionally WhatsApp.
openspider onboardThe wizard generates a .env file and sets up the workspace/ directory structure.
openspider gateway
Start the core agent engine and HTTP/WebSocket server in the foreground.
openspider gatewayThe server starts on http://localhost:4001. Press Ctrl+C to stop. Best for development.
openspider start
Start the gateway as a background daemon using PM2.
openspider startAfter starting, the daemon runs independently. Use openspider logs to monitor and openspider stop to shut down.
openspider stop
Stop the background daemon.
openspider stopopenspider logs
Stream real-time logs from the background daemon (last 100 lines + live tail).
openspider logsPress Ctrl+C to stop streaming.
openspider dashboard
Open the web dashboard in your default browser.
openspider dashboardOpens http://localhost:4001 automatically.
openspider token
Print the secure Gateway Token required to authenticate the OpenSpider Browser Relay Chrome Extension.
openspider tokenopenspider status
Show the current gateway status, version, provider, and PM2 uptime.
openspider statusExample output:
🕷️ OpenSpider Status
──────────────────────────────────────────────────
Version: v2.2.0
Provider: anthropic
API Port: 4001
Dashboard: http://localhost:4001
──────────────────────────────────────────────────
Gateway: ✅ online (uptime: 142 min, restarts: 0)openspider lid-map <LID> <PHONE>
Map a WhatsApp LID (Linked Identity) to a phone number in the allowlist via the running gateway.
openspider lid-map 177472511426665 61423475992The command sends a POST request to the running gateway's /api/whatsapp/lid-map endpoint. Requires the gateway to be running.
TIP
You typically don't need to know the LID number yourself. Use the Dashboard UI (Channels → Configure WhatsApp → LID Identity Mappings) to see pending LIDs and assign phone numbers visually.
openspider tui
Launch the Terminal User Interface for chatting with the agent directly in your terminal.
openspider tuiChannel Commands
openspider channels login
Watch for QR codes from the running gateway and display them in the terminal for WhatsApp authentication.
openspider channels loginThe command polls for new QR codes every second. Once connected, it exits automatically.
openspider channels whatsapp login
Initialize a fresh WhatsApp connection directly (standalone, not via the gateway).
openspider channels whatsapp loginTool Commands
openspider tools email setup
Configure Gmail OAuth 2.0 credentials for the email skill.
openspider tools email setupSteps:
- Download OAuth Client ID JSON from Google Cloud Console
- Run the command and provide the path to your credentials JSON
- A browser window opens for Google OAuth authentication
- Token is saved to
workspace/gmail_token.json
openspider tools email test
Send a test email to verify the email configuration.
openspider tools email test [options]| Option | Description | Default |
|---|---|---|
-t, --to <email> | Recipient email address | (prompted) |
-s, --subject <text> | Email subject line | Test from OpenSpider |
-b, --body <text> | Email body content | This is a test email... |
Example:
openspider tools email test --to user@example.com --subject "Hello" --body "Test message"Webhook Commands
openspider webhooks gmail setup
Automate GCP Pub/Sub setup for Gmail push webhook notifications.
openspider webhooks gmail setup [options]| Option | Description |
|---|---|
-p, --project <id> | Google Cloud Project ID |
-a, --account <email> | Gmail account to monitor |
This command:
- Sets the active GCP project
- Enables Gmail and Pub/Sub APIs
- Creates the
gog-gmail-watchPub/Sub topic - Grants Gmail API the Publisher role
- Outputs next steps for starting the watch and webhook listener
openspider webhooks gmail run
Start the gateway with webhook listener enabled.
openspider webhooks gmail runModel Commands
openspider models list
Display the currently configured LLM provider and all available active fallback models.
openspider models listExample output:
🕷️ OpenSpider Model Configuration:
──────────────────────────────────────────────────
Default Provider: antigravity-internal
Primary Model: claude-opus-4-6-thinking
Fallback Chain: Primary → Internal Fallback → DeepSeek → NVIDIA-1 → NVIDIA-2
──────────────────────────────────────────────────
All configured providers:
✅ antigravity (model: claude-opus-4-6-thinking)
✅ deepseek (model: deepseek-chat)
✅ nvidia-1 (model: nvidia/llama-3.1-nemotron-ultra-253b-v1)
✅ nvidia-2 (model: nvidia/llama-3.1-nemotron-ultra-253b-v1)
Config file: /Users/name/OpenSpider/.envThe config file path is shown so you can quickly find and edit your settings.
openspider models add
Interactively configure and append backup LLMs to your Fallback Chain without re-running the full setup wizard. This command will prompt you for DeepSeek (Backup 1) and NVIDIA (Backups 2 & 3) API keys and securely append them to your .env file.
openspider models addGlobal Options
| Option | Description |
|---|---|
-V, --version | Display version number |
-h, --help | Display help for command |
openspider --version
openspider --help
openspider <command> --helpCommand Summary
| Command | Description |
|---|---|
onboard | Interactive setup wizard |
gateway | Start server (foreground) |
start | Start daemon (background) |
stop | Stop daemon |
status | Show gateway status and uptime |
logs | Stream daemon logs |
dashboard | Open web dashboard |
tui | Terminal chat UI |
channels login | WhatsApp QR auth (from gateway) |
channels whatsapp login | Direct WhatsApp connection |
tools email setup | Gmail OAuth setup |
tools email test | Send test email |
lid-map <LID> <PHONE> | Map a WhatsApp LID to phone |
webhooks gmail setup | GCP Pub/Sub setup |
webhooks gmail run | Start webhook listener |
models list | Show configured models |