Configuration & CLI CLI Commands Reference

OpenClaw CLI Commands: The Definitive Reference for Builders

Master every OpenClaw CLI command from first install to production operations. Real syntax, real flags, real outcomes — the reference top builders actually use.

TC
T. Chen
CLI & Infrastructure Specialist
Jan 8, 2025 16 min read 14.2k views
Updated Jan 8, 2025
Key Takeaways
  • The OpenClaw CLI covers every lifecycle stage — setup, config, monitoring, and updates — from a single binary
  • openclaw onboard and openclaw doctor solve 90% of first-run problems before they become support tickets
  • Flags like --json and --yes make every command scriptable for CI/CD pipelines
  • The TUI (openclaw tui) and CLI share state — use whichever fits your workflow at any moment
  • As of early 2025, the CLI has full Windows support — no WSL required for core commands

Fourteen commands. That's all it takes to go from zero to a fully running AI agent on any platform. The OpenClaw CLI packs every operation a builder needs into a single binary that works the same way on macOS, Linux, and Windows. Most people discover three commands and stop there. That's the mistake.

Builders who master the full CLI surface move faster, debug faster, and ship more reliable agent setups. Here's the complete picture.

Why the CLI Is Your Real Control Surface

The dashboard is useful for monitoring. The TUI is useful for interactive exploration. But the CLI is where real work happens — it's automatable, scriptable, and precise.

Every command accepts --help for inline documentation. Every destructive operation supports --dry-run so you can preview the outcome before committing. And every command that produces data supports --json for machine-readable output you can pipe into other tools.

💡
Quick Start: What to Run First

Fresh install? Run openclaw onboard first, then openclaw doctor to confirm everything is healthy. Those two commands get you to a running agent faster than reading any documentation.

The CLI communicates with the OpenClaw daemon over a local Unix socket (or TCP on Windows). That means commands are near-instantaneous — there's no HTTP round-trip adding latency to every operation.

Setup and Initialization Commands

These commands you run once — or occasionally when onboarding a new machine or agent. Get them right and the rest of the workflow flows naturally.

openclaw onboard

The entry point for every new installation. Runs an interactive wizard that configures your model provider, sets up the gateway, and walks you through connecting your first channel.

openclaw onboard
# Interactive wizard starts
# Guides through: model selection → channel setup → first test

openclaw onboard --channel telegram --model gpt-4o
# Skip the wizard, pass config directly

openclaw doctor

Runs a full diagnostic suite against your current installation. Checks daemon health, gateway connectivity, model provider auth, and channel connections. Returns a structured report with pass/fail for each check.

openclaw doctor
# Full diagnostic run

openclaw doctor --fix
# Attempt to auto-fix detected issues

openclaw models

List available models or switch the active model. The most common configuration operation after initial setup.

openclaw models list
# Lists all configured model providers and available models

openclaw models set gpt-4o
# Switch active model immediately — no restart required

openclaw models set claude-3-5-sonnet --provider anthropic
⚠️
Model Switching Is Live

Switching models with openclaw models set takes effect immediately for new conversations. Existing active sessions continue on the previous model until they end. This is intentional — it prevents mid-conversation model switches from breaking context.

Operations Commands

These are the commands you run daily. Monitoring, logging, status checks — the operations layer that keeps your agent healthy.

openclaw status

The fastest way to confirm everything is running. Shows daemon state, active channels, current model, and gateway health in a single output.

openclaw status
# Full status report

openclaw status --json
# Machine-readable output for monitoring pipelines

openclaw logs

Stream or query agent logs. The most powerful debugging tool in the CLI. Supports filtering by level, gateway, and time range.

openclaw logs --tail 50
# Last 50 log lines

openclaw logs --level error --since 1h
# Errors from the past hour

openclaw logs --gateway telegram --follow
# Stream Telegram gateway logs in real time

openclaw version

Prints the current CLI and daemon versions, plus the latest available version. If you're behind, it prints the upgrade command.

openclaw version
# Output: cli 1.6.2 · daemon 1.6.2 · latest 1.6.3

openclaw version --check-only
# Exit code 1 if update available — useful in CI

openclaw update

Downloads and installs the latest OpenClaw release. Performs a health check before and after to confirm the update succeeded.

openclaw update
# Update to latest stable

openclaw update --channel beta
# Update to latest beta release

openclaw update --dry-run
# Show what would be updated without installing

Configuration and Device Commands

