Skip to content

OpenClaw CLI Commands (2026): Operator Defaults, Flags, and Debug Notes

·7 min read·By Christopher Kvamme

OpenClaw was previously known as Clawdbot and Moltbot. Configuration and commands depend on the version in use.

Every OpenClaw CLI command with examples. Gateway, cron, config, doctor, logs, and channel commands. Includes flags, safe defaults, and what breaks when you get it wrong.

OpenClaw CLI Commands (2026): Operator Defaults, Flags, and Debug Notes
Share:
On this page

Key takeaways

  • The six commands you will use most are: openclaw gateway restart, openclaw logs --follow, openclaw channels status --probe, openclaw cron list, openclaw doctor, and openclaw config get.
  • openclaw gateway restart is how you apply config changes. Most troubleshooting steps end with it.
  • openclaw doctor runs health checks and can auto-fix common configuration problems. Run it before digging into logs when something stops working.
  • Global flags --json, --no-color, and --profile <name> work with any command, making it straightforward to pipe output into scripts or CI.

The OpenClaw CLI controls your gateway, channels, cron jobs, and configuration from the terminal. This reference covers every subcommand you'll actually use, with exact syntax, flags, and real output examples. Bookmark it. You'll come back here every time you forget a flag or need to look up what a command returns.

Here's what this page gives you:

  • Quick reference table of all commands
  • Exact syntax and flags for each command group
  • Real output examples where they're helpful
  • Gotchas that aren't obvious from --help

OpenClaw CLI Command List

The CLI organizes into command groups, each handling a different part of your setup. Here's the full list with the commands you'll reach for most often marked with a star.

CommandWhat it does
openclaw gateway ⭐Start, stop, restart the gateway daemon
openclaw gateway runRun gateway in the foreground
openclaw gateway healthQuick health check
openclaw gateway statusDetailed gateway status
openclaw gateway installInstall as system service
openclaw status ⭐Show channel and session diagnostics
openclaw logs ⭐Tail gateway log files
openclaw channels listList configured channels
openclaw channels status ⭐Check channel health
openclaw channels capabilitiesShow what a channel supports
openclaw channels resolveResolve channel targets
openclaw channels logsView channel-specific logs
openclaw channels addAdd a new channel
openclaw channels removeRemove a channel
openclaw cron list ⭐List scheduled jobs
openclaw cron statusShow cron system status
openclaw cron addCreate a new cron job
openclaw cron editModify an existing job
openclaw cron rmDelete a job
openclaw cron enableEnable a disabled job
openclaw cron disableDisable a job without deleting
openclaw cron runsView run history
openclaw cron runTrigger a job manually
openclaw doctor ⭐Run health checks and auto-fixes
openclaw pairing listList pending pairing requests
openclaw pairing approveApprove a device pairing
openclaw config getRead a config value
openclaw config setWrite a config value
openclaw config unsetRemove a config value

Global flags that work with any command:

FlagEffect
--devUse dev configuration and workspace
--profile <name>Use a named config profile
--no-colorDisable ANSI color output
--jsonMachine-readable JSON output
-V, --versionPrint version

openclaw gateway: Start, Stop, and Restart

The openclaw gateway command starts, stops, and manages the daemon process that runs everything. You'll use gateway restart more than any other gateway subcommand, usually after config changes.

Starting the gateway

Run in the foreground (useful for debugging):

bash

openclaw gateway run

Or as a background service:

bash

openclaw gateway start

The gateway requires gateway.mode=local in your config, or you can bypass that with --allow-unconfigured for a first run.

Service management

bash

openclaw gateway install    # Install as system service
openclaw gateway uninstall  # Remove the system service
openclaw gateway start      # Start the service
openclaw gateway stop       # Stop the service
openclaw gateway restart    # Restart (apply config changes)

Send SIGUSR1 to the gateway process for an in-process restart without dropping the PID.

Gateway flags

FlagDefaultWhat it does
--port <number>typically 18789Port to listen on
--bind <mode>loopbackBind mode: loopback, lan, tailnet, auto, or a custom address
--auth-Require authentication
--token <value>-Set the auth token
--password <value>-Set a password for auth
--tailscale <mode>offTailscale integration: off, serve, or funnel
--force-Kill existing listener on the port
--verbose-Verbose logging
--dev-Use dev config and workspace
--reset-Reset dev state

Safety note: The gateway blocks binding beyond loopback without auth. If you're exposing it on a LAN or public IP, you need --auth with a token or password. This is intentional. Don't try to work around it.

For VPS hosting, see Best VPS for OpenClaw or the DigitalOcean setup guide.

Query subcommands

Check gateway health without restarting:

bash

