### Quick Start: Clone, Configure, and Start OpenClaw Agent Source: https://docs.claw.so/openclaw-setup This snippet demonstrates the essential steps to set up an OpenClaw instance. It involves cloning the OpenClaw repository, copying and editing the environment configuration file, and finally starting the agent using Docker Compose. Ensure Docker and Docker Compose are installed on your server. ```bash # Clone the OpenClaw repo git clone https://github.com/openclaw/openclaw # Configure environment cp .env.example .env # Edit .env with your settings # Start the agent docker compose up -d ``` -------------------------------- ### Install Homebrew on Linux Source: https://docs.claw.so/engine/help/faq This snippet provides the commands to install Homebrew on a Linux system. It includes downloading and running the installation script, configuring the shell environment, and an example of installing a package. It also mentions considerations for systemd services and environment variables. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.profile eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" brew install ``` -------------------------------- ### Install Dependencies and Start Gateway Watch Source: https://docs.claw.so/engine/start/setup Installs project dependencies using pnpm and starts the Gateway in watch mode for development. This enables hot reloading on TypeScript changes. ```bash pnpm install pnpm gateway:watch ``` -------------------------------- ### Install Tailscale on VPS using curl Source: https://docs.claw.so/engine/help/faq Installs Tailscale on a Virtual Private Server (VPS) using a curl command to download and execute the installation script. It then starts the Tailscale service. ```bash curl -fsSL https://tailscale.com/install.sh | sh sudo tailscale up ``` -------------------------------- ### Install OpenClaw with Onboarding Wizard Source: https://docs.claw.so/engine/help/faq Installs OpenClaw using the official installer script and then runs the onboarding wizard, which typically sets up the Gateway to run on port 18789 and can build UI assets. The --install-daemon flag is used to set up the gateway as a service. ```bash curl -fsSL https://openclaw.ai/install.sh | bash ``` ```bash openclaw onboard --install-daemon ``` -------------------------------- ### Install OpenClaw from Source (Development) Source: https://docs.claw.so/engine/start/openclaw Clones the OpenClaw repository, installs dependencies, builds the UI and project, and links it globally for development purposes. Requires Git and pnpm. ```bash git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm ui:build # auto-installs UI deps on first run pnpm build pnpm link --global ``` -------------------------------- ### Run Openclaw Setup Wizard Source: https://docs.claw.so/engine/cli/setup Launches the interactive setup wizard for Openclaw by using the `--wizard` flag with the `openclaw setup` command. This provides a guided experience for configuration. ```bash openclaw setup --wizard ``` -------------------------------- ### Run OpenClaw Onboarding Wizard Source: https://docs.claw.so/engine/platforms/digitalocean Initiates the OpenClaw onboarding process, which includes setting up model authentication, configuring channels, generating a gateway token, and installing the gateway as a systemd service. This command is interactive and guides the user through the setup. ```bash openclaw onboard --install-daemon ``` -------------------------------- ### Set up OpenClaw from Source (Developer) Source: https://docs.claw.so/engine/help/faq Installs OpenClaw from its source code repository for development purposes. This involves cloning the repository, installing dependencies using pnpm, building the project, and then running the onboarding process. ```bash git clone https://github.com/openclaw/openclaw.git ``` ```bash cd openclaw ``` ```bash pnpm install ``` ```bash pnpm build ``` ```bash pnpm ui:build # auto-installs UI deps on first run ``` ```bash openclaw onboard ``` -------------------------------- ### Get Installer Help (Shell) Source: https://docs.claw.so/engine/install/installer This command fetches the `install.sh` script and pipes it to bash with the `--help` flag to display available options and usage instructions for the recommended installer. ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --help ``` -------------------------------- ### Run OpenClaw Gateway Source: https://docs.claw.so/engine/start/getting-started Starts the OpenClaw gateway service from the local repository using Node.js. It allows specifying the port and enabling verbose logging. ```bash node openclaw.mjs gateway --port 18789 --verbose ``` -------------------------------- ### Comprehensive OpenClaw Assistant Configuration (JSON) Source: https://docs.claw.so/engine/start/openclaw An example of a detailed OpenClaw configuration file for setting up a personal assistant. It includes settings for logging, agent model, workspace, thinking defaults, timeouts, heartbeats, WhatsApp channel restrictions, group chat behavior, routing, and session management. ```json { logging: { level: "info" }, agent: { model: "anthropic/claude-opus-4-5", workspace: "~/.openclaw/workspace", thinkingDefault: "high", timeoutSeconds: 1800, // Start with 0; enable later. heartbeat: { every: "0m" }, }, channels: { whatsapp: { allowFrom: ["+15555550123"], groups: { "*": { requireMention: true }, }, }, }, routing: { groupChat: { mentionPatterns: ["@openclaw", "openclaw"], }, }, session: { scope: "per-sender", resetTriggers: ["/new", "/reset"], reset: { mode: "daily", atHour: 4, idleMinutes: 10080, }, }, } ``` -------------------------------- ### Enable Hook Logging Output Source: https://docs.claw.so/engine/hooks Shows example output of hook logging at startup, indicating which hooks have been registered and the events they are listening for. ```text Registered hook: session-memory -> command:new Registered hook: command-logger -> command Registered hook: boot-md -> gateway:startup ``` -------------------------------- ### Get npm Global Prefix (Windows) Source: https://docs.claw.so/engine/help/faq Retrieves the npm global installation prefix. This is used to verify if the npm bin directory is correctly added to the system's PATH environment variable on Windows. ```bash npm config get prefix ``` -------------------------------- ### Starting Ishi TUI Source: https://docs.claw.so/tui Demonstrates how to start the Ishi TUI. It can be run for the current directory or a specific project path. ```bash ishi ``` ```bash claw /path/to/project ``` -------------------------------- ### CLI Setup for OpenCode Zen Onboarding Source: https://docs.claw.so/engine/providers/opencode This snippet shows how to set up OpenCode Zen using the `openclaw` command-line interface. It provides both an interactive and a non-interactive method for onboarding, requiring an API key for the latter. ```bash openclaw onboard --auth-choice opencode-zen # or non-interactive openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY" ``` -------------------------------- ### Install OpenClaw from Git Checkout Source: https://docs.claw.so/engine/help/faq Installs OpenClaw directly from a git repository checkout. This method allows AI agents to read the source code and documentation for better debugging and setup assistance. The installation can be switched back to a stable version later. ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git ``` -------------------------------- ### Configure Skills Loading and Installation Source: https://docs.claw.so/engine/gateway/configuration-examples Manages skills by specifying allowed bundled skills, directories for loading extra skills, and installation preferences (e.g., preferring Homebrew, Node.js package manager). It also defines specific skill entries with their API keys and environment variables. ```json { "skills": { "allowBundled": ["gemini", "peekaboo"], "load": { "extraDirs": ["~/Projects/agent-scripts/skills"] }, "install": { "preferBrew": true, "nodeManager": "npm" }, "entries": { "nano-banana-pro": { "enabled": true, "apiKey": "GEMINI_KEY_HERE", "env": { "GEMINI_API_KEY": "GEMINI_KEY_HERE" } }, "peekaboo": { "enabled": true } } } } ``` -------------------------------- ### Re-run Installer with Verbose Output (macOS/Linux) Source: https://docs.claw.so/engine/help/faq Executes the OpenClaw installer with verbose output enabled. This is useful for debugging installation issues by providing more detailed logs. ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --verbose ``` ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --beta --verbose ``` ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git --verbose ``` -------------------------------- ### Quick Setup for Synthetic Provider Source: https://docs.claw.so/engine/providers/synthetic This command initiates the onboarding process for the Synthetic provider using an API key authentication method. It's a crucial first step to integrate the provider into your OpenClaw setup. ```bash openclaw onboard --auth-choice synthetic-api-key ``` -------------------------------- ### Install OpenClaw Beta Version (macOS/Linux) Source: https://docs.claw.so/engine/help/faq Installs the beta version of OpenClaw using a curl command to download and execute the installation script. This is suitable for macOS and Linux users. ```bash curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --beta ``` -------------------------------- ### CLI Examples for Onboarding and Model Management Source: https://docs.claw.so/engine/concepts/model-providers Provides command-line examples for onboarding with a specific authentication choice, setting a default model, and listing available models. ```bash openclaw onboard --auth-choice opencode-zen openclaw models set opencode/claude-opus-4-5 openclaw models list ``` -------------------------------- ### Install OpenClaw Globally (npm/pnpm) Source: https://docs.claw.so/engine/start/openclaw Installs the latest version of OpenClaw globally using either npm or pnpm package managers. Ensure Node.js version 22 or higher is installed. ```bash npm install -g openclaw@latest # or: pnpm add -g openclaw@latest ``` -------------------------------- ### Install Docker and Git on Ubuntu/Debian Source: https://docs.claw.so/engine/platforms/hetzner Installs necessary packages like git, curl, and ca-certificates, followed by Docker and Docker Compose using the official installation script. This prepares the VPS environment for running containerized applications. ```bash apt-get update apt-get install -y git curl ca-certificates curl -fsSL https://get.docker.com | sh ``` -------------------------------- ### Install and Load OpenClaw Chrome Extension Source: https://docs.claw.so/engine/help/faq These commands are used to install the OpenClaw Chrome extension and retrieve its path. After installation, the extension needs to be loaded as an unpacked extension in Chrome's developer mode. ```bash openclaw browser extension install openclaw browser extension path ``` -------------------------------- ### Install OpenClaw from Git (macOS/Linux) Source: https://docs.claw.so/engine/help/faq Installs OpenClaw directly from the development branch using git. This method allows for local modifications and updates directly from the source. ```bash curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git ``` -------------------------------- ### Exec Tool Examples Source: https://docs.claw.so/engine/tools/exec Provides examples for using the 'exec' tool, including foreground execution, background execution with polling, sending keys to processes, submitting commands, and pasting text. ```APIDOC ## Exec Tool Examples ### Description Examples demonstrating various use cases for the `exec` tool, including foreground execution, background execution with polling, sending keys to a process (tmux-style), submitting commands, and pasting text. ### Method POST ### Endpoint `/execute` (Hypothetical endpoint for tool execution) ### Parameters N/A (These are tool configurations within a request body) ### Request Example #### Foreground Execution ```json { "tool": "exec", "command": "ls -la" } ``` #### Background + Poll ```json { "tool": "exec", "command": "npm run build", "yieldMs": 1000 } { "tool": "process", "action": "poll", "sessionId": "" } ``` #### Send Keys (tmux-style) ```json { "tool": "process", "action": "send-keys", "sessionId": "", "keys": ["Enter"] } ``` ```json { "tool": "process", "action": "send-keys", "sessionId": "", "keys": ["C-c"] } ``` ```json { "tool": "process", "action": "send-keys", "sessionId": "", "keys": ["Up", "Up", "Enter"] } ``` #### Submit (send CR only) ```json { "tool": "process", "action": "submit", "sessionId": "" } ``` #### Paste (bracketed by default) ```json { "tool": "process", "action": "paste", "sessionId": "", "text": "line1\nline2\n" } ``` ### Response #### Success Response (200) - **sessionId** (string) - The ID of the process session, used for subsequent actions like polling or sending keys. - **status** (string) - The status of the command execution. #### Response Example ```json { "sessionId": "", "status": "running" } ``` ``` -------------------------------- ### Switching OpenClaw Installation from Git to npm Source: https://docs.claw.so/engine/help/faq Instructions to switch from a git-based OpenClaw installation back to the latest npm package. This involves installing the package globally and then reconfiguring the gateway service. It does not affect user data. ```bash npm install -g openclaw@latest openclaw doctor openclaw gateway restart ``` -------------------------------- ### Install and Update OpenClaw Skills Source: https://docs.claw.so/engine/help/faq These commands demonstrate how to install new skills from ClawHub and update existing ones. Skills are installed into the local './skills' directory or a configured OpenClaw workspace. Shared skills can be placed in '~/.openclaw/skills'. ```bash clawhub install clawhub update --all ``` -------------------------------- ### Switching OpenClaw Installation from npm to Git Source: https://docs.claw.so/engine/help/faq Instructions to switch from an npm-based OpenClaw installation to a git-based one. This involves cloning the repository, installing dependencies, building the project, and reconfiguring the gateway service. It does not affect user data. ```bash git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm build openclaw doctor openclaw gateway restart ``` -------------------------------- ### Start OpenClaw Gateway with Tailnet Bind Source: https://docs.claw.so/engine/help/faq Command to start the OpenClaw gateway binding to a Tailnet IP address. Requires providing an authentication token, which is then pasted into the dashboard settings. ```bash openclaw gateway --bind tailnet --token "" ``` -------------------------------- ### Initiate BlueBubbles Onboarding via CLI Source: https://docs.claw.so/engine/channels/bluebubbles This command initiates the interactive setup wizard for onboarding the BlueBubbles channel in OpenClaw. The wizard will guide the user through providing necessary details like server URL and password. ```bash openclaw onboard ``` -------------------------------- ### CLI Setup for OpenRouter Onboarding Source: https://docs.claw.so/engine/providers/openrouter This command configures the OpenRouter CLI for onboarding using an API key. It specifies the authentication method, token provider, and the API key itself, which should be stored in the OPENROUTER_API_KEY environment variable. ```bash openclaw onboard --auth-choice apiKey --token-provider openrouter --token "$OPENROUTER_API_KEY" ``` -------------------------------- ### Config File Example Source: https://docs.claw.so/engine/providers/venice An example configuration file demonstrating how to set up the Venice provider. ```APIDOC ## Config file example ```json { env: { VENICE_API_KEY: "vapi_..." }, agents: { defaults: { model: { primary: "venice/llama-3.3-70b" } } }, models: { mode: "merge", providers: { venice: { baseUrl: "https://api.venice.ai/api/v1", apiKey: "${VENICE_API_KEY}", api: "openai-completions", models: [ { id: "llama-3.3-70b", name: "Llama 3.3 70B", reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 131072, maxTokens: 8192, }, ], }, }, }, } ``` ``` -------------------------------- ### Nix-OpenClaw Quick Start AI Prompt Source: https://docs.claw.so/engine/install/nix A prompt for AI agents to set up nix-openclaw on a Mac. It includes steps for checking Determinate Nix installation, creating a local flake, setting up a Telegram bot, configuring secrets, and verifying the installation. ```markdown I want to set up nix-openclaw on my Mac. Repository: github:openclaw/nix-openclaw What I need you to do: 1. Check if Determinate Nix is installed (if not, install it) 2. Create a local flake at ~/code/openclaw-local using templates/agent-first/flake.nix 3. Help me create a Telegram bot (@BotFather) and get my chat ID (@userinfobot) 4. Set up secrets (bot token, Anthropic key) - plain files at ~/.secrets/ is fine 5. Fill in the template placeholders and run home-manager switch 6. Verify: launchd running, bot responds to messages Reference the nix-openclaw README for module options. ``` -------------------------------- ### Install ClawHub CLI on Linux Source: https://docs.claw.so/engine/help/faq Instructions for installing the ClawHub command-line interface (CLI) on Linux systems. This tool is used for managing skills and interacting with the OpenClaw ecosystem. Choose one of the package managers provided. ```bash npm i -g clawhub ``` ```bash pnpm add -g clawhub ``` -------------------------------- ### Manage OpenClaw Gateway Service Source: https://docs.claw.so/engine/help/faq Instructions for stopping and starting the OpenClaw gateway service, differentiating between background service management and foreground execution. ```bash openclaw gateway stop openclaw gateway start ``` ```bash openclaw gateway run ``` -------------------------------- ### Setup MiniMax OAuth (Coding Plan) with Openclaw Source: https://docs.claw.so/engine/providers/minimax This snippet outlines the steps to enable and configure the MiniMax OAuth plugin for quick setup with the MiniMax Coding Plan. It requires enabling the plugin, restarting the gateway, and onboarding with the OAuth authentication choice. ```bash openclaw plugins enable minimax-portal-auth # skip if already loaded. openclaw gateway restart # restart if gateway is already running openclaw onboard --auth-choice minimax-portal ``` -------------------------------- ### Send Outbound Media Attachment Source: https://docs.claw.so/engine/start/openclaw This example demonstrates how an agent can send an outbound media attachment. The path or URL of the media should be placed on a line by itself, prefixed with 'MEDIA:'. ```text Here’s the screenshot. MEDIA:https://example.com/screenshot.png ``` -------------------------------- ### Minimal OpenClaw Configuration Source: https://docs.claw.so/engine/help/faq This is a minimal configuration for a first-time OpenClaw install. It sets the default workspace for agents and restricts incoming WhatsApp connections to a specific phone number. ```json { "agents": { "defaults": { "workspace": "~/.openclaw/workspace" } }, "channels": { "whatsapp": { "allowFrom": ["+15555550123"] } }, } ``` -------------------------------- ### Quick Install Openclaw CLI (Recommended) Source: https://docs.claw.so/engine/install Installs the Openclaw CLI using a curl command to download and execute an installation script. This is the recommended method for most users as it sets up the CLI and runs onboarding. ```shell curl -fsSL https://openclaw.ai/install.sh | bash ``` -------------------------------- ### Clone and Build OpenClaw from Source Source: https://docs.claw.so/engine/help/faq Manually clones the OpenClaw repository from GitHub, installs dependencies using pnpm, and builds the project. This provides a local, hackable version of OpenClaw. ```bash git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm build ``` -------------------------------- ### Full CLI Backend Configuration Example Source: https://docs.claw.so/engine/gateway/cli-backends This comprehensive example shows various configuration options for a custom CLI backend named 'my-cli'. It includes settings for command arguments, input/output modes, model aliasing, session handling, and system prompts. ```json { "agents": { "defaults": { "cliBackends": { "claude-cli": { "command": "/opt/homebrew/bin/claude" }, "my-cli": { "command": "my-cli", "args": ["--json"], "output": "json", "input": "arg", "modelArg": "--model", "modelAliases": { "claude-opus-4.5": "opus", "claude-sonnet-4.5": "sonnet" }, "sessionArg": "--session", "sessionMode": "existing", "sessionIdFields": ["session_id", "conversation_id"], "systemPromptArg": "--system", "systemPromptWhen": "first", "imageArg": "--image", "imageMode": "repeat", "serialize": true } } } } } ``` -------------------------------- ### Update OpenClaw to Development Channel (CLI) Source: https://docs.claw.so/engine/help/faq Updates the OpenClaw installation to the development channel, which corresponds to the latest code from the main branch. This is done via the OpenClaw command-line interface. ```bash openclaw update --channel dev ``` -------------------------------- ### Install Binaries in Dockerfile Source: https://docs.claw.so/engine/platforms/hetzner This Dockerfile snippet demonstrates how to install external binaries like gog, goplaces, and wacli at image build time. It uses `apt-get` for system dependencies and `curl` with `tar` to download and extract binaries directly into the image's PATH. This ensures that these tools are available when the container runs and persist across restarts. ```dockerfile FROM node:22-bookworm RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/* # Example binary 1: Gmail CLI RUN curl -L https://github.com/steipete/gog/releases/latest/download/gog_Linux_x86_64.tar.gz \ | tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/gog # Example binary 2: Google Places CLI RUN curl -L https://github.com/steipete/goplaces/releases/latest/download/goplaces_Linux_x86_64.tar.gz \ | tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/goplaces # Example binary 3: WhatsApp CLI RUN curl -L https://github.com/steipete/wacli/releases/latest/download/wacli_Linux_x86_64.tar.gz \ | tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/wacli # Add more binaries below using the same pattern WORKDIR /app COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./ COPY ui/package.json ./ui/package.json COPY scripts ./scripts RUN corepack enable RUN pnpm install --frozen-lockfile COPY . . RUN pnpm build RUN pnpm ui:install RUN pnpm ui:build ENV NODE_ENV=production CMD ["node","dist/index.js"] ``` -------------------------------- ### Example OpenProse File Source: https://docs.claw.so/engine/prose A simple `.prose` file demonstrating parallel agent execution for research and synthesis. It defines input, agents with specific models and prompts, parallel tasks, and a final session to merge results. ```prose # Research + synthesis with two agents running in parallel. input topic: "What should we research?" agent researcher: model: sonnet prompt: "You research thoroughly and cite sources." agent writer: model: opus prompt: "You write a concise summary." parallel: findings = session: researcher prompt: "Research {topic}." draft = session: writer prompt: "Summarize {topic}." session "Merge the findings + draft into a final answer." context: { findings, draft } ``` -------------------------------- ### OpenClaw Operational Commands Source: https://docs.claw.so/engine/start/openclaw A list of command-line interface (CLI) commands for checking the status and health of the OpenClaw service. These commands help diagnose issues and get a snapshot of the system. ```bash openclaw status openclaw status --all openclaw status --deep openclaw health --json ``` -------------------------------- ### Verify Openclaw Status and Security Source: https://docs.claw.so/engine/start/getting-started Runs a series of Openclaw CLI commands to check the current status, health, and perform a deep security audit. These commands are useful for quick verification after setup. ```bash openclaw status openclaw health openclaw security audit --deep ``` -------------------------------- ### Suggested .gitignore Starter Source: https://docs.claw.so/engine/concepts/agent-workspace A sample `.gitignore` file content to prevent common sensitive files and temporary data from being committed to the repository. Includes patterns for OS-specific files, environment variables, and key/pem files. ```gitignore .DS_Store .env **/*.key **/*.pem **/secrets* ```