Managing config values, paired devices, channels, and scheduled tasks — the configuration layer that shapes how your agent behaves.

openclaw config set

Set any configuration value from the command line. Changes take effect immediately without a restart for most settings.

openclaw config set model.temperature 0.7
openclaw config set gateway.port 8080
openclaw config set logging.level debug

openclaw devices approve

Approve a pending device pairing request. Devices that connect to your OpenClaw instance need to be approved before they can send or receive agent messages.

openclaw devices approve abc123def
# Approve by device ID

openclaw pairing list
# List pending approvals with device IDs

openclaw channels add

Connect a new messaging channel. Supports all major platforms. Runs an interactive setup that handles credentials, webhook registration, and connection testing.

openclaw channels add telegram
openclaw channels add discord
openclaw channels add slack --token xoxb-your-token

openclaw plugins install

Install plugins from the ClaWHub marketplace or a local path. Plugins extend your agent's capabilities with new skills and integrations.

openclaw plugins install web-search
openclaw plugins install github-integration
openclaw plugins install /path/to/local/plugin

openclaw cron add

Schedule recurring tasks using standard cron syntax. The most underused power feature in the CLI.

openclaw cron add "0 9 * * *" "daily-brief"
# Run the daily-brief skill every day at 9am

openclaw cron add "*/30 * * * *" "health-check"
# Run health-check every 30 minutes

openclaw tui

Opens the full terminal user interface — a rich, interactive dashboard built on the CLI's same data layer. Useful for exploring your setup without remembering command syntax.

openclaw tui
# Launch the terminal UI

Common Mistakes Builders Make with the CLI

After working with dozens of OpenClaw deployments, these are the patterns that slow people down.

Running commands as root when not necessary. The OpenClaw daemon runs as your user. Running CLI commands with sudo creates permission mismatches that break config reads and socket connections. Only use elevated privileges for system-level installs.

Not using --json in monitoring scripts. Human-readable output formats change between versions. Machine-readable JSON output is versioned and stable. If you're parsing CLI output in a script, always use --json.

Sound familiar? Here's where most people stop thinking about it.

Ignoring the daemon vs. CLI distinction. The CLI is a client. The daemon is the server. openclaw status can show "running" even if the daemon is in a degraded state. Always run openclaw doctor when something feels off — not just openclaw status.

Missing the --dry-run flag before updates. Production updates should always go through openclaw update --dry-run first. It shows exactly what will change, including any config migrations, before you commit.

Frequently Asked Questions

What is the OpenClaw CLI?

The OpenClaw CLI is the command-line interface for managing your AI agent — running setup, configuring models, connecting channels, and diagnosing issues. It ships with every OpenClaw installation and is the primary control surface for builders.

How do I see all available CLI commands?

Run openclaw --help for a top-level list or openclaw [command] --help for subcommand details. Every command has a help flag that documents all available options inline.

Can I use the CLI alongside the TUI?

Yes. The CLI and TUI (openclaw tui) share the same config and state. You can switch between them freely — CLI changes appear in the TUI immediately without any restart required.

Does openclaw CLI work on Windows?

Yes, as of v1.5.0 the CLI has full Windows support via PowerShell and CMD. Some shell-specific features like pipe-chaining work best in WSL2, but core commands run natively on Windows without any additional setup.

How do I run CLI commands non-interactively in scripts?

Pass --yes or -y to skip confirmation prompts. For machine-readable output, add --json to commands that support it. Set OC_NO_COLOR=1 to strip ANSI codes from log output in CI environments.

What does the --dry-run flag do?

The --dry-run flag shows what a command would do without making changes. It's available on destructive commands like openclaw update and openclaw config set. Use it before applying changes in production systems.

How do I update the OpenClaw CLI itself?

Run openclaw update to pull the latest release. The CLI checks for updates on launch and prints a notice if you're behind. Suppress this with auto_update_check: false in your config file.

Where does OpenClaw store its config file?

By default, config lives at ~/.openclaw/config.yaml. Override this with the OC_CONFIG environment variable. Run openclaw config path to print the active config path regardless of overrides.

TC
T. Chen
CLI & Infrastructure Specialist · aiagentsguides.com

T. Chen has deployed OpenClaw in production environments across three continents, covering homelab setups to enterprise deployments with hundreds of connected devices. He maintains the CLI reference documentation and contributes to the OpenClaw open-source tooling ecosystem.

Get new guides every week.

Join 50,000 builders using aiagentsguides.com. No spam, ever.