openclaw gateway health     # Quick health check
openclaw gateway status     # Detailed status info
openclaw gateway probe      # Connection probe
openclaw gateway discover   # Discover gateways on the network

These accept shared options: --url, --token, --password, --timeout, --expect-final, and --json.

openclaw status: Channel and Session Diagnostics

openclaw status gives you a dashboard view of your channels, sessions, and gateway health. It's the first command to run when something feels off. If you're migrating from the old Clawdbot/Moltbot names, this is the same CLI, just rebranded.

FlagWhat it does
--allShow all details including per-agent session stores
--deepRun live probes against each channel (WhatsApp, Telegram, Discord, Google Chat, Slack, Signal)
--usageShow resource usage stats

Quick check:

bash

openclaw status

Full diagnostics with live channel probes:

bash

openclaw status --deep

Everything, including multi-agent session stores:

bash

openclaw status --all
openclaw status output showing overview table with gateway health, channels table, and services status

The --deep flag takes a few seconds because it sends live probes to each channel. Worth the wait when you're debugging a silent channel.

The output also shows your update channel and git SHA, and hints to run openclaw update if a newer version is available.

openclaw logs: Tailing and Filtering Logs

openclaw logs tails the gateway's file logs over RPC. This means it works even when you're connected remotely, not just on the local machine.

FlagDefaultWhat it does
--follow-Stream logs in real time
--json-Output as JSON (for piping to jq)
--limit <n>500Number of lines to show
--local-time-Render timestamps in your local timezone

Last 500 lines (default):

bash

openclaw logs

Follow in real time with local timestamps:

bash

openclaw logs --follow --local-time

Pipe JSON logs to jq for filtering:

bash

openclaw logs --json | jq '.level == "error"'

Last 50 lines only:

bash

openclaw logs --limit 50

openclaw channels: Status, List, Add, and Remove

openclaw channels manages your messaging platform connections. The status subcommand is the one you'll use most. It tells you if a channel is actually connected and working.

Give this to your agent
Check the status of all my OpenClaw channels and tell me if any are disconnected or having issues.

Always review commands your agent suggests before approving them. Don't paste prompts from sources you don't trust.

Channel commands reference

Listing and checking channels

List all configured channels:

bash

openclaw channels list

Check health of all channels:

bash

openclaw channels status

Check a specific channel:

bash

openclaw channels status --channel telegram

See what a channel supports:

bash

openclaw channels capabilities --channel discord --target channel:123456
openclaw channels status output showing Telegram and Discord channels with health status and account details

Resolving targets

The resolve subcommand translates human-readable names to internal IDs:

bash

openclaw channels resolve --channel slack "#general" "@jane"

Viewing channel logs

Logs from all channels:

bash

openclaw channels logs --channel all

Logs from a specific channel:

bash

openclaw channels logs --channel telegram

Adding and removing channels

Add a channel (launches the interactive wizard):

bash

openclaw channels add --channel telegram --token <bot-token>

Remove a channel:

bash

openclaw channels remove --channel telegram

Remove and delete all channel data:

bash

openclaw channels remove --channel telegram --delete

The add wizard prompts for account IDs, display names, and agent binding. It also handles multi-account support, automatically migrating single-account configs to the multi-account shape when needed.

For channel-specific setup, see the Telegram, Discord, or other channel guides.

openclaw cron: List, Add, Edit, and Disable Jobs

openclaw cron manages scheduled tasks from the command line. You can create, edit, enable, disable, and manually trigger jobs. For a deeper walkthrough of cron job design, see the cron jobs automation guide.

Cron subcommands

System status:

bash

openclaw cron status

List all jobs:

bash

openclaw cron list

Create a job:

bash

openclaw cron add

Edit a job:

bash

openclaw cron edit <job-id>

Delete a job:

bash

openclaw cron rm <job-id>

Enable or disable without deleting:

bash

openclaw cron enable <job-id>
openclaw cron disable <job-id>

View run history:

bash

openclaw cron runs

Trigger a job right now:

bash

openclaw cron run <job-id>

Delivery options

By default, isolated cron add jobs use --announce delivery. To keep output internal:

bash

openclaw cron add --no-deliver

Edit delivery settings on existing jobs:

Set announce delivery to a specific Telegram chat:

bash

openclaw cron edit <job-id> --announce --channel telegram --to "123456789"

Disable delivery entirely:

bash

openclaw cron edit <job-id> --no-deliver

Retry behavior

Failed jobs use exponential backoff: 30 seconds, then 1 minute, 5 minutes, 15 minutes, and finally 60 minutes between retries.

One-shot jobs

Jobs created with --at delete themselves after a successful run. If you want to keep the job around after it fires, add --keep-after-run.

