openclaw命令速查

admin 2026-02-10 14:38:49 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 本文档是OpenClawAIAgent框架的命令速查手册,涵盖安装配置、网关管理、模型接入(Ollama/Kimi/智谱AI)及故障排查等实操内容。作者记录了配置本地OllamaAPI时遇到的报错问题未解决,整体属于工具使用指南与踩坑记录,技术深度有限但具备一定实操参考价值。 综合评分: 45 文章分类: AI安全,安全工具,解决方案


cover_image

openclaw 命令速查

原创

hyang0 hyang0

生有可恋

2026年2月9日 14:41 湖北

| 命令 | 说明 | | — | — | | openclaw | 启动 OpenClaw(前台模式) | | openclaw onboard | 运行初始化向导 | | openclaw onboard --install-daemon | 初始化 + 安装守护进程 | | openclaw dashboard | 打开网页控制台 | | openclaw status | 查看运行状态 | | openclaw doctor | 诊断检查 | | openclaw config get | 查看配置 | | openclaw config set KEY VALUE | 修改配置 | | openclaw gateway start | 启动网关 | | openclaw gateway stop | 停止网关 | | openclaw gateway restart | 重启网关 | | openclaw channels list | 查看通道列表 | | openclaw skills list | 查看技能列表 | | openclaw --help | 查看帮助 | | openclaw --version | 查看版本 |

查看和修改配置

# 查看某个配置项openclaw config get gateway.modeopenclaw config get agents.defaults.model
# 修改配置openclaw config set gateway.mode localopenclaw config set gateway.port 18789

模型配置排查

# 1. 检查当前配置的模型openclaw config get agents.defaults.model# 2. 检查 API Key 是否配置openclaw config get auth# 3. 运行诊断openclaw doctor# 4. 查看实时日志(前台启动)openclaw

配置本地 ollama API

openclaw config set agents.defaults.model ollama/llama3.2openclaw config set auth.openai.apiKey ollamaopenclaw config set auth.openai.baseURL http://localhost:11434/v1

配置 Kimi API

openclaw config set agents.defaults.model moonshot/kimi-k2.5openclaw config set auth.moonshot.apiKey 你的API密钥

配置 智谱AI API

openclaw config set agents.defaults.model zai/glm-4.7openclaw config set auth.zai.apiKey 你的API密钥

安装 skills

# 查看可用技能openclaw skills list# 安装技能openclaw skills install

使用 openclaw gateway 启动网关后,可以看到网关端口地址,默认绑定在 127.0.0.1:18789,服务器以外的地址访问需要使用 ssh代理。

ssh 代理命令:

ssh&nbsp;-N -L&nbsp;18789:127.0.0.1:18789&nbsp;root@<server-ip>

最终通过代理后的地址访问:

http://localhost:18789

网关令牌在 .openclaw/openclaw.json 中,填上之后会显示连接成功。

使用本地 ollama API 一直报错,不清楚哪里配置错了。当前配置如下:

&nbsp;&nbsp;"models":&nbsp;{&nbsp; &nbsp;&nbsp;"mode":&nbsp;"merge",&nbsp; &nbsp;&nbsp;"providers":&nbsp;{&nbsp; &nbsp; &nbsp;&nbsp;"ollama":&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"baseUrl":&nbsp;"http://127.0.0.1:11434/v1",&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"api":&nbsp;"openai-completions",&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"models":&nbsp;[&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"id":&nbsp;"gpt-oss:20b",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"name":&nbsp;"gpt-oss:20b",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"reasoning":&nbsp;true,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"input":&nbsp;[&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"text",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"image"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;],&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"cost":&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"input":&nbsp;0,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"output":&nbsp;0,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"cacheRead":&nbsp;0,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"cacheWrite":&nbsp;0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"contextWindow":&nbsp;256000,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"maxTokens":&nbsp;8192&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;}&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;]&nbsp; &nbsp; &nbsp;&nbsp;}&nbsp; &nbsp;&nbsp;}&nbsp;&nbsp;},&nbsp;&nbsp;"agents":&nbsp;{&nbsp; &nbsp;&nbsp;"defaults":&nbsp;{&nbsp; &nbsp; &nbsp;&nbsp;"model":&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"primary":&nbsp;"ollama/gpt-oss:20b"&nbsp; &nbsp; &nbsp;&nbsp;},&nbsp; &nbsp; &nbsp;&nbsp;"models":&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"ollama/gpt-oss:20b":&nbsp;{}&nbsp; &nbsp; &nbsp;&nbsp;},&nbsp; &nbsp; &nbsp;&nbsp;"workspace":&nbsp;"/root/.openclaw/workspace",&nbsp; &nbsp; &nbsp;&nbsp;"maxConcurrent":&nbsp;4,&nbsp; &nbsp; &nbsp;&nbsp;"subagents":&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;"maxConcurrent":&nbsp;8&nbsp; &nbsp; &nbsp;&nbsp;}&nbsp; &nbsp;&nbsp;}&nbsp;&nbsp;},

报错信息如下:

弄了一上午也没跑通,先这样吧。

全文完。


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:生有可恋 hyang0 hyang0《openclaw 命令速查》

评论:0   参与:  2