OpenClaw Cheat Sheet

Quick reference for commands and configuration

Installation & Setup

npm install -g openclaw Install OpenClaw globally via npm
npx openclaw init Initialize new OpenClaw project
openclaw --version Check installed version
openclaw update Update to latest version
openclaw doctor Run diagnostics check
npm uninstall -g openclaw Uninstall OpenClaw

Running OpenClaw

openclaw start Start the gateway
openclaw start --verbose Start with debug output
openclaw dev Development mode (hot reload)
openclaw stop Stop the gateway
openclaw restart Restart the gateway
openclaw status Check gateway status

Configuration Files

gateway.yaml Main config file (YAML format)
gateway.json Alternative JSON config
openclaw.config.yaml Project-level config
.env Environment variables file

CLI Flags

-c, --config Specify config file path
-p, --port Set port number
-v, --verbose Enable verbose logging
-h, --help Show help message
--dry-run Test without executing

Channel Commands

openclaw connect discord Connect Discord channel
openclaw connect whatsapp Connect WhatsApp (QR auth)
openclaw connect telegram Connect Telegram bot
openclaw connect slack Connect Slack workspace
openclaw connect signal Connect Signal
openclaw channels list List connected channels
openclaw channel remove discord Remove a channel

Skills Management

openclaw install @skill-name Install a skill
openclaw uninstall skill-name Remove a skill
openclaw skills list List installed skills
openclaw skills search "keyword" Search for skills
openclaw skill enable skill-name Enable a skill
openclaw skill disable skill-name Disable a skill

Configuration: Model

# Basic model config
model: "openai/gpt-4o"

# With custom settings
model: "anthropic/claude-3-5-sonnet-20241022"
modelSettings:
  temperature: 0.7
  maxTokens: 4096
  topP: 0.9

# Using local Ollama
model: "ollama/llama3"

# Using OpenRouter (many models)
model: "openrouter/anthropic/claude-3.5-sonnet"

Configuration: Channels

channels:
  discord:
    enabled: true
    token: "${DISCORD_BOT_TOKEN}"
    channels:
      - "general"
      - "help"
  
  whatsapp:
    enabled: true
    sessionFile: "./whatsapp-session.json"
  
  telegram:
    enabled: true
    botToken: "${TELEGRAM_BOT_TOKEN}"
    allowedUsers:
      - user_id_1
      - user_id_2

Configuration: Memory

memory:
  enabled: true
  provider: "pinecone"
  apiKey: "${PINECONE_API_KEY}"
  environment: "us-west1-gcp"
  index: "openclaw-memory"
  
  # What to remember
  rememberChannels: true
  rememberUsers: true
  maxHistoryPerChannel: 100
  
  # Auto-forget settings
  forgetAfter: "30d"  # 30 days
  semanticSearch: true
  similarityThreshold: 0.75

Configuration: Voice

voice:
  enabled: true
  provider: "elevenlabs"
  apiKey: "${ELEVENLABS_API_KEY}"
  voiceId: "rachel"  # or custom voice
  
  # Speech-to-text
  sttProvider: "deepgram"
  sttApiKey: "${DEEPGRAM_API_KEY}"
  
  # Audio settings
  language: "en"
  autoRespond: false  # require user to start

Configuration: Cron Jobs

cron:
  - name: "daily-briefing"
    enabled: true
    schedule: "0 8 * * *"  # 8 AM daily
    action:
      type: "message"
      channel: "discord"
      content: "Good morning! Here's your daily update..."
  
  - name: "weekly-report"
    schedule: "0 18 * * fri"  # Friday 6 PM
    action:
      type: "message"
      channel: "slack"
      content: "Weekly report ready!"
  
  - name: "hourly-check"
    schedule: "0 * * * *"  # Every hour

Cron Schedule Formats

* * * * * Every minute
0 * * * * Every hour
0 0 * * * Daily at midnight
0 9 * * * Daily at 9 AM
0 9 * * 1-5 Weekdays at 9 AM
0 9 * * 0 Every Sunday at 9 AM
*/15 * * * * Every 15 minutes
0 */2 * * * Every 2 hours

Environment Variables

OPENCLAW_API_KEY Default API key
OPENCLAW_MODEL Default model
OPENCLAW_LOG_LEVEL Debug, info, warn, error
OPENCLAW_PORT Gateway port
OPENCLAW_CONFIG Config file path

Docker Commands

docker run -it openclaw/openclaw Run in Docker (interactive)
docker run -d openclaw/openclaw Run in background (detached)
docker run -v ./config:/app openclaw/openclaw Mount config folder
docker run -p 3000:3000 openclaw/openclaw Map ports
docker-compose up -d Run with docker-compose
docker-compose logs -f View logs
docker-compose restart Restart containers

Docker Compose Example

version: '3.8'
services:
  openclaw:
    image: openclaw/openclaw
    container_name: openclaw
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - ./gateway.yaml:/app/gateway.yaml
      - ./data:/app/data
    environment:
      - OPENCLAW_API_KEY=${OPENCLAW_API_KEY}
      - OPENCLAW_LOG_LEVEL=info
    networks:
      - openclaw-net

networks:
  openclaw-net:

Gateway.yaml Full Example

name: "my-openclaw"
version: "1.0"

# Model configuration
model: "openai/gpt-4o"
modelSettings:
  temperature: 0.7
  maxTokens: 4096

# Channels
channels:
  discord:
    enabled: true
    token: "${DISCORD_TOKEN}"
  whatsapp:
    enabled: false
  telegram:
    enabled: false

# Skills
skills:
  enabled:
    - browser
    - files
    - memory

# Memory
memory:
  enabled: true
  provider: "pinecone"
  apiKey: "${PINECONE_KEY}"

# Voice
voice:
  enabled: false

# System prompt
systemPrompt: |
  You are OpenClaw, a helpful AI assistant.
  Be concise and friendly.

# Cron jobs
cron:
  - name: "morning"
    enabled: false
    schedule: "0 9 * * *"

Systemd Service (Linux)

# /etc/systemd/system/openclaw.service
[Unit]
Description=OpenClaw AI Agent
After=network.target

[Service]
Type=simple
User=openclaw
WorkingDirectory=/opt/openclaw
ExecStart=/usr/bin/openclaw start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

PM2 Process Manager

pm2 start openclaw Start with PM2
pm2 list List processes
pm2 logs openclaw View logs
pm2 restart openclaw Restart
pm2 save Save process list
pm2 startup Generate startup script

API Endpoints

GET /health Health check
POST /message Send message
GET /channels List channels
GET /sessions List sessions

Common Errors Quick Fix

# Port in use
lsof -i :3000
kill -9 [PID]

# Clear memory
rm -rf ./data/memory/*

# Reset WhatsApp
rm ./whatsapp-session.json
openclaw connect whatsapp --reset

# Clear cache
npm cache clean --force

# Validate config
openclaw config validate

Keyboard Shortcuts (Interactive)

Ctrl+C Stop OpenClaw
Ctrl+L Clear terminal
Ctrl+Z Background process

File Locations

~/.openclaw/ Default config directory
~/.openclaw/gateway.yaml Default config file
~/.npm-global/lib/node_modules/openclaw/ Installation directory

Testing & Debugging

openclaw test Run tests
openclaw doctor System diagnostics
OPENCLAW_LOG_LEVEL=debug openclaw start Debug logging

Related Resources