The OpenClaw command-line interface is powerful but can feel intimidating at first. This guide walks you through every step from installation to your first successful run.
Install OmniScriber — FreeSave your AI-assisted CLI setup guides from ChatGPT or Claude
The OpenClaw CLI doesn't have a graphical interface. There's no wizard, no setup screen, no drag-and-drop configuration. You open a terminal, type commands, and read output. For users who are more comfortable with apps than command lines, this can feel like a significant barrier.
The good news is that once you understand the basic structure of the CLI — how to start it, how to give it tasks, how to configure it — the rest becomes intuitive. The CLI is actually one of OpenClaw's strengths: it's fast, scriptable, and works the same way across every operating system.
This guide assumes you've already installed OpenClaw (see our installation guide if you haven't). We'll focus on the CLI-specific setup: understanding the commands, configuring your environment, and running your first real tasks.
The OpenClaw CLI is your primary interface for interacting with the agent. Through it, you can start interactive sessions where you give the agent tasks in natural language, run one-off commands for quick automation, configure which model to use and how, manage skills and extensions, and view logs of past agent sessions.
The CLI also supports piping and scripting, which means you can integrate OpenClaw into shell scripts, cron jobs, and other automation workflows. This is where OpenClaw really shines for power users — it becomes a programmable AI layer that you can call from anywhere in your existing toolchain.
Key commands to know: `openclaw` starts an interactive session, `openclaw run "task description"` runs a one-off task, `openclaw config` opens the configuration editor, and `openclaw skills` manages your installed skills.
The most important configuration step. Add your API key to your shell profile: export ANTHROPIC_API_KEY=your_key (for Claude) or export OPENAI_API_KEY=your_key (for GPT-4). Add this line to ~/.zshrc or ~/.bashrc so it persists across sessions.
Before doing anything else, run openclaw --help to see all available commands and flags. This gives you a map of what's possible and helps you understand the CLI's structure.
Run openclaw config to open the configuration file. Set your preferred model (e.g., claude-3-5-sonnet-20241022 or gpt-4o), your API key, and any other preferences. Save and exit.
Try: openclaw run 'What is the current date and time?' This confirms the CLI can reach your model and get a response. If it works, you're ready for real tasks.
Try: openclaw run 'List the 5 largest files in my home directory'. This tests that the CLI can access your file system — a core capability for most real workflows.
Getting the CLI configured correctly often involves multiple back-and-forth conversations with AI. OmniScriber saves all of them so you can reference your exact setup steps later.
When you ask ChatGPT or Claude for a list of useful OpenClaw CLI commands, export that conversation to Markdown with OmniScriber and keep it as a permanent reference.
As you build shell scripts that incorporate OpenClaw, document the AI conversations that helped you write them. OmniScriber keeps those conversations searchable and exportable.
Export your CLI setup conversation as a formatted document and share it with teammates who are setting up OpenClaw for the first time — saving everyone hours of trial and error.
Save your AI-assisted CLI setup guides from ChatGPT or Claude