环境要求

  • macOS 系统
  • zsh 或 bash shell

安装步骤

步骤 1: 安装 Homebrew

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

安装过程中:

  • 选择 2 (下载源)
  • 选择 1 (镜像源)

步骤 2: 安装 Node.js 和 pnpm

brew install node pnpm

步骤 3: 安装 Ghostty 终端

brew install ghostty

Ghostty 是 macOS 下的高性能终端工具


步骤 4: 安装 OpenClaw

npm install -g openclaw@latest

步骤 5: 安装 zsh 自动补全

# 确保 zsh 自动补全已加载
autoload -Uz compinit
compinit

# 安装 openclaw zsh 自动补全
openclaw completion --write-state
openclaw completion -s zsh -i

步骤 6: 安装 bash 自动补全(可选)

openclaw completion --write-state
openclaw completion -s bash -i

步骤 7: 初始化安装

openclaw onboard --install-daemon

按照以下提示进行配置:

提示信息选择
I understand this is powerful and inherently risky. Continue?Yes
Onboarding modeQuickStart
Model/auth providerSkip for now (后续可配置)
Filter models by providerAll providers
Default model
Select channel (QuickStart)Skip for now (后续可配置)
Configure skills now? (recommended)No (后续可配置)
Enable hooks?按空格选中,然后按回车

基础配置

8.1 启用工具权限

从 openclaw 2026.3.2 开始,新安装的 agent 工具权限默认关闭。需要编辑配置文件:

vim ~/.openclaw/openclaw.json

在第一个大括号内添加以下配置:

"tools": {
  "profile": "full",
  "web": {
    "search": {
      "enabled": false
    },
    "fetch": {
      "enabled": true
    }
  }
},

8.2 启用浏览器功能

编辑 ~/.openclaw/openclaw.json,添加以下配置:

"browser": {
  "enabled": true,
  "attachOnly": false
},

8.3 配置 AI 模型

# 查看当前可用模型列表
openclaw models list

# 设置默认模型(示例)
openclaw models set openai-glm-4.7

# 进入交互式配置界面,配置模型供应商和具体模型
openclaw config

交互式配置路径:Local (this machine)model → 选择供应商 → 选择模型


8.4 重启 OpenClaw 网关

openclaw gateway restart

验证安装

# 检查 openclaw 版本
openclaw --version

# 测试命令补全(输入 openclaw 后按 Tab 键)
openclaw [Tab]

故障排查

  • 自动补全不生效: 确保 compinit 已执行,检查 .zshrc.bash_profile 是否正确加载
  • 工具权限被拒: 检查 ~/.openclaw/openclaw.json 中的 tools.profile 是否为 "full"
  • 模型调用失败: 运行 openclaw config 检查模型配置是否正确
Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