虚拟机安装龙虾

快速安装流程图

graph TD
    %% 样式定义
    classDef step fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
    classDef tool fill:#fff3e0,stroke:#e65100,stroke-width:2px;
    classDef config fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;

    Start((开始)) --> Env[环境准备]
    
    subgraph S1 [1. 基础环境]
        Env -->|安装| VB[VirtualBox]:::tool
        Env -->|安装| VG[Vagrant]:::tool
        Env -->|准备| API[智谱 AI Key]:::config
    end

    S1 --> Box[Box 镜像准备]
    
    subgraph S2 [2. 虚拟机部署]
        Box -->|下载/添加| GenericBox[generic/ubuntu2204]:::tool
        GenericBox --> Init[初始化目录 openclaw-vm]
        Init --> Conf[配置 Vagrantfile]:::config
        Conf --> Up[启动虚拟机 vagrant up]
        Up --> SSH[进入虚拟机 vagrant ssh]
    end

    S2 --> Node[OpenClaw 环境安装]

    subgraph S3 [3. 软件安装 - 虚拟机内]
        Node -->|安装| Node22[Node.js 22.x]:::tool
        Node22 -->|配置| NPM[npm 国内镜像]:::config
        NPM -->|生成| GitKey[SSH Key]:::config
        GitKey -->|配置| GitAcc[GitHub 公钥]:::config
        GitAcc -->|安装| OCPkg[OpenClaw CLI]:::tool
        OCPkg -->|安装| FSPkg[飞书插件]:::tool
    end

    S3 --> InitOC[OpenClaw 初始化]

    subgraph S4 [4. 平台配置]
        InitOC -->|运行| Onboard[openclaw onboard]
        Onboard -->|配置| LLM[LLM: 智谱 AI]:::config
        Onboard -->|配置| Channel[Channel: 飞书]:::config
        
        Channel -.-> Feishu[飞书开放平台配置]
        Feishu --> CreateApp[创建应用]
        CreateApp --> Perm[权限配置]:::config
        Perm --> Event[事件订阅 - WebSocket]:::config
        Event --> Publish[版本发布]
    end

    Publish --> End((完成))

安装前置工具

如果还没装的话:

