乐于分享
好东西不私藏

OpenClaw 完整安装教程!

OpenClaw 完整安装教程!

🤔 OpenClaw 是什么?

OpenClaw 是一个个人 AI 助手框架,让你可以在本地运行自己的 AI 助手。

它能帮你做什么?

  • ✅ 聊天问答(微信、QQ、Telegram、Discord 等)
  • ✅ 写文章、写代码
  • ✅ 定时提醒
  • ✅ 自动化任务
  • ✅ 浏览器操作
  • ✅ 文件处理

最大的好处:数据在自己电脑上,隐私安全!

一键安装(1 条命令)

打开命令行,复制粘贴以下命令:

curl -fsSL https://openclaw.ai/install.sh | bash
等待安装完成,过程大约 2-5 分钟。

配置向导详细流程

安装完成后,会自动进入配置向导 (openclaw onboard)。

第 1 步:欢迎界面

🦞 Welcome to OpenClaw!This wizard will help you set up your personal AI assistant.
按 Enter 继续。

第 2 步:选择 AI 模型

向导会显示可选的 AI 模型:

Select your AI provider:  ○ OpenAI (GPT-4)  ● Dashscope (通义千问)  ← 推荐国内用户  ○ Anthropic (Claude)  ○ Google (Gemini)  ○ Skip for now

操作方法

  • 用  方向键选择
  • 按 Enter 确认

模型推荐

  • 国内用户
    :选 Dashscope(通义千问),速度快,便宜
  • 有 OpenAI
    :选 OpenAI,模型最强
  • 有 Claude
    :选 Anthropic,长文本厉害

第 3 步:填写 API Key

选择模型后,输入 API Key:

Enter your Dashscope API Key:> sk-____________________

如何获取 API Key?

通义千问(Dashscope)

  1. 访问:dashscope.console.aliyun.com/
  2. 登录阿里云账号(没有就注册一个)
  3. 点击左侧"API Key 管理"
  4. 点击"创建新的 API Key"
  5. 复制生成的 Key(以 sk- 开头)
  6. 粘贴到向导里

OpenAI

  1. 访问:platform.openai.com/
  2. 登录或注册
  3. 点击左侧"API Keys"
  4. 点击"Create new secret key"
  5. 复制 Key(以 sk-proj- 或 sk- 开头)

Claude(Anthropic)

  1. 访问:console.anthropic.com/
  2. 登录或注册
  3. 点击"Get API keys"
  4. 点击"Create key"
  5. 复制 Key(以 sk-ant- 开头)

第 4 步:测试连接

向导会测试 API Key 是否有效:

Testing connection to Dashscope...✅ Connection successful!Model: qwen-maxCredits remaining: ¥100.00

如果失败,会提示你重新输入。

第 5 步:选择连接平台

向导会问你要连接哪些聊天平台:

Select platforms to connect:  ○ WhatsApp  ○ Telegram  ○ Discord  ○ Slack  ○ WeChat (微信)  ○ QQ  ○ Skip for now  ← 新手建议先选这个

新手建议

  • 先选 Skip for now(跳过)
  • 等 OpenClaw 运行正常后再配置平台
  • 配置平台需要额外的 Bot ID 或 Token

后续配置: 运行 openclaw channels add 可以添加平台


第 6 步:安装后台服务

向导会问是否安装后台服务(开机自启):

Install Gateway daemon?This will start OpenClaw automatically on boot.  ● Yes (recommended)  ○ No

建议

  • 选 Yes:OpenClaw 会一直运行,随时可用
  • 选 No:每次需要手动运行 openclaw gateway

后台服务类型

  • macOS:launchd
  • Linux:systemd
  • Windows:WSL2 或手动运行

第 7 步:配置工作目录

向导会设置工作目录:

Workspace location:> /Users/你的用户名/.openclaw/workspaceChange location? (y/N)

建议

  • 直接按 Enter 使用默认位置
  • 如果需要改,输入 y 然后输入新路径

工作目录用途

  • 存放你的脚本
  • 存放技能文件
  • 存放记忆文件

第 8 步:完成配置

最后,向导会显示总结:

Setup complete!Configuration summary:  • AI Provider: Dashscope (qwen-max)  • Workspace: ~/.openclaw/workspace  • Gateway: Running (port 18789)  • Channels: None (add later with `openclaw channels add`)What's next?  • Chat: openclaw agent --message "Hello"  • Send message: openclaw message send --to xxx --message "Hi"  • Add channel: openclaw channels add  • View docs: openclaw docs

按 Enter 完成配置。

🎉 安装完成

配置完成后,你会看到:

🦞 OpenClaw installed successfully!✅ Gateway started on port 18789🤖 AI assistant ready

后续继续更新使用说明哦!

转载:https://juejin.cn/post/7613590357511307302