“一图胜前言,大家养虾摸鱼的时候可以用到~
OpenClaw Mega Cheatsheet 命令速查表⌨️ 核心CLI命令 (Core CLI Commands) openclaw gateway--portopenclaw gateway start|stop|restart管理Gateway服务 (launchd/systemd) openclaw channels loginopenclaw channels add添加Telegram/Discord/Slack机器人 --tokenopenclaw channels status --probeopenclaw onboard--install-daemonopenclaw doctor--deepopenclaw config get|set|unsetopenclaw models list|set|statusopenclaw models auth setup-tokenopenclaw models fallbacks add|removeopenclaw memory status|index|searchopenclaw Agents list|add|deleteopenclaw logs --followopenclaw status --all --deep--usageopenclaw sessions --jsonopenclaw security audit--fixopenclaw browser start|tabs|screenshotopenclaw cron list|add|runopenclaw pairing list|approveopenclaw reset --scope重置 config/creds/sessions/full
🚩 全局标志 (Global Flags) --dev在 ~/.openclaw-dev 下隔离状态,切换端口 --profile <name>--no-color--updateopenclaw update-V
🛠️ 高级命令 (Power Commands) openclaw plugins list|enable|disableopenclaw approvals get|set|allowlistopenclaw sandbox list|recreate|explainopenclaw system event --text "X"openclaw system heartbeat enable|disable|lastopenclaw update status|wizardopenclaw nodes list|pending|approveopenclaw devices list|approve|rotate|revokeopenclaw directory peers|groups listopenclaw health --json --verboseopenclaw dashboardopenclaw tui --url --token
⚠️ 命令注意事项 (Command Gotchas) models status --probechannels status --probe使用 status --deep 进行完整的gateway级诊断 security audit --fix--update
💬 频道设置 (Channel Setup) openclaw channels loginchannels add --channel telegram --token $TOKENchannels add --channel discord --token $TOKENchannels add --channel slackchannels add --channel googlechatchannels add --channel signalchannels add --channel msteams
快速诊断:
状态: openclaw channels status --probe 日志: openclaw channels logs --channel [id] 📁 工作区文件 (Workspace Files) 根目录: ~/.openclaw/workspace
🧠 记忆系统 (Memory System) 每日日志 memory/YYYY-MM-DD.md长期记忆 MEMORY.md向量搜索 memory_search 工具 - 对记忆块进行语义搜索 (~400 tokens) 提供商 memorySearch.provider - 自动选择: local GGUF → OpenAI → Gemini → Voyage QMD后端 memory.backend = "qmd"混合搜索 0.7/0.3 默认权重 - 向量相似度 + BM25关键词相关性
命令:
openclaw memory index --allopenclaw memory search "X"🤖 模型与认证 (Models & Auth) openclaw models list --allopenclaw models set <model>设置 agents.defaults.model.primary openclaw models set-image <model>openclaw models fallbacks add <model>openclaw models auth setup-tokenAnthropic首选认证 (setup-token) openclaw models auth add --provider <p>openclaw models status --probeopenclaw models aliases add <a> <m>
故障转移与冷却时间 🔐 会话配置 (Sessions) session.dmScopemain (默认) | per-peer | per-channel-peer | per-account-channel-peer session.reset.modedaily (默认, 凌晨4点本地时间) | idle session.reset.idleMinutessession.resetByType覆盖 dm, group, thread 会话策略 session.resetByChannelsession.identityLinkssession.sendPolicysession.store~/.openclaw/agents/{agentId}/sessions/sessions.json
“⚠️ 安全提示: 多用户收件箱请使用 per-channel-peer 防止上下文泄露
⚡ 斜杠命令 (Slash Commands) /status会话健康 + 上下文使用 + WhatsApp凭证 /context list/context detail/model <model>/compact [instructions]/new [model]/reset/new/stop/send on|off|inherit/tts on|off/think/config/debug仅运行时配置覆盖 (需要 commands.debug: true)
🔊 文字转语音 (Text-to-Speech) 启用自动TTS:
messages.tts.auto: "always"📊 日志与诊断 (Logging & Diagnostics) openclaw logs --followopenclaw logs --jsonopenclaw logs --limit 200openclaw channels logs --channel whatsapp
OTel导出配置:
"diagnostics": { "otel": { "enabled": true } }🌐 浏览器与定时任务 (Browser & Cron) 浏览器操作 openclaw browser start|stopopenclaw browser tabsopenclaw browser open <url>openclaw browser screenshotopenclaw browser navigate <url>openclaw browser click|type|pressopenclaw browser evaluate <js>openclaw browser pdf
定时任务 openclaw cron listopenclaw cron addopenclaw cron edit <id>openclaw cron enable|disable <id>openclaw cron run <id>openclaw cron runs
🔗 钩子与自动化 (Hooks & Automation) 内置钩子 钩子命令 openclaw hooks listopenclaw hooks enable <name>openclaw hooks disable <name>openclaw hooks info <name>openclaw hooks check
事件类型 command:newcommand:resetcommand:stopgateway:startupagent:bootstrap
🧩 技能系统 (Skills System) 技能优先级 <workspace>/skills/~/.openclaw/skills/
ClawHub注册表 clawhub install <slug>clawhub update --allclawhub sync --all
SKILL.md格式 --- name: my-skill description: "What this skill does" metadata: openclaw: requires: {...} ---👥 多代理路由 (Multi-Agent Routing) 隔离工作区 每个代理有自己的 AGENTS.md, SOUL.md, USER.md 每代理认证 会话存储 聊天记录在 ~/.openclaw/agents/<id>/sessions 绑定
路由优先级 命令:
openclaw agents add <name>openclaw agents list --bindings💓 心跳系统 (Heartbeat System) heartbeat.every间隔 (默认: 30m, Anthropic OAuth为1h) heartbeat.targetlast | none | <channel id> heartbeat.toheartbeat.modelheartbeat.promptheartbeat.activeHours限制到时间窗口 (start/end/timezone)
“📋 契约: 如果没有需要关注的事项,回复 HEARTBEAT_OK。代理会删除仅包含OK的回复。
HEARTBEAT.md示例 # Heartbeat checklist - Quick scan: anything urgent? - Daytime: lightweight check-in - Blocked? Note what's missing🔐 沙箱配置 (Sandboxing) sandbox.mode sandbox.scope workspaceAccess 设置镜像: scripts/sandbox-setup.sh默认镜像: openclaw-sandbox:bookworm-slim
🎯 子代理 (Sub-Agents) 子代理命令 /subagents list/subagents stop <id|#|all>/subagents log <id|#>/subagents info <id|#>/subagents send <id|#> <msg>
sessions_spawn工具 { "task": "...", "label": "...", "model": "...", "thinking": "...", "runTimeoutSeconds": "...", "cleanup": "..." }返回: { status, runId, childSessionKey }
🔧 故障排除 (Troubleshooting) openclaw pairing list检查 mentionPatterns 配置 (代理需要 @提及) openclaw models auth setup-token --provider anthropicopenclaw doctor --deepopenclaw memory index/compactopenclaw channels status --probeopenclaw reset --scope sessions通用修复命令 openclaw doctor --deep --yes
📂 关键路径 (Key Paths) ~/.openclaw/openclaw.json~/.openclaw/workspace/~/.openclaw/agents/<id>/~/.openclaw/agents/<id>/sessions/~/.openclaw/credentials/~/.openclaw/memory/<agentId>.sqlite/tmp/openclaw/openclaw-YYYY-MM-DD.log
“💡 提示: 使用 --dev 或 --profile <name> 在不同目录下隔离状态。
🚀 快速开始 (Quick Start) 全局安装 npm install -g openclaw@latest引导设置 # 1. 引导设置 openclaw onboard --install-daemon # 2. 频道链接 openclaw channels login # 3. 启动Gateway openclaw gateway --port 18789Onboard标志 --mode local--mode remote--flow quickstart--skip-channels
立即咨询 JOTO JOTO 提供覆盖企业智能体规划与搭建、AI 平台私有化部署、RAG 知识工程、AI 安全治理、FDE 驻场共创及持续运营优化的全周期 AI 落地服务,帮助企业把验证中的 AI 能力转化为安全、可控、可持续迭代的生产力。 联系 JOTO 获取 AI 落地咨询