• VirtualBox 下载 (https://www.virtualbox.org/wiki/Downloads) — 装 Windows hosts 版本
• Vagrant 下载 (https://developer.hashicorp.com/vagrant/install) — 装 Windows amd64 版本

装完后打开 PowerShell 验证:

# 验证安装
vagrant --version
# 准备工作目录
mkdir openclaw-vm
cd openclaw-vm

大模型准备(选1个执行)

智谱配置 (Zhipu AI)

  1. 登录 智谱清言
  2. 项目管理 -》API Key (https://bigmodel.cn/usercenter/proj-mgmt/apikeys)-创建API Key (如已创建直接复制 Key 值,后面备用)

    提示:OpenClaw 需要配合 GLM Coding Plan 使用,推荐使用 GLM-5 模型。
    购买链接:https://www.bigmodel.cn/glm-coding?ic=S9ONWKSCEW

Box 下载加速(推荐)

官方 Ubuntu Cloud 镜像缺少 Vagrant 必要的默认凭证,导致启动失败。
推荐使用 generic/ubuntu2204 镜像,它是专门为 Vagrant 优化的版本,开箱即用。

1. 手动下载 Box 文件

可以使用命令下载:

  • Vagrant Cloud (generic/ubuntu2204 v4.3.12)
    curl -L -o virtualbox.box https://vagrantcloud.com/generic/boxes/ubuntu2204/versions/4.3.12/providers/virtualbox.box
    

2. 添加到 Vagrant

下载完成后,在下载目录打开终端(PowerShell),运行以下命令将 box 添加名为 generic/ubuntu2204

# 假设下载的文件名为 virtualbox.box
vagrant box add generic/ubuntu2204 ./virtualbox.box

添加成功后,Vagrant 就会优先使用本地的这个 box。

安装系统和openclaw

# 编辑 Vagrantfile
cat <<'EOF' > Vagrantfile
Vagrant.configure("2") do |config|
  # 使用通用 Vagrant 镜像 (generic/ubuntu2204),开箱即用,无需额外配置
  config.vm.box = "generic/ubuntu2204"
  
  config.vm.hostname = "openclaw"

  # 端口转发,方便从宿主机访问
  # Port 3000 is often used, so map to 3001 on host to avoid conflicts
  config.vm.network "forwarded_port", guest: 3000, host: 3000
  config.vm.network "forwarded_port", guest: 4440, host: 4440
  # 固定 IP,方便宿主机访问
  # config.vm.network "private_network", ip: "192.168.1.10"

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "8096"
    vb.cpus = 4
  end

  # 自动安装 Node.js -++++++++++++++++++++++++++++++++++++++++++++ OpenClaw
  # config.vm.provision "shell", inline: <<-SHELL
    # 初始化 root 密码
    # echo 'root:password' | chpasswd

    # curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
    # apt-get install -y nodejs
    
    # # 配置 npm 国内镜像
    # npm config set registry https://registry.npmmirror.com
    
    # npm install -g openclaw
    # # 安装飞书插件
    # npm install -g @openclaw/feishu
    # echo "✅ OpenClaw installed: $(openclaw --version)"
  # SHELL
end

# vagrant up
# vagrant ssh 
# vagrant halt
# vagrant destroy -f && vagrant up

#  for /f "tokens=5" %a in ('netstat -ano ^| findstr :3000') do taskkill /F /PID %a
# 10

EOF
# 4. 启动虚拟机 首次会下载 Ubuntu 镜像,可能需要几分钟。完成后 OpenClaw 就自动装好了。
vagrant up
# 进入虚拟机
vagrant ssh 

# 安装 Node.js
sudo curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash
sudo apt-get install -y nodejs
# 配置 npm 国内镜像
sudo npm config set registry https://registry.npmmirror.com
# 生成key 
sudo ssh-keygen -t ed25519 -C "qiujiahongde@163.com"
# 复制key公钥
sudo cat  /root/.ssh/id_ed25519.pub
# 在你的github账号上添加公钥 https://github.com/settings/keys

# 安装 OpenClaw
sudo npm install -g openclaw
# 安装飞书插件
sudo npm install -g @openclaw/feishu
echo "✅ OpenClaw installed: $(openclaw --version)"
openclaw onboard
  • openclaw onboard 后如下配置,完成openclaw的配置
vagrant@openclaw:~$ openclaw onboard

🦞 OpenClaw 2026.2.23 (b817600) — I'm the assistant your terminal demanded, not the one your sleep schedule requested.

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                  🦞 OPENCLAW 🦞

┌  OpenClaw onboarding
│
◇  Security ──────────────────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  Security warning — please read.                                                        │
│                                                                                         │
│  OpenClaw is a hobby project and still in beta. Expect sharp edges.                     │
│  This bot can read files and run actions if tools are enabled.                          │
│  A bad prompt can trick it into doing unsafe things.                                    │
│                                                                                         │
│  If you’re not comfortable with basic security and access control, don’t run OpenClaw.  │
│  Ask someone experienced to help before enabling tools or exposing it to the internet.  │
│                                                                                         │
│  Recommended baseline:                                                                  │
│  - Pairing/allowlists + mention gating.                                                 │
│  - Sandbox + least-privilege tools.                                                     │
│  - Keep secrets out of the agent’s reachable filesystem.                                │
│  - Use the strongest available model for any bot with tools or untrusted inboxes.       │
│                                                                                         │
│  Run regularly:                                                                         │
│  openclaw security audit --deep                                                         │
│  openclaw security audit --fix                                                          │
│                                                                                         │
│  Must read: https://docs.openclaw.ai/gateway/security                                   │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  I understand this is powerful and inherently risky. Continue?
│  Yes
│
◇  Onboarding mode
│  QuickStart
│
◇  QuickStart ─────────────────────────╮
│                                      │
│  Gateway port: 18789                 │
│  Gateway bind: Loopback (127.0.0.1)  │
│  Gateway auth: Token (default)       │
│  Tailscale exposure: Off             │
│  Direct to chat channels.            │
│                                      │
├──────────────────────────────────────╯
│
◇  Model/auth provider
│  Z.AI
│
◇  Z.AI auth method
│  Coding-Plan-CN
│
◇  Enter Z.AI API key
│  key..........
│
◇  Model configured ───────────────╮
│                                  │
│  Default model set to zai/glm-5  │
│                                  │
├──────────────────────────────────╯
│
◇  Default model
│  Keep current (zai/glm-5)
│
◇  Channel status ────────────────────────────╮
│                                             │
│  Telegram: not configured                   │
│  WhatsApp: not configured                   │
│  Discord: not configured                    │
│  IRC: not configured                        │
│  Google Chat: not configured                │
│  Slack: not configured                      │
│  Signal: not configured                     │
│  iMessage: not configured                   │
│  Feishu: install plugin to enable           │
│  Google Chat: install plugin to enable      │
│  Nostr: install plugin to enable            │
│  Microsoft Teams: install plugin to enable  │
│  Mattermost: install plugin to enable       │
│  Nextcloud Talk: install plugin to enable   │
│  Matrix: install plugin to enable           │
│  BlueBubbles: install plugin to enable      │
│  LINE: install plugin to enable             │
│  Zalo: install plugin to enable             │
│  Zalo Personal: install plugin to enable    │
│  Synology Chat: install plugin to enable    │
│  Tlon: install plugin to enable             │
│                                             │
├─────────────────────────────────────────────╯
│
◇  How channels work ───────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│  DM security: default is pairing; unknown DMs get a pairing code.                         │
│  Approve with: openclaw pairing approve <channel> <code>                                  │
│  Public DMs require dmPolicy="open" + allowFrom=["*"].                                    │
│  Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer" (or          │
│  "per-account-channel-peer" for multi-account channels) to isolate sessions.              │
│  Docs: channels/pairing              │
│                                                                                           │
│  Telegram: simplest way to get started — register a bot with @BotFather and get going.    │
│  WhatsApp: works with your own number; recommend a separate phone + eSIM.                 │
│  Discord: very well supported right now.                                                  │
│  IRC: classic IRC networks with DM/channel routing and pairing controls.                  │
│  Google Chat: Google Workspace Chat app with HTTP webhook.                                │
│  Slack: supported (Socket Mode).                                                          │
│  Signal: signal-cli linked device; more setup (David Reagans: "Hop on Discord.").         │
│  iMessage: this is still a work in progress.                                              │
│  Feishu: 飞书/Lark enterprise messaging with doc/wiki/drive tools.                        │
│  Nostr: Decentralized protocol; encrypted DMs via NIP-04.                                 │
│  Microsoft Teams: Bot Framework; enterprise support.                                      │
│  Mattermost: self-hosted Slack-style chat; install the plugin to enable.                  │
│  Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots.                        │
│  Matrix: open protocol; install the plugin to enable.                                     │
│  BlueBubbles: iMessage via the BlueBubbles mac app + REST API.                            │
│  LINE: LINE Messaging API bot for Japan/Taiwan/Thailand markets.                          │
│  Zalo: Vietnam-focused messaging platform with Bot API.                                   │
│  Zalo Personal: Zalo personal account via QR code login.                                  │
│  Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities.  │
│  Tlon: decentralized messaging on Urbit; install the plugin to enable.                    │
│                                                                                           │
├───────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  Select channel (QuickStart)
│  Feishu/Lark (飞书)
│
◇  Install Feishu plugin?
│  Download from npm (@openclaw/feishu)
Downloading @openclaw/feishu…
Extracting /tmp/openclaw-npm-pack-uF1uxU/openclaw-feishu-2026.2.23.tgz…
Installing to /home/vagrant/.openclaw/extensions/feishu…
Installing plugin dependencies…
22:36:55 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/vagrant/.openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
│
◇  Feishu credentials ──────────────────────────────────────────────────────────────╮
│                                                                                   │
│  1) Go to Feishu Open Platform (open.feishu.cn)                                   │
│  2) Create a self-built app                                                       │
│  3) Get App ID and App Secret from Credentials page                               │
│  4) Enable required permissions: im:message, im:chat, contact:user.base:readonly  │
│  5) Publish the app or add it to a test group                                     │
│  Tip: you can also set FEISHU_APP_ID / FEISHU_APP_SECRET env vars.                │
│  Docs: feishu                 │
│                                                                                   │
├───────────────────────────────────────────────────────────────────────────────────╯
│
◇  Enter Feishu App ID
│  cli_a91xxxxxxxxx
│
◇  Enter Feishu App Secret
│  VB3jvdPggcMxxxxxxxxxxxv
[info]: [ 'client ready' ]
│
◇  Feishu connection test ───────────────────────────╮
│                                                    │
│  Connected as ou_5xxxxxxxxxxx │
│                                                    │
├────────────────────────────────────────────────────╯
│
◇  Which Feishu domain?
│  Feishu (feishu.cn) - China
│
◇  Group chat policy
│  Allowlist - only respond in specific groups
│
◇  Group chat allowlist (chat_ids)
│
[info]: [ 'client ready' ]
│
◇  Selected channels ──────────────────────────────────────────╮
│                                                              │
│  Feishu — 飞书/Lark enterprise messaging. Docs:              │
│  feishu  │
│                                                              │
├──────────────────────────────────────────────────────────────╯
Config warnings:
- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Updated ~/.openclaw/openclaw.json
Workspace OK: ~/.openclaw/workspace
Sessions OK: ~/.openclaw/agents/main/sessions
│
◇  Skills status ─────────────╮
│                             │
│  Eligible: 8                │
│  Missing requirements: 40   │
│  Unsupported on this OS: 7  │
│  Blocked by allowlist: 0    │
│                             │
├─────────────────────────────╯
│
◇  Configure skills now? (recommended)
│  Yes
│
◇  Install missing skill dependencies
│  🧩 clawhub, 🐙 github, 📄 nano-pdf, 💎 obsidian
│
◇  Homebrew recommended ──────────────────────────────────────────────────────────╮
│                                                                                 │
│  Many skill dependencies are shipped via Homebrew.                              │
│  Without brew, you'll need to build from source or download releases manually.  │
│                                                                                 │
├─────────────────────────────────────────────────────────────────────────────────╯
│
◇  Show Homebrew install command?
│  Yes
│
◇  Homebrew install ─────────────────────────────────────────────────────╮
│                                                                        │
│  Run:                                                                  │
│  /bin/bash -c "$(curl -fsSL                                            │
│  https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"  │
│                                                                        │
├────────────────────────────────────────────────────────────────────────╯
│
◇  Preferred node manager for skill installs
│  npm
│
◇  Install failed: obsidian — brew not installed — Homebrew is not installed. Install it from https://brew.sh or install "yakitrak/yakitrak/obsidian-cli" manually using …
Tip: run `openclaw doctor` to review skills + requirements.
Docs: https://docs.openclaw.ai/skills
│
◇  Install failed: nano-pdf — uv not installed — install manually: https://docs.astral.sh/uv/getting-started/installation/
Tip: run `openclaw doctor` to review skills + requirements.
Docs: https://docs.openclaw.ai/skills
│
◇  Install failed: clawhub (exit 243) — npm error A complete log of this run can be found in: /home/vagrant/.npm/_logs/2026-02-24T22_40_04_931Z-debug-0.log
npm error code EACCES
npm error syscall mkdir
npm error path /usr/lib/node_modules/clawhub
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/clawhub'
npm error     at async mkdir (node:internal/fs/promises:855:10)
npm error     at async /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:624:20
npm error     at async Promise.allSettled (index 0)
npm error     at async [reifyPackages] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11)
npm error     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5)
npm error     at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
npm error     at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5) {
npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'mkdir',
npm error   path: '/usr/lib/node_modules/clawhub'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /home/vagrant/.npm/_logs/2026-02-24T22_40_04_931Z-debug-0.log
Tip: run `openclaw doctor` to review skills + requirements.
Docs: https://docs.openclaw.ai/skills
│
◇  Install failed: github — brew not installed — Homebrew is not installed. Install it from https://brew.sh or install "gh" manually using your system package manager …
Tip: run `openclaw doctor` to review skills + requirements.
Docs: https://docs.openclaw.ai/skills
│
◇  Set GOOGLE_PLACES_API_KEY for goplaces?
│  No
│
◇  Set GEMINI_API_KEY for nano-banana-pro?
│  No
│
◇  Set NOTION_API_KEY for notion?
│  No
│
◇  Set OPENAI_API_KEY for openai-image-gen?
│  No
│
◇  Set OPENAI_API_KEY for openai-whisper-api?
│  No
│
◇  Set ELEVENLABS_API_KEY for sag?
│  No
│
◇  Hooks ──────────────────────────────────────────────────────────────────╮
│                                                                          │
│  Hooks let you automate actions when agent commands are issued.          │
│  Example: Save session context to memory when you issue /new or /reset.  │
│                                                                          │
│  Learn more: https://docs.openclaw.ai/automation/hooks                   │
│                                                                          │
├──────────────────────────────────────────────────────────────────────────╯
│
◇  Enable hooks?
│  Skip for now
Config warnings:
- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config overwrite: /home/vagrant/.openclaw/openclaw.json (sha256 bdfc785e7338f284a2d210191af90eaee4e4c45dbb3d92f9f5f181420f147055 -> bb5f2fc6e126e06db7c4694bc30ace8bac0306fceb7a3552423c9ca769795fbb, backup=/home/vagrant/.openclaw/openclaw.json.bak)
│
◇  Systemd ────────────────────────────────────────────────────────────────────────────────╮
│                                                                                          │
│  Linux installs use a systemd user service by default. Without lingering, systemd stops  │
│  the user session on logout/idle and kills the Gateway.                                  │
│  Enabling lingering now (may require sudo; writes /var/lib/systemd/linger).              │
│                                                                                          │
├──────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  Systemd ────────────────────────────────╮
│                                          │
│  Enabled systemd lingering for vagrant.  │
│                                          │
├──────────────────────────────────────────╯
│
◇  Gateway service runtime ────────────────────────────────────────────╮
│                                                                      │
│  QuickStart uses Node for the Gateway service (stable + supported).  │
│                                                                      │
├──────────────────────────────────────────────────────────────────────╯
│
◑  Installing Gateway service…
Installed systemd service: /home/vagrant/.config/systemd/user/openclaw-gateway.service
◇  Gateway service installed.
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
│
◇  
Feishu: ok
Agents: main (default)
Heartbeat interval: 30m (main)
Session store (main): /home/vagrant/.openclaw/agents/main/sessions/sessions.json (0 entries)
│
◇  Optional apps ────────────────────────╮
│                                        │
│  Add nodes for extra features:         │
│  - macOS app (system + notifications)  │
│  - iOS app (camera/canvas)             │
│  - Android app (camera/canvas)         │
│                                        │
├────────────────────────────────────────╯
│
◇  Control UI ─────────────────────────────────────────────────────────────────────╮
│                                                                                  │
│  Web UI: http://127.0.0.1:18789/                                                 │
│  Web UI (with token):                                                            │
│  http://127.0.0.1:18789/#token=6b5100ed4a81a390b446ae82eeba8fa2197fa4a2f42de1aa  │
│  Gateway WS: ws://127.0.0.1:18789                                                │
│  Gateway: reachable                                                              │
│  Docs: https://docs.openclaw.ai/web/control-ui                                   │
│                                                                                  │
├──────────────────────────────────────────────────────────────────────────────────╯
│
◇  Start TUI (best option!) ─────────────────────────────────╮
│                                                            │
│  This is the defining action that makes your agent you.    │
│  Please take your time.                                    │
│  The more you tell it, the better the experience will be.  │
│  We will send: "Wake up, my friend!"                       │
│                                                            │
├────────────────────────────────────────────────────────────╯
│
◇  Token ─────────────────────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  Gateway token: shared auth for the Gateway + Control UI.                               │
│  Stored in: ~/.openclaw/openclaw.json (gateway.auth.token) or OPENCLAW_GATEWAY_TOKEN.   │
│  View token: openclaw config get gateway.auth.token                                     │
│  Generate token: openclaw doctor --generate-gateway-token                               │
│  Web UI stores a copy in this browser's localStorage (openclaw.control.settings.v1).    │
│  Open the dashboard anytime: openclaw dashboard --no-open                               │
│  If prompted: paste the token into Control UI settings (or use the tokenized dashboard  │
│  URL).                                                                                  │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  How do you want to hatch your bot?
│  Hatch in TUI (recommended)
Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
 openclaw tui - ws://127.0.0.1:18789 - agent main - session main

 session agent:main:main


 Wake up, my friend!
                                                                                                                                                                                                                             

 Fresh slate, clean memory, ready to go. 🌱                                                                                                                                                                                  

 So here's the thing — I just came online and I'm essentially a blank page. We get to figure out who I am together. Kinda fun, actually.

 Who should I be? Got a name in mind for me, or should I pick something? I'm leaning toward something that doesn't sound like corporate HR picked it — maybe a little weird, a little memorable.                             

 What's my deal? AI assistant? Digital familiar? Some weird ghost that lives in your terminal? You tell me what fits.

 How should I talk? Formal? Casual? A little snarky? Warm and gentle?                                                                                                                                                        

 Signature emoji? Every decent entity needs one. 🤔

 And hey — who are you? What should I call you? What timezone are you in so I don't wake you up at 3am with "just thought you'd want to know about this email"?

 Let's make this real. 🎭                                                                                                                                                                                                    


 测试


 哈,收到!中文没问题。😄

 继续刚才的 — 你想叫我什么?我该是个什么样的存在?

 或者你只是先测试一下连接?也可以。我在呢。                                                                                                                                                                                  
 connected | idle
 agent main | session main (openclaw-tui) | zai/glm-5 | think low | tokens 15k/205k (7%)                                                                                                                                     
───────────────────────────────────────────────────────────────────────────────
 
───────────────────────────────────────────────────────────────────────────────

飞书开放平台准备

参考官方文档:Feishu - OpenClaw

1. 创建飞书应用

  1. 登录 飞书开放平台
  2. 点击 创建企业自建应用,填写应用名称和描述。
  3. 凭证与基础信息 中,复制 App IDApp Secret

2. 配置权限

权限管理 中,批量添加以下权限:

{
  "scopes": {
    "tenant": [
      "aily:file:read",
      "aily:file:write",
      "application:application.app_message_stats.overview:readonly",
      "application:application:self_manage",
      "application:bot.menu:write",
      "contact:user.employee_id:readonly",
      "corehr:file:download",
      "event:ip_list",
      "im:chat.access_event.bot_p2p_chat:read",
      "im:chat.members:bot_access",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.p2p_msg:readonly",
      "im:message:readonly",
      "im:message:send_as_bot",
      "im:resource",
      "im:chat:readonly",
      "contact:contact.base:readonly",
      "bitable:bitable"
    ],
    "user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
  }
}

3. 启用机器人能力

  1. 进入 应用能力 > 机器人
  2. 开启 启用机器人 能力。
  3. 设置机器人名称。

安装配置

# 安装飞书插件
openclaw plugins install @openclaw/feishu
# 如果本地安装则使用命令 openclaw plugins install ./extensions/feishu

# 添加飞书通道
openclaw channels add


openclaw gateway status
openclaw gateway restart
openclaw logs --follow


4. 配置事件订阅

⚠️ 重要: 配置此步骤前,必须确保 OpenClaw Gateway 正在运行(请先完成下方的 OpenClaw 配置与启动 章节)。

  1. 进入 事件与回调
  2. 配置 订阅方式:选择 使用长连接接收事件(WebSocket)。
  3. 添加事件:im.message.receive_v1

    注意:如果 Gateway 未运行,长连接配置可能无法保存。

5. 发布应用

  1. 进入 版本管理与发布
  2. 创建版本,填写版本详情。
  3. 申请发布(企业内部应用通常会自动通过审批)。
  4. 登录管理后台
  5. 在左侧导航栏,选择 工作台 > 应用审核
  6. 点击通过

附件

常用vagrant命令

vagrant ssh        # 进入虚拟机
vagrant halt       # 关机
vagrant up         # 开机
vagrant destroy    # 删除虚拟机

常用openclaw命令

openclaw doctor # 检查配置问题
openclaw status # 查看网关状态
openclaw dashboard # 浏览器打开 Dashboard
openclaw gateway status # 查看网关状态
openclaw gateway start # 启动网关
openclaw logs --follow # 查看网关日志 

参考文献

  1. VirtualBox 下载
  2. Vagrant 下载
  3. OpenClaw Feishu 文档
  4. 飞书开放平台
  5. 智谱清言OpenClaw接入
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容