惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
腾讯CDC
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
L
LangChain Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
IT之家
IT之家
A
About on SuperTechFans
H
Help Net Security

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19)
OpenClaw 安装与配置
微信公众号 · 2026-02-26 · via 陈少文的网站

Please enable Javascript to view the contents

1. 准备 Node 环境

  • 安装 nvm
1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
  • 设置 nvm 环境变量

需要修改 Bash 的配置文件,添加以下内容:

1
2
3
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
  • 安装 Node

2. 安装 OpenClaw

  • 安装包
1
npm install -g openclaw@latest
  • 卸载
1
npm uninstall -g openclaw
  • 设置环境变量

可以添加 KEY=VALUE 用于给 Plugins、Channels、Skills 等使用。

  • 初始化配置

加上 --install-daemon 参数,重启之后,服务自动启动。openclaw onboard --force 会强制重新初始化配置。

  • 调整配置参数

修改 ~/.openclaw/openclaw.json 文件的以下参数:

1
2
3
4
5
6
{
...
            "contextWindow": 262144,
            "maxTokens": 65536
...
}

重启 gateway 服务配置生效。

1
openclaw gateway restart

3. 使用命令

  • 在终端中与 Bot 对话
  • 在浏览器中与 Bot 对话

4. gateway 管理

gateway 是 OpenClaw 的网关模块,主要是需要启动和停止。

  • 启动
  • 停止
  • 重启
1
openclaw gateway restart

5. plugins 管理

plugins 是 OpenClaw 的功能扩展模块,主要是需要安装和启用。

  • 查看已安装插件
  • 安装插件
1
openclaw plugins install telegram
  • 启用插件
1
openclaw plugins enable telegram
  • 禁用插件
1
openclaw plugins disable telegram

6. skills 管理

skills 是 OpenClaw 的技能模块,主要是需要安装和启用。

  • 查看已安装技能
  • 检查技能是否正常
  • 查看技能信息
1
openclaw skills info weather

7. channel 管理

channel 是 OpenClaw 与外部 / 用户交互的通信方式,主要是需要开启和配置。

  • 添加 channel
1
openclaw channels add --channel telegram --token <token>

也可以不加参数,进入交互页面配置 channel 信息。

  • 查看 channel 列表
  • 查看 channel 连接状态
1
openclaw channels status
  • 登出 channel
1
openclaw channels logout  --channel telegram

8. agent 管理

agent 是 OpenClaw 的智能体模块,主要是需要创建和管理。通过 agent 子命令可以创建多个角色的智能体

  • 查看 agent
  • 创建 agent
1
openclaw agents add test
  • 修改 agent 信息
1
openclaw agents  set-identity --agent test --name test2

修改 name/theme/emoji/avatar 等

  • 删除 agent
1
openclaw agents delete test
  • 与 agent 对话
1
openclaw agent --agent main --message "hello"

9. 运维操作

  • 查看 OpenClaw 状态
  • 查看实时日志
  • 安装 daemon
1
openclaw daemon install
  • 卸载 daemon
1
openclaw daemon uninstall
  • 检查
  • 卸载全部服务
1
openclaw uninstall --all --yes --non-interactive

10. 异常处理

  • channel 对话异常
1
2
400 Invalid JSON payload received. Unknown name "patternProperties" at 'tools[0].function_declarations[3].parameters.properties[4].value': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[5].parameters.properties[20].value.properties[3].value.items': Cannot find field.

模型配置异常,需要更换模型。


微信公众号