Master the essential commands to start, stop, configure, and interact with your OpenClaw agent.
Overview
This article is your quick reference for the most important commands that control your OpenClaw agent. Whether you need to start, stop, restart, or reconfigure your agent on the fly, every essential command is covered here with practical examples and tips.
Starting Your Agent
The most basic operation is launching your OpenClaw agent. By default, OpenClaw reads its configuration from ~/.openclaw/config.yaml and starts in the foreground.
# Start with default configuration
openclaw start
# Start with a specific config file
openclaw start --config /path/to/custom-config.yaml
# Start in background (daemon mode)
openclaw start --daemon
# Start with verbose output for debugging
openclaw start --verbose
Flag
Description
--config
Path to a custom configuration file
--daemon
Run the agent as a background process
--verbose
Enable detailed console output
--port
Override the default API port (default: 3120)
--no-skills
Start without loading any skills
Tip: When starting in daemon mode, logs are written to ~/.openclaw/logs/agent.log by default. Use openclaw logs --follow to stream them in real time.
Stopping and Restarting
Graceful shutdown ensures that all pending tasks are completed before the agent exits.
# Graceful stop
openclaw stop
# Force stop (kills immediately)
openclaw stop --force
# Restart (stop + start)
openclaw restart
# Restart with a new config
openclaw restart --config /path/to/new-config.yaml
What Happens During Graceful Stop?
OpenClaw finishes processing any in-flight messages.
Active platform connections (Telegram, Slack, etc.) are closed cleanly.
Memory is flushed to persistent storage.
The process exits with code 0.
If the agent does not stop within 30 seconds, it is forcefully terminated. You can adjust this timeout:
openclaw stop --timeout 60
Checking Agent Status
Before making changes, it is often useful to check what state your agent is in.
# Quick status check
openclaw status
# Detailed status with loaded skills, memory usage, uptime
openclaw status --detail
You can read and modify configuration values without editing YAML files directly.
# Show all config values
openclaw config list
# Get a specific value
openclaw config get model.provider
# Set a value (takes effect on next restart)
openclaw config set model.provider openai
openclaw config set model.name gpt-4o
# Set a value and restart immediately
openclaw config set model.name gpt-4o --restart
# Reset a value to its default
openclaw config reset model.temperature
Command
Description
config list
Display all configuration key-value pairs
config get <key>
Retrieve a single config value
config set <key> <value>
Change a config value
config reset <key>
Revert a key to its default
config validate
Check the config file for errors
Warning: Some configuration changes (e.g., switching the AI provider) require a restart to take effect. The CLI will tell you when a restart is needed.
Skill Management Commands
Skills extend your agent's capabilities. These commands let you manage them from the terminal.
# List installed skills
openclaw skills list
# Install a skill from ClawHub
openclaw skills install weather-forecast
# Remove a skill
openclaw skills remove weather-forecast
# Enable or disable a skill without removing it
openclaw skills enable weather-forecast
openclaw skills disable weather-forecast
# Update all skills to latest versions
openclaw skills update --all
Memory Commands
OpenClaw maintains a persistent memory system. These commands let you inspect and manage it.
# Show memory statistics
openclaw memory stats
# Search memory for a keyword
openclaw memory search "meeting notes"
# Export memory to a JSON file
openclaw memory export --output backup.json
# Import memory from a backup
openclaw memory import backup.json
# Clear all memory (requires confirmation)
openclaw memory clear
Tip: Always export your memory before performing a clear. There is no undo.
Sending a Quick Message
You can send a one-off prompt to your agent directly from the terminal without starting a full interactive session.
# Send a single prompt
openclaw ask "What meetings do I have tomorrow?"
# Pipe input from a file
cat report.txt | openclaw ask "Summarize this document"
# Use a specific model for this request only
openclaw ask --model anthropic/claude-3 "Explain quantum computing"
Interactive Chat Mode
For longer conversations, use the interactive chat mode:
openclaw chat
Inside the chat session, special slash commands are available:
Command
Description
/exit
End the chat session
/clear
Clear the conversation history
/model <name>
Switch model mid-conversation
/system <prompt>
Set a system prompt
/export
Save the conversation to a file
/skills
List available skills
Health Check and Diagnostics
# Run a full health check
openclaw doctor
# Check connectivity to configured platforms
openclaw doctor --platforms
# Verify API keys are valid
openclaw doctor --keys
# Test model connectivity
openclaw doctor --model
The doctor command tests each component and reports its status with a clear pass/fail indicator.
Cheat Sheet
Task
Command
Start the agent
openclaw start
Stop the agent
openclaw stop
Restart
openclaw restart
Check status
openclaw status
Change model
openclaw config set model.name gpt-4o
Install a skill
openclaw skills install <name>
Quick question
openclaw ask "..."
Interactive chat
openclaw chat
View logs
openclaw logs --follow
Health check
openclaw doctor
Export memory
openclaw memory export
Troubleshooting
Agent Won't Start
Run openclaw config validate to check for YAML errors.
Ensure no other instance is running: openclaw status.
Check port availability: lsof -i :3120.
Review logs: openclaw logs --last 50.
Commands Return "Agent Not Running"
Most commands require a running agent. Start it first with openclaw start. Commands like config list and doctor work even when the agent is stopped.
Permission Denied Errors
Ensure the OpenClaw data directory (~/.openclaw/) is owned by your user. Run:
sudo chown -R $(whoami) ~/.openclaw/
Next Steps
Explore the full CLI reference with openclaw --help.
Read OpenClaw CLI: Essential Commands and Options for advanced flags and environment variables.
Set up your preferred AI model with Setting Your OpenClaw AI Model and Provider.