A comprehensive reference for the OpenClaw command-line interface, including all flags and configuration options.
Overview
The OpenClaw CLI (Command-Line Interface) is the primary tool for managing every aspect of your agent. This comprehensive reference covers all available commands, their options, flags, environment variables, and output formats — everything a power user needs for full control.
Global Flags
These flags can be applied to any OpenClaw command:
Flag
Short
Description
--config <path>
-c
Use a custom config file instead of the default
--verbose
-v
Enable verbose output
--quiet
-q
Suppress non-essential output
--json
-j
Output in JSON format (useful for scripting)
--no-color
Disable colored terminal output
--version
-V
Print the OpenClaw version and exit
--help
-h
Show help for any command
# Example: get the version
openclaw --version
# Example: list skills in JSON format
openclaw skills list --json
Environment Variables
OpenClaw respects several environment variables that override config file values:
Variable
Description
Default
OPENCLAW_HOME
Base directory for all OpenClaw data
~/.openclaw
OPENCLAW_CONFIG
Path to the config file
$OPENCLAW_HOME/config.yaml
OPENCLAW_LOG_LEVEL
Log verbosity: debug, info, warn, error
info
OPENCLAW_MODEL
Override the default model
Config value
OPENCLAW_PROVIDER
Override the default provider
Config value
OPENCLAW_API_KEY
API key for the active provider
Config value
OPENCLAW_PORT
API server port
3120
OPENCLAW_NO_TELEMETRY
Disable anonymous usage telemetry
false
# Start with a custom home directory
OPENCLAW_HOME=/opt/openclaw openclaw start
# Override model for a single session
OPENCLAW_MODEL=anthropic/claude-3 openclaw chat
Tip: Environment variables take precedence over config file values but are overridden by explicit CLI flags.
Command Reference
openclaw start
Starts the OpenClaw agent.
openclaw start [flags]
Flag
Description
--daemon
Run as background process
--port <number>
Override API port
--no-skills
Start without loading skills
--no-memory
Start without loading persistent memory
--profile <name>
Use a named configuration profile
openclaw stop
Stops a running agent.
openclaw stop [flags]
Flag
Description
--force
Kill immediately without graceful shutdown
--timeout <seconds>
Max wait time for graceful shutdown (default: 30)
openclaw restart
Stops and restarts the agent.
openclaw restart [flags]
Accepts all flags from both start and stop.
openclaw status
Shows the current state of the agent.
openclaw status [flags]
Flag
Description
--detail
Show extended information (skills, memory, platforms)
--json
Output in JSON format
openclaw config
Manage configuration values.
openclaw config <subcommand> [args]
Subcommand
Description
list
Show all configuration values
get <key>
Get a specific value
set <key> <value>
Set a value
reset <key>
Reset a key to its default
validate
Check the config file for syntax errors
edit
Open the config file in your default editor
export
Export the full config to stdout
# Validate your config after manual edits
openclaw config validate
# Open in editor
openclaw config edit
openclaw skills
Manage agent skills.
openclaw skills <subcommand> [args]
Subcommand
Description
list
List all installed skills
install <name>
Install a skill from ClawHub
remove <name>
Uninstall a skill
enable <name>
Enable a disabled skill
disable <name>
Disable a skill without removing it
update [name]
Update a specific skill or all skills
info <name>
Show detailed information about a skill
create <name>
Scaffold a new custom skill project
# Install and immediately enable
openclaw skills install calendar-sync
# Check what a skill does before installing
openclaw skills info calendar-sync
openclaw memory
Manage the agent's persistent memory.
openclaw memory <subcommand> [args]
Subcommand
Description
stats
Show memory usage statistics
search <query>
Search memory entries
export
Export memory to JSON
import <file>
Import memory from a JSON file
clear
Delete all memory (requires --confirm)
prune
Remove old or low-relevance entries
openclaw logs
View agent logs.
openclaw logs [flags]
Flag
Description
--follow / -f
Stream logs in real time
--last <n>
Show the last n log entries
--level <level>
Filter by log level
--since <duration>
Show logs from the last duration (e.g., 1h, 30m)
--grep <pattern>
Filter log lines matching a regex pattern
# Stream errors only
openclaw logs --follow --level error
# Last hour of debug logs
openclaw logs --since 1h --level debug
openclaw ask
Send a one-shot prompt.
openclaw ask "<prompt>" [flags]
Flag
Description
--model <name>
Override the model for this request
--no-memory
Don't use or store memory for this query
--system <prompt>
Set a custom system prompt
--file <path>
Attach a file for context
openclaw chat
Start an interactive chat session.
openclaw chat [flags]
Flag
Description
--model <name>
Override the model
--system <prompt>
Set a system prompt
--no-memory
Disable memory for this session
openclaw doctor
Run diagnostic checks.
openclaw doctor [flags]
Flag
Description
--platforms
Test platform connections
--keys
Validate API keys
--model
Test model connectivity
--all
Run all checks
openclaw update
Update OpenClaw itself.
openclaw update [flags]
Flag
Description
--check
Check for updates without installing
--pre-release
Include pre-release versions
Output Formats
Many commands support --json for machine-readable output. This is useful for scripting:
# Parse status in a script
STATUS=$(openclaw status --json | jq -r '.state')
if [ "$STATUS" != "RUNNING" ]; then
openclaw start --daemon
fi
Exit Codes
Code
Meaning
0
Success
1
General error
2
Configuration error
3
Connection error (platform or model)
4
Authentication error (invalid API key)
5
Agent not running (when required)
Shell Completion
OpenClaw supports autocompletion for Bash, Zsh, and Fish:
Configuring OpenClaw for First Use — Essential configuration steps to get your OpenClaw agent running after installation, including API keys and preferences.