Every essential OpenClaw CLI command and configuration pattern in one place. Covers installation, gateway management, channels, agents, sessions, automation, security, and deployment. Bookmark this and stop searching the docs.
| Name | Syntax | Description |
|---|---|---|
| openclaw onboard | openclaw onboard --install-daemon | Interactive setup wizard. Configures auth, gateway, and optional channels. |
| openclaw gateway | openclaw gateway [--port 18789] | Start the Gateway process. Default port: 18789. |
| openclaw gateway status | openclaw gateway status | Check if the Gateway is running and healthy. |
| openclaw channels login | openclaw channels login <platform> [--token] [--label] | Connect a new channel (WhatsApp, Telegram, Discord, etc.). |
| openclaw channels list | openclaw channels list [--show-access] | List all connected channels and their status. |
| openclaw sessions list | openclaw sessions list [--agent <id>] [--active] | List sessions, optionally filtered by agent or active status. |
| openclaw models scan | openclaw models scan | Discover available models across all configured providers. |
| openclaw cron add | openclaw cron add --schedule "<cron>" --agent <id> --message "<msg>" | Schedule a recurring agent task using cron syntax. |
| openclaw dashboard | openclaw dashboard | Open the Control UI in the browser. |
| openclaw update | openclaw update | Update OpenClaw to the latest version. |
curl -fsSL https://openclaw.ai/install.sh | bashDownloads and installs the OpenClaw CLI. Requires Node.js 22 or higher.
Tips
openclaw onboard --install-daemonInteractive wizard that configures authentication, gateway, channels, and daemon.
Tips
OPENCLAW_HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATHOverride default paths for production deployments.
Tips
openclaw gateway [--port <number>]Start the Gateway process. Use a process manager for production.
Tips
~/.openclaw/openclaw.jsonMinimal working configuration. Uses ${VAR} syntax for secrets.
Tips
openclaw config show | openclaw logsInspect configuration and view filtered logs.
Tips
openclaw channels login <platform> [--token] [--label]Connect chat platforms to the Gateway. Each platform has its own auth method.
Tips
channels.{platform}.allowedUsers | allowedGuilds | corsOriginsRestrict channel access with user IDs, guild IDs, or CORS origins.
Tips
openclaw message send --target <id> --message "<text>"Send a message through a connected channel for testing.
Tips
agents.list[].{id, model, workspace, agentDir}Define agents with model, workspace, and agent directory.
Tips
model.{primary, failover[]}Automatic fallback to secondary models when the primary is unavailable.
Tips
agents.{id}.bindings[].{type, accountId, guildId, roles}Route messages to agents. Priority: peer > guild+roles > guild > account > channel > default.
Tips
openclaw agent prompt --id <agent>Inspect agent configuration, assembled prompt, and available tools.
Tips
openclaw sessions {list, view, end, export}List, inspect, end, and export conversation sessions.
Tips
agents.{id}.memory.{enabled, maxMessages, compaction, flush}Configure per-agent conversation memory with compaction and flushing.
Tips
openclaw cron {add, list, remove}Schedule recurring agent tasks using standard cron syntax.
Tips
openclaw webhooks {create, list, remove}Create HTTP endpoints for external services to trigger agent actions.
Tips
hooks.{onNewMessage, onChannelDisconnect, onAgentError}Trigger actions in response to system events.
Tips
agents.{id}.sandbox.{mode, scope}Control agent command execution. Modes: off, basic, strict. Scope: agent, tree.
Tips
agents.{id}.tools.{allow[], deny[]}Whitelist and blacklist tools per agent. Defense in depth.
Tips
security.elevation.{enabled, requireApproval, maxDuration}Controlled temporary access to restricted tools with user approval.
Tips
openclaw plugins {install, list, remove}Install and manage channel plugins for Teams, Matrix, LINE, etc.
Tips
openclaw skills {search, install, list, publish}Find, install, and share reusable agent capabilities via ClawHub.
Tips
A production-ready configuration with a triage agent routing to a sandboxed coder agent. WhatsApp and Discord channels connected with access controls. Failover chain for high availability. Strict sandbox with tool restrictions. Elevated access requires approval.
Complete Docker stack with OpenClaw Gateway and Caddy reverse proxy. Caddy handles TLS automatically via Let's Encrypt. Agent data persisted in a Docker volume. Secrets loaded from .env file. Health checks ensure auto-restart on failures.
Quick setup for an agent's workspace with the three essential bootstrap files. SOUL.md defines personality, IDENTITY.md provides self-knowledge, and MEMORY.md starts empty and accumulates knowledge over time.
Node.js version below 22 causes cryptic startup errors with no clear message about the version requirement
Always verify with `node --version` before installing. Use nvm (`nvm install 22`) or fnm (`fnm install 22`) to manage versions. OpenClaw requires features only available in Node.js 22+.
Bot tokens reused across multiple gateways cause disconnection loops as each gateway fights for the connection
Each bot token can only be connected to one gateway. Create separate bot applications in the Discord Developer Portal or Telegram BotFather for each gateway instance.
Webhook channels (Telegram, Discord) fail silently when the gateway port is not reachable from the internet
Ensure your firewall/security group allows inbound traffic on the gateway port. For local development, use a tunnel like ngrok or Cloudflare Tunnel to expose the port.
Context window overflow drops older messages silently when maxMessages is high and compaction is disabled
Enable compaction for conversational agents. Compaction summarizes older messages instead of dropping them, preserving key information. Set threshold: 0.8 and preserveRecent: 20 as a starting point.
MEMORY.md grows unbounded over time, consuming more tokens on every message and increasing response latency
Review and prune MEMORY.md periodically. Remove outdated facts, consolidate similar entries, and keep it under 500 words. Every line costs tokens on every single message.
Go beyond the cheatsheet with hands-on lessons and challenges.