这份速查手册详细介绍了OpenClaw中文汉化版2026.4.1-zh.2及以上的命令使用方法,涵盖了终端CLI操作、聊天斜杠指令、实用技巧与常见问题解决等内容,帮助用户高效操作和维护该软件
适用版本:OpenClaw 中文汉化版 v2026.4.1-zh.2 及以上
命令前缀说明:
- 终端命令:使用
openclaw-cn(汉化版专属命令,官方版为 openclaw) - 聊天斜杠指令:在Web控制台/微信/钉钉/飞书聊天窗口直接输入,以
/ 开头
第一部分:终端 CLI 操作命令大全
基础全局命令
| 命令 | 说明 | 示例 |
|---|
openclaw-cn --version | 查看当前版本号 | openclaw-cn --version |
openclaw-cn --help | 查看所有命令帮助 | openclaw-cn --help |
openclaw-cn <command> --help | 查看指定命令的详细帮助 | openclaw-cn gateway --help |
openclaw-cn tui | 启动终端图形交互界面(新手友好) | openclaw-cn tui |
openclaw-cn dashboard | 自动打开浏览器访问Web控制台 | openclaw-cn dashboard |
openclaw-cn docs <query> | 内置文档搜索 | openclaw-cn docs "微信接入" |
全局通用标志:
--json:输出JSON格式,适合脚本调用--verbose:显示详细日志--dev:开发模式,状态隔离到 ~/.openclaw-dev--profile <name>:多实例隔离,状态存储在 ~/.openclaw-<name>
安装与初始化
| 命令 | 说明 | 示例 |
|---|
openclaw-cn onboard | 启动交互式初始化配置向导 | openclaw-cn onboard |
openclaw-cn onboard --install-daemon | 初始化并安装系统后台服务(开机自启) | openclaw-cn onboard --install-daemon |
openclaw-cn configure | 重新进入配置向导 | openclaw-cn configure |
openclaw-cn update | 一键更新到最新稳定版 | openclaw-cn update |
openclaw-cn update --nightly | 更新到每日构建版 | openclaw-cn update --nightly |
openclaw-cn uninstall --all --yes | 彻底卸载,删除所有数据 | openclaw-cn uninstall --all --yes |
网关服务管理(核心)
| 命令 | 说明 | 示例 |
|---|
openclaw-cn gateway run | 前台启动网关服务(调试用) | openclaw-cn gateway run |
openclaw-cn gateway start | 后台启动网关服务 | openclaw-cn gateway start |
openclaw-cn gateway stop | 停止网关服务 | openclaw-cn gateway stop |
openclaw-cn gateway restart | 重启网关服务(配置修改后必用) | openclaw-cn gateway restart |
openclaw-cn gateway status | 查看网关运行状态、端口占用、链路健康度 | openclaw-cn gateway status |
openclaw-cn gateway install | 注册网关为系统服务,实现开机自启 | openclaw-cn gateway install |
openclaw-cn gateway uninstall | 卸载系统服务 | openclaw-cn gateway uninstall |
openclaw-cn gateway probe | 深度探测网关连通性,排查网络拦截问题 | openclaw-cn gateway probe |
配置管理
| 命令 | 说明 | 示例 |
|---|
openclaw-cn config show | 查看当前完整配置 | openclaw-cn config show |
openclaw-cn config get <key> | 查询指定配置项的值 | openclaw-cn config get language |
openclaw-cn config set <key> <value> | 快速修改单条配置 | openclaw-cn config set language zh-CN |
openclaw-cn config edit | 调用系统编辑器修改配置文件 | openclaw-cn config edit |
openclaw-cn config validate | 校验配置文件语法与合法性 | openclaw-cn config validate |
openclaw-cn config reset | 重置为默认配置(会覆盖所有修改) | openclaw-cn config reset |
模型管理
| 命令 | 说明 | 示例 |
|---|
openclaw-cn models list | 列出所有已配置的模型 | openclaw-cn models list |
openclaw-cn models set <model-name> | 设置默认使用的模型 | openclaw-cn models set claude-4-sonnet-20260301 |
openclaw-cn models add <provider> <api-key> | 添加新的模型提供商 | openclaw-cn models add openai sk-xxx |
openclaw-cn models remove <model-name> | 删除指定模型 | openclaw-cn models remove gpt-3.5-turbo |
openclaw-cn models status | 查看所有模型的连接状态 | openclaw-cn models status |
openclaw-cn models scan | 自动扫描本地Ollama模型 | openclaw-cn models scan |
openclaw-cn models usage | 查看模型API用量和剩余配额 | openclaw-cn models usage |
技能与插件管理
| 命令 | 说明 | 示例 |
|---|
openclaw-cn skills list | 列出所有已安装的技能 | openclaw-cn skills list |
openclaw-cn skills install <skill-name> | 从ClawHub安装技能 | openclaw-cn skills install pdf-processor |
openclaw-cn skills install <local-path> | 从本地目录安装技能 | openclaw-cn skills install ./my-skill |
openclaw-cn skills update <skill-name> | 更新指定技能 | openclaw-cn skills update pdf-processor |
openclaw-cn skills update --all | 更新所有已安装的技能 | openclaw-cn skills update --all |
openclaw-cn skills uninstall <skill-name> | 卸载指定技能 | openclaw-cn skills uninstall pdf-processor |
openclaw-cn plugins list | 列出所有已安装的插件 | openclaw-cn plugins list |
openclaw-cn plugins install <plugin-name> | 安装插件 | openclaw-cn plugins install vscode-bridge |
渠道平台管理(微信/钉钉/飞书)
| 命令 | 说明 | 示例 |
|---|
openclaw-cn channels list | 列出所有已配置的聊天渠道 | openclaw-cn channels list |
openclaw-cn channels add --channel <name> | 添加新的聊天渠道 | openclaw-cn channels add --channel wechat |
openclaw-cn channels remove --channel <name> | 删除指定渠道 | openclaw-cn channels remove --channel telegram |
openclaw-cn channels status | 查看所有渠道的连接状态 | openclaw-cn channels status |
openclaw-cn channels logs --channel <name> | 查看指定渠道的日志 | openclaw-cn channels logs --channel dingtalk |
openclaw-cn message send --channel <name> --target <id> --message <text> | 发送消息 | openclaw-cn message send --channel wechat --target "张三" --message "你好" |
Agent 与会话管理
| 命令 | 说明 | 示例 |
|---|
openclaw-cn agents list | 列出所有已创建的Agent | openclaw-cn agents list |
openclaw-cn agents add <name> --workspace <path> | 创建新的Agent | openclaw-cn agents add work --workspace ~/projects |
openclaw-cn agents delete <id> --force | 删除指定Agent | openclaw-cn agents delete 1 --force |
openclaw-cn agent --message <text> | 向默认Agent发送消息 | openclaw-cn agent --message "列出当前目录文件" |
openclaw-cn sessions list | 列出所有会话 | openclaw-cn sessions list |
openclaw-cn sessions delete <id> | 删除指定会话 | openclaw-cn sessions delete 1 |
openclaw-cn sessions export <id> --format markdown | 导出会话为Markdown文件 | openclaw-cn sessions export 1 --format markdown |
数据与记忆管理
| 命令 | 说明 | 示例 |
|---|
openclaw-cn memory status | 查看记忆系统状态 | openclaw-cn memory status |
openclaw-cn memory index | 重建向量索引(修复记忆Bug必用) | openclaw-cn memory index |
openclaw-cn memory search "<query>" | 向量搜索长期记忆 | openclaw-cn memory search "Python" |
openclaw-cn memory clear | 清除所有长期记忆 | openclaw-cn memory clear |
openclaw-cn directory add <path> | 添加目录到文件访问白名单 | openclaw-cn directory add ~/Documents |
openclaw-cn directory list | 列出所有允许访问的目录 | openclaw-cn directory list |
诊断与维护(遇到问题先执行这些)
| 命令 | 说明 | 示例 |
|---|
openclaw-cn doctor | 全面健康检查(配置、端口、依赖) | openclaw-cn doctor |
openclaw-cn doctor --fix | 健康检查+自动修复常见错误 | openclaw-cn doctor --fix |
openclaw-cn status --all | 完整系统状态诊断 | openclaw-cn status --all |
openclaw-cn status --deep | 深度探测所有组件状态 | openclaw-cn status --deep |
openclaw-cn logs | 查看最近100行日志 | openclaw-cn logs |
openclaw-cn logs --follow | 实时查看日志(排查问题必备) | openclaw-cn logs --follow |
openclaw-cn logs --level error | 只查看错误日志 | openclaw-cn logs --level error |
备份与恢复
| 命令 | 说明 | 示例 |
|---|
openclaw-cn backup create | 创建完整数据备份 | openclaw-cn backup create |
openclaw-cn backup list | 列出所有备份 | openclaw-cn backup list |
openclaw-cn backup restore <backup-id> | 从指定备份恢复 | openclaw-cn backup restore 20260413-120000 |
openclaw-cn backup delete <backup-id> | 删除指定备份 | openclaw-cn backup delete 20260413-120000 |
高级命令
| 命令 | 说明 | 示例 |
|---|
openclaw-cn cron list | 列出所有定时任务 | openclaw-cn cron list |
openclaw-cn cron add "0 9 * * *" "发送每日日报" | 添加定时任务 | openclaw-cn cron add "0 9 * * *" "发送每日日报" |
openclaw-cn security audit | 执行安全审计 | openclaw-cn security audit |
openclaw-cn sandbox run <command> | 在沙箱中执行命令 | openclaw-cn sandbox run "ls -la" |
openclaw-cn mcp list | 列出所有已连接的MCP服务器 | openclaw-cn mcp list |
第二部分:聊天斜杠指令大全
(在Web控制台/微信/钉钉/飞书聊天窗口直接输入)
基础控制指令
| 指令 | 说明 | 示例 |
|---|
/help | 显示所有可用斜杠命令 | /help |
/help <command> | 查看指定命令的详细用法 | /help model |
/new 或 /clear | 开启新会话,清除上下文缓存 | /new |
/reset | 重置会话到初始状态(恢复默认参数) | /reset |
/stop | 强制停止当前正在生成的内容或任务 | /stop |
/status | 显示当前对话状态、模型、Token使用量 | /status |
/context | 详细展示当前对话的上下文构成 | /context |
/whoami | 显示当前发送者的身份标识 | /whoami |
/export | 将当前会话导出为Markdown文件 | /export |
模型与参数调整
| 指令 | 说明 | 示例 |
|---|
/model <model-name> | 临时切换当前会话使用的模型 | /model claude-4-opus |
/think <level> | 设置思考深度:off/minimal/low/medium/high/xhigh | /think high |
/temperature <value> | 调整生成温度(0-2),值越高越随机 | /temperature 0.7 |
/maxtokens <value> | 设置最大生成Token数 | /maxtokens 2048 |
/fast on/off | 开启/关闭快速响应模式 | /fast on |
/compact | 压缩当前会话上下文(用摘要替代历史,节省Token) | /compact |
工具与技能
| 指令 | 说明 | 示例 |
|---|
/tools | 列出当前可用的所有工具及其描述 | /tools |
/skills | 列出所有已安装的技能 | /skills |
/skill <skill-name> <args> | 手动调用指定技能 | /skill pdf-extract test.pdf |
/bash <command> | 在主机上执行Shell命令 | /bash ls -la |
/file list | 列出当前工作目录的文件 | /file list |
/file read <filename> | 读取指定文件内容 | /file read README.md |
/file write <filename> <content> | 写入内容到指定文件 | /file write test.txt "Hello World" |
系统管理
| 指令 | 说明 | 示例 |
|---|
/restart | 重启网关服务(仅管理员可用) | /restart |
/config get <key> | 读取指定配置项的值 | /config get language |
/config set <key> <value> | 修改指定配置项 | /config set default_model gpt-4o |
/usage off/tokens/full | 控制Token用量显示的详细程度 | /usage full |
/verbose on/off | 开关详细模式,显示工具调用和推理步骤 | /verbose on |
/tts on/off | 开启/关闭语音回复 | /tts on |
高级功能
| 指令 | 说明 | 示例 |
|---|
/subagent spawn <role> | 生成并启动一个子代理处理复杂任务 | /subagent spawn "前端工程师" |
/btw <question> | 询问一个临时问题,不被加入长期对话记忆 | /btw "今天是几号?" |
/activation mention/always | 切换激活模式:仅@提及触发/所有消息都触发 | /activation always |
/elevated | 临时提升Agent权限(需管理员密码) | /elevated |
/mcp list | 列出所有已连接的MCP服务器 | /mcp list |
第三部分:实用技巧与常见问题
命令别名设置(提高效率)
Linux/macOS
# 添加到 ~/.bashrc 或 ~/.zshrc
alias oc='openclaw-cn'
alias ocg='openclaw-cn gateway'
alias ocs='openclaw-cn status'
alias ocd='openclaw-cn doctor --fix'
alias ocl='openclaw-cn logs --follow'
# 生效
source ~/.bashrc
Windows PowerShell
# 添加到 $PROFILE
Set-Alias oc openclaw-cn
Set-Alias ocg openclaw-cn-gateway
Set-Alias ocs openclaw-cn-status
Set-Alias ocd openclaw-cn-doctor
Set-Alias ocl openclaw-cn-logs
万能问题排查命令组合
遇到任何问题,先执行这三条命令,能解决80%的常见错误:
openclaw-cn doctor --fix && \
openclaw-cn gateway restart && \
openclaw-cn logs --follow
常见问题快速解决
- 服务启动失败:先执行
openclaw-cn doctor --fix,再重启服务 - 汉化不生效:执行
openclaw-cn config set language zh-CN,然后重启服务 - AI不回复:执行
openclaw-cn models status 检查模型连接状态 - 技能安装失败:配置国内技能镜像:
openclaw-cn config set skillRegistry https://openclaw.cn/skills - 无法访问本地文件:添加目录到白名单:
openclaw-cn directory add ~/Documents
总结
这份速查手册涵盖了OpenClaw中文汉化版99%的常用操作命令,建议收藏并打印出来放在电脑旁,遇到问题随时查阅。记住:遇到问题先执行 openclaw-cn doctor --fix,这是解决大多数问题的最快方法。
如果需要更详细的命令说明,可以执行 openclaw-cn <command> --help 查看官方帮助文档
到此这篇关于OpenClaw常用操作命令完整速查手册(2026最新汉化版)的文章就介绍到这了,更多相关OpenClaw常用操作命令内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!
最新评论