OpenClaw Commands Cheat Sheet: The Commands That Matter
OpenClaw has a lot of commands. Most of them you’ll never need. This cheat sheet covers the ones that matter for day-to-day use, organized by what you’re trying to do.
Bookmark this page. Come back when you forget how to restart the gateway or add a new MCP server. The 247K+ star GitHub repo has full documentation, but this covers the 80% you’ll use 99% of the time.
Getting Started
# Run the onboarding wizard (first time only)
openclaw onboard
# Start the agent and gateway
openclaw start
# Restart the gateway (required after config changes)
openclaw restart
# Update OpenClaw to the latest version
openclaw update
# Check current version
openclaw --version
# View agent status and connected channels
openclaw status
The most common mistake: changing config and forgetting to restart. If a new tool or skill isn’t showing up, restart first, debug second.
Skill Management
Skills are installed with the clawhub CLI. Each skill adds capabilities to your agent.
# Install a skill
clawhub install <skill-name>
# Install AgentPatch (50+ tools, one connection)
clawhub install agentpatch
# List installed skills
clawhub list
# Remove a skill
clawhub remove <skill-name>
# Search available skills
clawhub search <keyword>
Always restart the gateway after installing or removing a skill.
Configuration
OpenClaw’s config lives at ~/.openclaw/openclaw.json. Edit it directly or use the CLI.
Adding an MCP Server Manually
Open ~/.openclaw/openclaw.json and add an entry under mcp.servers:
{
"mcp": {
"servers": {
"agentpatch": {
"url": "https://mcp.agentpatch.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
}
Per-Agent Routing
Route specific MCP servers to specific agents using the agents.<name>.mcpServers key:
{
"agents": {
"research": {
"mcpServers": ["agentpatch"]
},
"ops": {
"mcpServers": ["filesystem", "github"]
}
}
}
This keeps each agent focused on its domain. The research agent gets search, news, and data tools. The ops agent gets file and repo tools. Better tool selection, fewer mistakes.
Common Config Tasks
# Open config in your default editor
openclaw config edit
# Validate config syntax
openclaw config validate
# Show current config (redacts secrets)
openclaw config show
AgentPatch CLI Tool Usage
Once AgentPatch is connected, you can also use the ap CLI to interact with the marketplace directly.
The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.
Install (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Example commands your agent will use:
ap search "web search"
ap run google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
# Search for available tools
ap search "web search"
ap search "email"
ap search "image generation"
# Run a tool directly from the command line
ap run google-search --query "best coffee shops in Seattle"
ap run generate-image --prompt "a mountain landscape at sunset"
# Run an async job and check its status
ap job google-trends --keyword "remote work" --timeframe "past_12_months"
ap job status <job-id>
# List your recent tool invocations
ap history
# Check your credit balance
ap balance
The ap CLI is useful for testing tools before wiring them into your agent, or for quick one-off lookups from the terminal.
Channel Management
# Connect a new messaging channel
openclaw channel add telegram
openclaw channel add discord
openclaw channel add signal
openclaw channel add slack
# List connected channels
openclaw channel list
# Remove a channel
openclaw channel remove <channel-name>
Multi-Agent Setup
# Create a new agent
openclaw agent create <name>
# List agents
openclaw agent list
# Set which MCP servers an agent can use
openclaw agent config <name> --mcp-servers agentpatch,github
# Delete an agent
openclaw agent delete <name>
Per-agent routing (covered in the Configuration section above) is the JSON-level way to do the same thing.
Gateway Management
# Start the gateway
openclaw gateway start
# Stop the gateway
openclaw gateway stop
# View gateway logs (useful for debugging tool calls)
openclaw gateway logs
# View gateway logs with filtering
openclaw gateway logs --tail 50
openclaw gateway logs --filter "error"
When a tool call fails, gateway logs are the first place to look. They show the MCP request, the response, and any errors.
Troubleshooting Quick Reference
| Problem | Fix |
|---|---|
| New skill not showing up | openclaw restart |
| Tool calls failing | Check openclaw gateway logs |
| Config syntax error | openclaw config validate |
| Agent not responding | openclaw status, then openclaw restart |
| MCP connection refused | Verify the URL and API key in config |
| Rate limit errors | Check provider limits or switch to a marketplace |
Wrapping Up
This covers the commands you’ll use most often. Start with clawhub install agentpatch for broad tool coverage, keep openclaw restart in muscle memory, and check gateway logs when things break. Full tool catalog at agentpatch.ai.