📋 前置要求
系统要求
- 操作系统: macOS 12+ (Apple Silicon 或 Intel)
- Node.js: v18+ (推荐 v20+)
- npm: v9+
- Git: 用于克隆仓库和管理技能
- 存储空间: 至少 2GB 可用空间
OpenClaw 在 macOS 系统上的安装、配置及部署流程。涵盖环境检查(Node.js、npm、Git)、两种安装方式(npm 全局安装或源码编译)、工作区初始化、核心配置文件编写以及多平台通信渠道(WebChat、Telegram、Discord)的配置方法。适用于开发者快速搭建本地 AI 助手环境。
# 检查 Node.js 版本
node --version
# 检查 npm 版本
npm --version
# 检查 Git
git --version
npm install -g openclaw
# 克隆仓库
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# 安装依赖
npm install
# 全局链接
npm link
openclaw --version
openclaw help
# OpenClaw 默认配置目录
mkdir -p ~/.openclaw/workspace
mkdir -p ~/.openclaw/skills
mkdir -p ~/.openclaw/memory
cd ~/.openclaw/workspace
openclaw init
创建 ~/.openclaw/config.json:
{
"workspace": "/Users/wei/.openclaw/workspace",
"model": {
"default": "qwen-portal/coder-model",
"provider": "qwen-portal"
},
"channels": {
"webchat": {
"enabled": true,
"port": 3000
}
},
"skills": {
"enabled": ["github", "weather", "healthcheck"]
},
"security": {
"riskLevel": "standard",
"requireConfirmation": ["external", "destructive"]
}
}
# 启动 WebChat 服务
openclaw gateway start
# 1. 通过 @BotFather 创建 bot,获取 TOKEN
# 2. 配置 channels.json
创建 ~/.openclaw/channels/telegram.json:
{
"provider": "telegram",
"token": "YOUR_BOT_TOKEN",
"webhook": false,
"polling": true
}
# 1. 在 Discord Developer Portal 创建应用
# 2. 获取 Bot Token
# 3. 邀请 bot 到服务器
创建 ~/.openclaw/channels/discord.json:
{
"provider": "discord",
"token": "YOUR_BOT_TOKEN",
"guildId": "YOUR_SERVER_ID"
}

微信公众号「极客日志」,在微信中扫描左侧二维码关注。展示文案:极客日志 zeeklog
生成新的随机RSA私钥和公钥pem证书。 在线工具,RSA密钥对生成器在线工具,online
基于 Mermaid.js 实时预览流程图、时序图等图表,支持源码编辑与即时渲染。 在线工具,Mermaid 预览与可视化编辑在线工具,online
将字符串编码和解码为其 Base64 格式表示形式即可。 在线工具,Base64 字符串编码/解码在线工具,online
将字符串、文件或图像转换为其 Base64 表示形式。 在线工具,Base64 文件转换器在线工具,online
将 Markdown(GFM)转为 HTML 片段,浏览器内 marked 解析;与 HTML转Markdown 互为补充。 在线工具,Markdown转HTML在线工具,online
将 HTML 片段转为 GitHub Flavored Markdown,支持标题、列表、链接、代码块与表格等;浏览器内处理,可链接预填。 在线工具,HTML转Markdown在线工具,online