OpenClaw 实用用法速查

OpenClaw 实用用法速查 OpenClaw 实用用法速查OpenClaw v2026.6.1 · 适用于日常开发运维一、常用状态查看# 总览Gateway 运行状态、当前模型、会话信息、上下文用量openclaw status# 只看当前会话详情模型、Token、上下文比例等openclaw session status# 实时查看 Gateway 日志看机器人执行过程journalctl-uopenclaw-f--no-hostname-ocat# 或 tail 日志文件tail-f~/.openclaw/logs/*.log二、模型相关# 查看当前默认模型及 Provider 状态openclaw models status# 切换默认模型openclaw modelssetmodel-name# 切换图片模型openclaw models set-imagemodel-name# 管理模型别名方便用简短名称调用不同模型openclaw models aliases# 设置模型 fallback主模型不可用时自动降级openclaw models fallbacks三、技能Skills管理# 列出所有已安装技能含状态ready/disabledopenclaw skills list# 查看某个技能的详细信息触发条件、用法openclaw skills infoskill-name# 检查技能依赖是否满足openclaw skills check# 从本地目录安装技能openclaw skillsinstall/path/to/skill-dir# 从本地目录安装并指定 slug 别名openclaw skillsinstall--asalias/path/to/skill-dir# 强制覆盖安装更新已存在的技能openclaw skillsinstall--force/path/to/skill-dir# 搜索 ClawHub 上的公开技能openclaw skills searchkeyword# 更新 ClawHub 安装的技能openclaw skills update四、频道Channels配置# 列出已配置的聊天频道openclaw channels list# 查看频道连接状态openclaw channels status# 添加频道交互式引导openclaw channelsadd# 非交互式添加飞书频道openclaw channelsadd--channelfeishu --app-idxxx--app-secretxxx# 查看频道日志openclaw channels logs# 列出频道 capabilities支持的功能openclaw channels capabilities# 登录/登出频道openclaw channels login--channelwhatsapp openclaw channelslogout--channeltelegram# 删除频道openclaw channels remove五、配置管理# 查看当前配置文件路径openclaw configfile# 读取某个配置项openclaw config get gateway.port openclaw config get agents.defaults.model# 设置配置项openclaw configsetgateway.port19001# 批量修改配置JSON5 文件openclaw config patch--file./patch.json5# 删除配置项openclaw configunsetgateway.port# 校验配置文件是否有语法错误openclaw config validate# 查看完整配置 schemaopenclaw config schema六、Gateway 管理# 启动 Gateway前台openclaw gateway run# 强制启动杀掉已占用的端口openclaw gateway run--force# 查看 Gateway 服务状态openclaw gateway status# 查看 Gateway 健康状态openclaw gateway health# 重启 Gateway 服务systemdopenclaw gateway restart# 停止 Gateway 服务openclaw gateway stop# 发现局域网内其他 Gatewayopenclaw gateway discover# 查看 Gateway 稳定性诊断openclaw gateway stability# 查看用量/费用openclaw gateway usage-cost七、Cron 定时任务# 列出所有定时任务openclawcronlist# 添加定时任务交互式openclawcronadd# 查看某个任务详情openclawcronshowjob-id# 立即触发某个任务调试用openclawcronrunjob-id# 查看任务执行历史openclawcronrunsjob-id# 启用/禁用任务openclawcronenablejob-idopenclawcrondisablejob-id# 编辑任务openclawcroneditjob-id# 删除任务openclawcronrmjob-id八、Memory 记忆管理# 查看记忆索引状态openclaw memory status# 搜索记忆内容openclaw memory search关键词# 限制搜索结果数量openclaw memory search--query部署--max-results20# 重新索引记忆文件openclaw memory index--force# 查看短期记忆晋升候选将重要内容写入长期记忆openclaw memory promote--limit10--min-score0.75# 执行晋升将候选写入 MEMORY.mdopenclaw memory promote--apply九、会话Sessions管理# 列出所有会话openclaw sessions list# 仅查看最近活跃会话openclaw sessions--active120# 查看某个会话详情Token 用量等openclaw sessions showsession-id# 只显示最新的 N 条会话openclaw sessions--limit20# 导出会话轨迹用于调试/分享openclaw sessions export-trajectorysession-id# 实时跟踪当前会话进度openclaw sessionstail# 清理过期会话openclaw sessions cleanup十、诊断与修复# 运行健康检查只检查不修复openclaw doctor--lint# 检查并自动修复openclaw doctor--fix# 深度检查扫描 systemd 服务等openclaw doctor--deep--fix# 升级后检查插件兼容性openclaw doctor --post-upgrade# 检查并审计密钥配置openclaw secrets audit# 重新加载密钥修改后热生效openclaw secrets reload# 查看后台任务状态openclaw tasks list# 取消卡住的任务openclaw tasks canceltask-id十一、其他常用# 查看版本openclaw--version# 交互式首次设置openclaw setup openclaw onboard# 打开 TUI 终端界面openclaw tui# 发起一次 Agent 调用API 风格openclaw agent--to15555550123--message帮我查天气--deliver# 发送消息通过频道openclaw message send--channeltelegram--targetmychat--message你好# 更新 OpenClawopenclaw update# 查看 MCP 配置openclaw mcp# 查看插件列表openclaw plugins list# 查看 API 调用日志调试openclaw channels logs十二、快速定位问题症状排查命令机器人不回复openclaw statusopenclaw doctor --lint模型调用失败openclaw models status频道消息收不到openclaw channels status --probe技能不执行openclaw skills check定时任务没跑openclaw cron listopenclaw cron runs id配置改坏了openclaw config validateGateway 起不来openclaw gateway statusjournalctl -u openclaw -n 50内存泄漏/高负载openclaw gateway stability提示大部分命令支持--help查看详细用法例如openclaw cron add --help。{claudeCode.environmentVariables:[{name:ANTHROPIC_AUTH_TOKEN,value:sk-siuU4kTfpTTBf},{name:ANTHROPIC_BASE_URL,value:https://llm..com},{name:ANTHROPIC_API_KEY,value:},{name:ANTHROPIC_MODEL,value:ts-deepseek-v4-flash}],claudeCode.preferredLocation:panel,git.openRepositoryInParentFolders:never,extensions.ignoreRecommendations:true,window.confirmSaveUntitledWorkspace:false,remote.autoForwardPortsSource:hybrid,workbench.editor.tabSizing:shrink,workbench.editor.wrapTabs:true}