Config knobs

SettingDefaultWhat it does
cron.sessionRetention24hHow long to keep cron session data
cron.runLog.maxBytes-Max size of the run log
cron.runLog.keepLines-Minimum lines to keep when truncating

openclaw doctor: Health Checks and Auto-Fix

openclaw doctor runs health checks and can auto-fix common configuration problems. It's the first thing to try when something isn't working right.

Give this to your agent
Run openclaw doctor with --fix and tell me what it found and repaired.

Always review commands your agent suggests before approving them. Don't paste prompts from sources you don't trust.

Doctor flags and behavior
FlagAliasWhat it does
--repair--fixAuto-fix problems it finds
--deep-Run extended checks
--non-interactive-Skip confirmation prompts

Check only (no changes):

bash

openclaw doctor

Auto-fix with confirmations:

bash

openclaw doctor --fix

Auto-fix everything, no prompts:

bash

openclaw doctor --fix --non-interactive

Extended checks:

bash

openclaw doctor --deep

What doctor checks

Backup behavior

When you run --fix, doctor writes a backup to ~/.openclaw/openclaw.json.bak before making changes. Check this file if a fix breaks something.

macOS gotcha

On macOS, launchctl environment overrides can cause persistent "unauthorized" errors. If you're seeing auth failures after changing tokens:

Check for stale env vars:

bash

launchctl getenv OPENCLAW_GATEWAY_TOKEN

Clear them:

bash

launchctl unsetenv OPENCLAW_GATEWAY_TOKEN

For more troubleshooting, see the universal troubleshooting guide or the gateway pairing fix.

openclaw pairing: Approve and List Device Requests

openclaw pairing handles device authentication to your gateway. Two subcommands: list and approve.

List pending pairing requests:

bash

openclaw pairing list telegram

With explicit channel and account:

bash

openclaw pairing list --channel telegram --account work

Approve a pairing code:

bash

openclaw pairing approve telegram <code>

With explicit flags:

bash

openclaw pairing approve --channel telegram --account work --notify <code>

If you've only got one pairing-capable channel configured, you can skip the channel name:

bash

openclaw pairing approve <code>

For a deeper look at how pairing works, see OpenClaw Pairing Explained.

openclaw config: Get, Set, and Unset Values

openclaw config reads and writes your gateway configuration. Three subcommands: get, set, and unset.

Read a value (dot notation):

bash

openclaw config get agents.defaults.workspace

Read with bracket notation (arrays):

bash

openclaw config get agents.list[0].id

Set a value (parsed as JSON5):

bash

openclaw config set gateway.port 19001

Set with strict JSON parsing:

bash

openclaw config set gateway.port 19001 --strict-json

Remove a value:

bash

openclaw config unset some.old.key

Values are parsed as JSON5 by default, which means you can write true instead of "true" and skip quoting simple strings. Use --strict-json when you need exact type control.

Remember to restart the gateway after changing config values:

bash

openclaw config set gateway.port 19001
openclaw gateway restart

Key Terms

  • Gateway: The daemon process that runs OpenClaw and manages all connections
  • Channel: A messaging platform connection (Telegram, Discord, Slack, Signal, etc.)
  • Pairing: Device authentication that links a client to your gateway
  • Cron job: A scheduled task that runs on a timer inside the gateway

FAQ

How do I restart the OpenClaw gateway?

Run openclaw gateway restart. If you need to apply config changes, this is the command. For a full stop and start, use openclaw gateway stop followed by openclaw gateway start.

How do I check if my channels are working?

Run openclaw status --deep. The --deep flag sends live probes to each connected channel and reports their actual health, not just whether they're configured.

How do I follow logs in real time?

Run openclaw logs --follow. Add --local-time to see timestamps in your timezone instead of UTC. Add --json if you want to pipe the output to jq for filtering.

How do I fix configuration issues automatically?

Run openclaw doctor --fix. It creates a backup at ~/.openclaw/openclaw.json.bak before making changes. Add --non-interactive to skip confirmation prompts.

Where does OpenClaw store its config?

The config file lives at ~/.openclaw/openclaw.json. Use openclaw config get to read values and openclaw config set to write them. Don't edit the file directly unless you know what you're doing.

Evidence and Methodology

All command syntax, flags, and behavior in this reference come from the official OpenClaw CLI documentation. Output examples are based on actual CLI usage. This page consolidates information spread across separate doc pages into one scannable reference.

Changelog

  • 2026-10-26: Repaired the official CLI documentation links.

  • 2026-03-01: Initial publication

Did I get something wrong? Or have any other feedback? Let me know here.

More from Stack Junkie.

Get new articles by email.

More guides in The OpenClaw Handbook