logo
0
0
WeChat Login
Add CNB cloud development config for OpenClaw

OpenClaw CNB 云开发配置说明

快速开始

1. 使用方法

在仓库页面点击右上角的 "云原生开发" 按钮,即可一键创建 OpenClaw 开发环境。

2. 一键启动流程

系统将自动完成以下步骤:

  • 构建 Node 22 开发环境
  • 安装 OpenClaw CLI 工具
  • 验证安装完整性
  • 启动 code-server (WebIDE)

3. 启动 OpenClaw

进入开发环境后,使用以下命令:

# 运行配置向导(首次使用) openclaw onboard --install-daemon # 启动 Gateway openclaw gateway --port 18789 # 打开浏览器控制面板 openclaw dashboard

4. 访问地址

  • WebIDE: 通过浏览器进入开发环境
  • 控制面板: http://127.0.0.1:18789/
  • VSCode 远程访问: 使用 Remote-SSH 插件连接

环境配置

硬件规格

  • CPU: 4 核
  • 内存: 8 GB
  • 基础镜像: Node 22

预装工具

  • Node.js 22
  • npm / pnpm
  • Git
  • code-server + 常用插件
  • OpenClaw CLI
  • curl / wget

环境变量(可选)

如需自定义配置,可在 .cnb.yml 中添加:

stages: - name: 设置环境变量 script: | export OPENCLAW_HOME=/custom/path export OPENCLAW_STATE_DIR=/custom/state export OPENCLAW_CONFIG_PATH=/custom/config/openclaw.json

使用技巧

快速测试消息

# 发送测试消息(需配置频道) openclaw message send --target +15555550123 --message "Hello from OpenClaw"

健康检查

# 检查配置 openclaw doctor # 检查 Gateway 状态 openclaw gateway status # 检查版本 openclaw --version

查看日志

# 查看 Gateway 日志 openclaw gateway logs

配置文件

OpenClaw 配置文件位于 ~/.openclaw/openclaw.json

示例配置:

{ "channels": { "whatsapp": { "allowFrom": ["+15555550123"], "groups": { "*": { "requireMention": true } } } }, "messages": { "groupChat": { "mentionPatterns": ["@openclaw"] } } }

故障排查

OpenClaw 命令未找到

# 重新安装 curl -fsSL https://openclaw.ai/install.sh | bash # 检查 PATH echo $PATH

Gateway 无法启动

# 检查端口占用 lsof -i :18789 # 检查配置 openclaw doctor # 查看详细日志 openclaw gateway --port 18789 --verbose

更多文档