file

一、OpenClaw介绍

OpenClaw 是一个运行在本地设备上的个人 AI 助手。安装很简单,复制粘贴就行了。

在电脑上可以用浏览器打开这个网址:
https://gxxc.wiki/other/7503.html ,将需要用到的命令复制粘贴执行就行。

这里演示:麒麟v11 + 腾讯QQ + minimax 的组合。

minimax的api需要提前申请好,还没有的,可以先跳过,后面再配置也可以。

二、安装步骤 (V10SP1和V11步骤一样)

  1. 关闭kysec安全 (略)

    V10-SP1和V11不同,关闭步骤可以查看一下我其他文章。
     

  2. 安装依赖程序(可以切换root,也可以不切)

    sudo apt update && sudo apt install  git  -y
  3. 使用nvm安装node.js

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

     
    上面命令执行没问题后,再执行以下命令:

    source ~/.bashrc
    nvm install 22
    nvm use 22
    node  --version

    file

  4. 安装pnpm

    npm  install  -g  pnpm
    pnpm  setup
    source  ~/.bashrc
    # 配置淘宝镜像源
    pnpm config set registry https://registry.npmmirror.com
    pnpm config set @npm:registry https://registry.npmmirror.com
    # 验证配置
    pnpm config get registry  # 输出 https://registry.npmmirror.com

    file

  5. 使用 pnpm 全局安装openclaw

    pnpm  add  -g  openclaw@latest
    openclaw  --version

    file
    file
    如上图所示,openclaw已经安装完成。

三、初始化及配置openclaw

  1. 执行以下命令配置工作目录(可以省略)

    openclaw  setup

    file

  2. 执行以下命令进行导航式配置:

    openclaw  onboard

    file
    file
    file
    file
    file
    file
    file
    file
    file
    file
    file
    file

  3. 配置QQ机器人

    浏览器打开 https://q.qq.com

    file

    用qq扫码登录

    file

    点击创建机器人

    file

    把这三条命令,复制到终端去执行

    file
    file
    file

    打开QQ就能看到小龙虾机器人了

    file

  4. 安装chromium浏览器

    file
    file

四、卸载

全局卸载OpenClaw

  1. 使用以下命令卸载通过pnpm全局安装的OpenClaw:

    pnpm remove -g openclaw
    或简写为:
    pnpm rm -g openclaw
  2. 检查是否已卸载
    执行以下命令检查是否已成功卸载:

    pnpm list -g | grep openclaw

    若无输出,则表示已卸载。

  3. 手动删除残留文件(可选)
    如果标准方法无效,可以手动删除全局包:
    找到pnpm全局安装目录:

    pnpm root -g

    进入该目录并删除OpenClaw相关文件夹:

    rm -rf <pnpm_global_path>/openclaw
  4. 清除缓存(可选):

    pnpm store prune

五、常用命令

命令作用备注 / 参数
npm install -g openclaw@latest --registry https://registry.npmmirror.com安装openclaw
openclaw onboard安装引导
openclaw status查看 Gateway 状态检查网关是否可达及运行状况
openclaw health健康检查主要检测 core 运行和依赖情况
openclaw doctor综合诊断与修复建议可配合 --yes / --non-interactive 自动执行
openclaw configure交互式配置向导用于设置模型、通道、凭据等
openclaw config get <path>获取配置值指定路径提取配置
openclaw config set <path> <value>设置配置项支持 JSON5/raw 文本
openclaw config unset <path>清除配置项移除单个键值
openclaw channels list列出已登录通道可观察 WhatsApp/Telegram 等登录状态
openclaw channels login登录新的通道账号用于扫描 / 授权链接
openclaw skills list列出技能查看可用 / 已安装的技能
openclaw skills info <skill>技能详情观察某项技能参数或版本
openclaw plugins list列出插件查看已安装插件
openclaw plugins install <id>安装插件例如 @openclaw/voice-call
openclaw plugins enable <id>启用插件之后通常需要重启网关
openclaw logs --follow显示日志--json / --plain / --limit 等组合使用
openclaw gateway启动 Gateway 网关
openclaw gateway install安装系统服务根据平台注册 Gateway 守护进程
openclaw gateway start启动 Gateway 网关系统服务模式下启动
openclaw gateway stop停止 Gateway 网关同上
openclaw gateway restart重启 Gateway 网关适合配置变更后应用
openclaw gateway status网关系统服务状态不同于 openclaw status,会探测服务单元
openclaw uninstall卸载 Gateway 服务及数据官方推荐使用
openclaw uninstall --all --yes --non-interactive全自动卸载包含状态、workspace、插件等
openclaw uninstall --state删除状态文件不删除 workspace/CLI
openclaw uninstall --workspace删除工作区移除 agent/workspace 文件
openclaw uninstall --service仅卸载服务不删除数据
openclaw uninstall --dry-run模拟卸载显示结果但不实际执行

其他

  1. 官网中文文档地址:https://docs.openclaw.ai/zh-CN

安装过程中的常见错误

  1. pnpm 找不到全局 bin 目录,如下图所示:
    file
    这个错误是因为 pnpm 找不到全局 bin 目录,导致无法将 openclaw 命令链接到全局。你可以按以下步骤解决:

    • 自动创建全局 bin 目录(推荐)

    直接运行 pnpm 提供的 setup 命令,它会自动创建并配置好目录:

    pnpm  setup
    source  ~/.bashrc

    执行完成后,重启终端或重新加载 shell 配置,再尝试安装:

    pnpm  add  -g  openclaw@latest
  2. 缺少git命令

    file
    处理:

    apt update && apt install -y git
  3. 打开的web界面显示4008,如下图所示:

    file

    处理方法1:

    从软件商店上下载chromium浏览器,用chromium浏览器打开就好了。
     

    处理方法2:

    # 生成新的 gateway token
    openclaw doctor --generate-gateway-token
    # 重启服务
    systemctl --user restart openclaw-gateway
    # 打开带 token 的 dashboard
    openclaw dashboard

本文由mdnice多平台发布

标签: none

添加新评论