CLI Reference

Complete command reference for OpenClaw - all commands, options, and usage examples

You'll use the CLI for setup, starting the Gateway, sending test messages, and debugging. Everything runs through openclaw; moltbot and clawdbot still work as aliases. This page is a quick reference—the commands I reach for most are onboard, gateway, doctor, and restart.

Most used commands

openclaw onboardFirst-time setup (model, channel)
openclaw gatewayStart the Gateway
openclaw doctor / --fixHealth check and auto-fix
openclaw restartRestart the Gateway
openclaw backup createCreate a backup archive
openclaw --versionShow version (include when reporting bugs)

When the CLI doesn't work

"command not found" after install: Restart your terminal so PATH picks up the global npm bin. If you installed with pnpm or in a venv, make sure that environment is active.

gateway start hangs or port in use: Another process may be using 18789. Run openclaw doctor to see port and process checks. Use --port to pick a different port if you need to.

Token or 1008 unauthorized: If the Control UI or a client reports "gateway token missing" or 1008, you need to pass the token (e.g. openclaw gateway --token YOUR_TOKEN) or open a tokenized dashboard URL. See Troubleshooting for details.

Core Commands

onboard

Run the onboarding wizard to set up OpenClaw:

Onboard Command
openclaw onboard [--install-daemon]
  • --install-daemon - Install Gateway as system service (systemd on Linux, launchd on macOS)

Documentation: The --install-daemon flag installs OpenClaw Gateway as a background service that starts automatically on system boot. This is recommended for production deployments.

Example: openclaw onboard --install-daemon will guide you through initial setup and install the Gateway as a system service.

gateway

Start the Gateway:

Gateway Command
openclaw gateway [--port PORT] [--bind ADDRESS] [--verbose] [--token TOKEN]
  • --port - Gateway port (default: 18789)
  • --bind - Bind address (default: 127.0.0.1)
  • --verbose - Verbose logging
  • --token - Authentication token

agent

Send a message to the agent:

Agent Command
openclaw agent --message "your message" [--thinking LEVEL]
  • --message - Message to send
  • --thinking - Thinking level (low, medium, high)

Delivery (2026.2.21): openclaw agent --deliver can send without --reply-to when a per-account or per-channel defaultTo is configured for outbound routing.

Channel Commands

channels login

Link a channel device (shows QR for WhatsApp):

Channel Login
openclaw channels login [channel]

channels list

List configured channels:

List Channels
openclaw channels list

pairing list / pairing approve

List pending pairing requests and approve new devices or DM contacts: openclaw pairing list, openclaw pairing approve <channel> <code>. From 2026.2.21, both commands default to the sole available pairing channel when omitted, so TUI-only setups can recover from "pairing required" without guessing channel arguments.

Message Commands

message send

Send a message via a channel:

Send Message
openclaw message send --target +1234567890 --message "Hello"

Session Commands

sessions list

List active sessions:

List Sessions
openclaw sessions list

sessions history

View session conversation history:

Session History
openclaw sessions history [session-id]

Sending to a session from the CLI: To send a message to a specific session (e.g. a sub-agent or group session), use the agent command with --to and the session key. Spawning new sub-agents is done by your OpenClaw agent via the sessions_spawn tool, not by a CLI command.

Send message to session
openclaw agent --message "Your task or question" --to "agent:main:subagent:abc123"

Use openclaw sessions list (or openclaw sessions --json) to get session keys. Add --deliver to have the reply delivered to a configured channel. See Set up a sub-agent for the full flow.

Configuration Commands

configure

Interactive configuration:

Configure
openclaw configure

doctor

Check configuration and diagnose issues:

Doctor
openclaw doctor [--fix]
  • --fix - Automatically fix common issues found during diagnosis

Example: openclaw doctor --fix will check your configuration and automatically fix issues like permission problems, missing directories, and configuration errors.

Gateway Commands

gateway restart

Restart the Gateway service:

Restart Gateway
openclaw gateway restart

This command stops the current Gateway instance and starts it again. Useful when you need to reload configuration or recover from errors.

gateway status

Check Gateway status and connection:

Gateway Status
openclaw gateway status

Shows whether the Gateway is running, the port it's listening on, and connection status.

gateway logs

View Gateway logs:

Gateway Logs
openclaw gateway logs

Displays recent Gateway log entries for debugging.

devices (2026.2.19+)

Manage paired devices: remove a device or clear pairing state.

Devices
openclaw devices remove [device]
openclaw devices clear --yes [--pending]
  • devices remove – Remove a specific paired device
  • devices clear --yes – Clear all paired entries; add --pending to also reject pending pairing requests

Config also supports device.pair.remove for paired-device hygiene. See Troubleshooting for pairing-related issues.

Skills Commands

skills list

List all installed skills:

List Skills
openclaw skills list

Shows all skills installed in your workspace (~/clawd/skills/).

System Commands

status

Check Gateway status:

Status
openclaw status

health

Check system health:

Health
openclaw health

update

Update OpenClaw:

Update
openclaw update [--channel CHANNEL]
  • --channel - Release channel (stable, beta, dev)

restart

Restart OpenClaw Gateway (convenience command):

Restart
openclaw restart

Shortcut for openclaw gateway restart. Stops and restarts the Gateway service.

Pairing Commands

pairing approve

Approve a pairing request:

Approve Pairing
openclaw pairing approve <channel> <code>

Skills Commands

skills list

List installed skills:

List Skills
openclaw skills list

Help & Documentation

Get help for any command:

Help
openclaw --help
openclaw <command> --help

See also