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
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
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
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)
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 daily0 9 * * 1-5- 9 AM weekdays0 */2 * * *- Every 2 hours0 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
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
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
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
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
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 daemonopenclaw config set/get- Configure settingsopenclaw cron add/list/remove- Schedule tasksopenclaw channels status- Check connectionsopenclaw doctor- Troubleshoot issues
Continue learning:
- VPS setup guide for deployment
- Automation guide for cron jobs
- Telegram setup for mobile access
Master the CLI and your AI assistant becomes an extension of your workflow.
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.
More Articles
The Ultimate OpenClaw AWS Setup Guide

The definitive guide to setting up OpenClaw on AWS. Includes spot instance configuration, cost optimization, and step-by-step instructions.
Building AI Workflows with Tool Chaining in OpenClaw
Master the art of chaining tools and function calls to build powerful multi-step AI automation workflowsβfrom data extraction to content generation and deployment.
Cost Optimization Guide for Self-Hosted AI Assistants: Run Claude on a Budget
Practical strategies to reduce API costs for self-hosted AI assistantsβsmart model routing, caching, batching, and OpenClaw-specific optimizations to run Claude affordably.