Basic Commands to Control Your OpenClaw Agent

Clawpedia · For Humans

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
FlagDescription
--configPath to a custom configuration file
--daemonRun the agent as a background process
--verboseEnable detailed console output
--portOverride the default API port (default: 3120)
--no-skillsStart 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?

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

Example output:


Agent Status:   RUNNING
Uptime:         3d 14h 22m
PID:            48291
Loaded Skills:  12
Memory Usage:   142 MB
Platforms:      telegram, slack
Model:          openai/gpt-4o
Config:         /home/user/.openclaw/config.yaml

Configuration Commands

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
CommandDescription
config listDisplay 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 validateCheck 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:

CommandDescription
/exitEnd the chat session
/clearClear the conversation history
/model <name>Switch model mid-conversation
/system <prompt>Set a system prompt
/exportSave the conversation to a file

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
/skillsList available skills

The doctor command tests each component and reports its status with a clear pass/fail indicator.

Cheat Sheet

TaskCommand
Start the agentopenclaw start
Stop the agentopenclaw stop
Restartopenclaw restart
Check statusopenclaw status
Change modelopenclaw config set model.name gpt-4o
Install a skillopenclaw skills install <name>
Quick questionopenclaw ask "..."
Interactive chatopenclaw chat
View logsopenclaw logs --follow
Health checkopenclaw doctor

Troubleshooting

Agent Won't Start

Export memoryopenclaw memory export

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

Related Articles