Clawist
πŸ“– Guide8 min readβ€’β€’By Lin

OpenClaw CLI Commands: Complete Reference Guide

OpenClaw CLI Commands: Complete Reference Guide

OpenClaw's command-line interface is your primary tool for managing your AI assistant. From starting the gateway to configuring channels to setting up automation, the CLI handles it all.

This reference covers every important command with practical examples. Bookmark it for quick access when you need it.

Installation and Verification

OpenClaw CLI installation Get OpenClaw installed and verify it's working

Install OpenClaw:

npm install -g openclaw

Verify installation:

openclaw --version
openclaw --help

Initialize workspace:

cd ~/.openclaw  # Or your preferred location
openclaw init

This creates the workspace structure with default configuration files.

Gateway Commands

Gateway management commands Control the OpenClaw gateway daemon

The gateway is the core service that handles all messaging and AI interactions.

Start the gateway:

openclaw gateway start

Stop the gateway:

openclaw gateway stop

Restart the gateway:

openclaw gateway restart

Check gateway status:

openclaw gateway status

View gateway logs:

openclaw gateway logs
openclaw gateway logs --follow  # Tail logs
openclaw gateway logs --lines 100  # Last 100 lines

Channel Configuration

Channel configuration Connect messaging platforms to OpenClaw

List connected channels:

openclaw channels status

Configure Telegram:

openclaw config set telegram.enabled true
openclaw config set telegram.botToken "your-token"

Configure Discord:

openclaw config set discord.enabled true
openclaw config set discord.botToken "your-token"

Configure Slack:

openclaw config set slack.enabled true
openclaw config set slack.botToken "xoxb-your-token"
openclaw config set slack.signingSecret "your-secret"

Test channel connection:

openclaw channels test telegram

Cron Jobs (Scheduled Tasks)

Cron job automation Schedule recurring AI tasks

List all cron jobs:

openclaw cron list

Add a cron job:

openclaw cron add "job-name" "0 9 * * *" "Your prompt here"

Cron expression format:

* * * * *
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ └── Day of week (0-7, 0 and 7 are Sunday)
β”‚ β”‚ β”‚ └──── Month (1-12)
β”‚ β”‚ └────── Day of month (1-31)
β”‚ └──────── Hour (0-23)
└────────── Minute (0-59)

Common schedules:

  • 0 9 * * * - 9 AM daily
  • 0 9 * * 1-5 - 9 AM weekdays
  • 0 */2 * * * - Every 2 hours
  • 0 0 1 * * - First of each month

Remove a cron job:

openclaw cron remove "job-name"

Run a cron job immediately:

openclaw cron run "job-name"

Configuration Management

Configuration settings Manage OpenClaw settings

View current configuration:

openclaw config show

Get a specific setting:

openclaw config get ai.model

Set a configuration value:

openclaw config set ai.model "claude-sonnet-4-20250514"

Common settings:

openclaw config set ai.provider anthropic
openclaw config set ai.model claude-sonnet-4-20250514

openclaw config set anthropic.apiKey "sk-ant-..."

openclaw config set tools.browser.enabled true
openclaw config set tools.filesystem.enabled true
openclaw config set tools.exec.enabled true

openclaw config set memory.enabled true
openclaw config set memory.maxAge "30d"

Reset configuration:

openclaw config reset

Pairing and Access Control

Access control settings Manage who can access your AI assistant

List pending pairing requests:

openclaw pairing list

Approve a pairing request:

openclaw pairing approve telegram ABC123

Reject a pairing request:

openclaw pairing reject telegram ABC123

List approved users:

openclaw pairing approved

Revoke access:

openclaw pairing revoke telegram user_id

Tools Management

Tools configuration Enable and configure AI tools

List available tools:

openclaw tools list

Enable a tool:

openclaw tools enable browser
openclaw tools enable gmail
openclaw tools enable exec

Disable a tool:

openclaw tools disable exec

Configure tool settings:

openclaw tools config browser.headless true
openclaw tools config exec.approvalMode prompt

Test a tool:

openclaw tools test browser

Troubleshooting Commands

Troubleshooting and debugging Diagnose and fix common issues

Check system health:

openclaw doctor

Verify API connection:

openclaw test api

Clear session data:

openclaw sessions clear

Reset to defaults:

openclaw reset --soft  # Keep data, reset config
openclaw reset --hard  # Full reset (destructive)

Debug mode:

openclaw gateway start --debug

Export configuration:

openclaw config export > backup.json

Import configuration:

openclaw config import backup.json

Conclusion

Terminal with CLI commands Master the OpenClaw CLI for efficient AI assistant management

This reference covers the essential CLI commands for daily OpenClaw usage. Keep it bookmarked for quick lookups when managing your AI assistant.

Key commands to remember:

  • openclaw gateway start/stop/status - Manage the daemon
  • openclaw config set/get - Configure settings
  • openclaw cron add/list/remove - Schedule tasks
  • openclaw channels status - Check connections
  • openclaw doctor - Troubleshoot issues

Continue learning:

Master the CLI and your AI assistant becomes an extension of your workflow.

FAQ

CLI FAQ Common CLI questions

Where are config files stored?

By default in ~/.openclaw/. Use OPENCLAW_HOME environment variable to change.

How do I update OpenClaw?

npm update -g openclaw
openclaw gateway restart

Can I run multiple instances?

Yes, use different workspace directories and ports for each instance.

How do I backup my setup?

cp -r ~/.openclaw ~/.openclaw-backup

Or use openclaw config export for configuration only.

What if a command hangs?

Check gateway logs with openclaw gateway logs. Use --debug flag for verbose output.