Deploy and manage OpenClaw, a self-hosted gateway bridging messaging platforms to AI coding agents. Use when a user asks to set up OpenClaw, connect WhatsApp or Telegram or Discord to an AI agent, configure multi-agent routing, schedule cron jobs in OpenClaw, set up webhooks, manage OpenClaw channels, pair a messaging account, configure heartbeats, spawn sub-agents, or troubleshoot OpenClaw gateway issues. Covers installation, channel setup, agent configuration, cron scheduling, webhooks, and sub-agents.
Manage OpenClaw, an open-source self-hosted gateway that connects messaging platforms (WhatsApp, Telegram, Discord, Slack, Signal, iMessage) to AI coding agents. Covers the full lifecycle from installation through multi-agent routing, cron scheduling, webhooks, and sub-agent orchestration. Configuration lives at ~/.openclaw/openclaw.json.
When a user asks for help with OpenClaw, determine which task they need:
# Install globally
npm install -g openclaw@latest
# Interactive onboarding (creates config, pairs first channel, starts gateway)
openclaw onboard --install-daemon
# Or manual setup
openclaw channels login # Scan QR to pair WhatsApp
openclaw gateway --port 18789 # Start the gateway
The Control UI is accessible at http://127.0.0.1:18789/ after the gateway starts.
Edit ~/.openclaw/openclaw.json to enable channels. Each channel has dmPolicy (pairing, allowlist, open, disabled) and groupPolicy (open, allowlist, disabled).
WhatsApp:
{ channels: { whatsapp: { enabled: true, allowFrom: ["+15555550123"], groups: { "*": { requireMention: true } } } } }
Telegram:
{ channels: { telegram: {
enabled: true, token: "BOT_TOKEN", dmPolicy: "pairing", groupPolicy: "allowlist",
allowedGroups: { "-100123456789": { allowedUsers: ["987654321"] } }
} } }
Discord:
{ channels: { discord: {
enabled: true, token: "BOT_TOKEN", groupPolicy: "allowlist",
guilds: { "123456789012345678": { requireMention: true, users: ["987654321098765432"], channels: { "general": { allow: true } } } }
} } }
Verify connectivity with openclaw channels status --probe.
Define multiple agents in agents.list. Each agent gets an isolated workspace, session store, and tool access.
{
agents: {
list: [
{ id: "alfred", name: "Alfred", workspace: "~/.openclaw/workspace-alfred", default: true },
{ id: "support", name: "Support Agent", workspace: "~/agents/support" }
],
defaults: {
model: { provider: "anthropic", name: "claude-sonnet-4-20250514" },
thinking: "off",
heartbeat: { every: "30m", activeHours: { start: "08:00", end: "22:00", timezone: "America/New_York" } }
}
}
}
Route messages to agents using bindings (evaluated in priority order):
{
bindings: [
{ match: { channel: "whatsapp", peer: { kind: "group", id: "120363403215116621@g.us" } }, agentId: "support" },
{ match: { channel: "telegram", peer: { kind: "group", id: "-100123" } }, agentId: "alfred" },
{ match: { channel: "discord", guildId: "123456789012345678", roles: ["111111111111111111"] }, agentId: "alfred" }
]
}
CLI commands: openclaw agents list, openclaw agents info <id>, openclaw agents create.
Cron runs inside the gateway and persists jobs at ~/.openclaw/cron/. Enable with "cron": { "enabled": true }.
# One-shot reminder (UTC, auto-deletes after run)
openclaw cron add --name "Reminder" --at "2026-02-15T16:00:00Z" \
--session main --system-event "Check project deadlines" --wake now --delete-after-run
# Recurring isolated job with delivery to WhatsApp
openclaw cron add --name "Morning brief" --cron "0 7 * * *" \
--tz "America/Los_Angeles" --session isolated \
--message "Summarize overnight updates" \
--announce --channel whatsapp --to "+15551234567"
# Manage jobs
openclaw cron list
openclaw cron run <job-id> # Run immediately
openclaw cron runs --id <job-id> # View run history
openclaw cron edit <job-id> --message "Updated prompt"
Schedule types: at (one-shot), every (fixed interval), cron (5-field expression with timezone).
Enable webhook ingestion for external triggers:
{
hooks: {
enabled: true,
token: "SHARED_SECRET",
path: "/hooks",
allowedAgentIds: ["hooks", "main"]
}
}
Endpoints:
POST /hooks/wake — enqueue a system event: {"text": "description", "mode": "now"}POST /hooks/agent — isolated agent run: {"message": "task", "deliver": true, "channel": "slack", "to": "channel:C123"}POST /hooks/<name> — custom mapped endpoints via hooks.mappingsAuthenticate with Authorization: Bearer <token> header.
Sub-agents run background tasks in isolated sessions. No configuration needed for defaults.
{
agents: {
defaults: {
subagents: {
model: "minimax/MiniMax-M2.1",
thinking: "low",
maxConcurrent: 4,
archiveAfterMinutes: 120
}
}
}
}
Spawn by telling the agent: "Spawn a sub-agent to research the latest Node.js release notes."
Manage with /subagents list, /subagents stop <id>, /subagents log <id>.
openclaw status # Local creds and sessions
openclaw status --deep # Gateway health checks
openclaw gateway status # Gateway process info
openclaw logs --follow # Stream gateway logs
openclaw doctor # Diagnose common issues
openclaw channels status --probe # Test channel connectivity
Workspace files: IDENTITY.md (personality), SOUL.md (memory), HEARTBEAT.md (periodic tasks), TOOLS.md (tool access), AGENTS.md (subagent allowlist).
User request: "Set up OpenClaw as a personal assistant on WhatsApp with periodic check-ins"
$ npm install -g openclaw@latest
$ openclaw channels login # Scan QR with assistant's phone
Config (~/.openclaw/openclaw.json):
{
agent: {
model: "anthropic/claude-sonnet-4-20250514",
workspace: "~/.openclaw/workspace",
heartbeat: { every: "30m", activeHours: { start: "08:00", end: "22:00", timezone: "America/New_York" } }
},
channels: { whatsapp: { allowFrom: ["+15555550123"], groups: { "*": { requireMention: true } } } },
session: { scope: "per-sender", reset: { mode: "daily", atHour: 4, idleMinutes: 10080 } }
}
$ openclaw gateway --port 18789
Gateway started on http://127.0.0.1:18789/
# Agent now responds via WhatsApp and runs heartbeat checks every 30 min
User request: "Set up two agents — one for code review in Discord, one for daily standup via Telegram"
Config:
{
agents: { list: [
{ id: "reviewer", name: "Code Reviewer", workspace: "~/agents/reviewer", default: true },
{ id: "standup", name: "Standup Bot", workspace: "~/agents/standup" }
] },
bindings: [
{ match: { channel: "discord", guildId: "123456789012345678" }, agentId: "reviewer" },
{ match: { channel: "telegram", peer: { kind: "group", id: "-1001234567890" } }, agentId: "standup" }
],
channels: {
discord: { enabled: true, token: "DISCORD_BOT_TOKEN", guilds: { "123456789012345678": { requireMention: true } } },
telegram: { enabled: true, token: "TELEGRAM_BOT_TOKEN", groupPolicy: "allowlist", allowedGroups: { "-1001234567890": {} } }
},
cron: { enabled: true }
}
$ openclaw cron add --name "Daily standup" --cron "0 9 * * 1-5" \
--tz "America/New_York" --session isolated \
--message "Compile yesterday's commits and open PRs into a standup summary" \
--announce --channel telegram --to "group:-1001234567890"
Cron job created: job-abc123
User request: "Send me a WhatsApp message whenever my CI pipeline finishes"
Config addition:
{
hooks: {
enabled: true, token: "ci-webhook-secret-2024",
mappings: [{ match: { path: "ci-notify" }, action: "agent", deliver: true, channel: "whatsapp", to: "+15555550123" }]
}
}
GitHub Actions step:
- name: Notify via OpenClaw
run: |
curl -X POST "https://openclaw.example.com/hooks/ci-notify" \
-H "Authorization: Bearer ${{ secrets.OPENCLAW_HOOK_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"message": "Deploy of ${{ github.repository }} completed (${{ job.status }})"}'
allowFrom on WhatsApp to restrict who can message the agent.heartbeat.every: "0m" (disabled) until you trust the setup, then increase to "30m".agent:<agentId>:<channel>:<kind>:<id>. Use dmScope: "per-channel-peer" for multi-user setups.--tz use the gateway host's timezone. Always specify --tz for predictable scheduling.maxConcurrent to control resource usage.openclaw doctor and openclaw logs --follow to identify issues quickly.npx skills add TerminalSkills/openclaw下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer