实践之openclaw

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$ curl -fsSL https://openclaw.ai/install.sh | bash

  🦞 OpenClaw Installer
  If something's on fire, I can't extinguish it—but I can write a beautiful postmortem.

✓ Detected: macos

Install plan
OS: macos
Install method: npm
Requested version: latest
· Existing OpenClaw installation detected, upgrading

[1/3] Preparing environment
✓ Homebrew already installed
✓ Node.js v24.14.0 found
· Active Node.js: v24.14.0 (/Users/ray/.nvm/versions/node/v24.14.0/bin/node)
· Active npm: 11.9.0 (/Users/ray/.nvm/versions/node/v24.14.0/bin/npm)

[2/3] Installing OpenClaw
✓ Git already installed
· Installing OpenClaw v2026.3.23-2
✓ OpenClaw npm package installed
✓ OpenClaw installed

[3/3] Finalizing setup
· Running doctor to migrate settings
✓ Doctor complete

🦞 OpenClaw installed successfully (OpenClaw 2026.3.23-2 (7ffe7e4))!
Update complete. I learned some new tricks while I was out.

· Upgrade complete
· Running openclaw doctor

🦞 OpenClaw 2026.3.23-2 (7ffe7e4) — If something's on fire, I can't extinguish it—but I can write a beautiful postmortem.

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                  🦞 OPENCLAW 🦞                    
 
┌  OpenClaw doctor
│
◇  Gateway ──────────────────────────────────────────────────────────╮
│                                                                    │
│  gateway.mode is unset; gateway start will be blocked.             │
│  Fix: run openclaw configure and set Gateway mode (local/remote).  │
│  Or set directly: openclaw config set gateway.mode local           │
│  Missing config: run openclaw setup first.                         │
│                                                                    │
├────────────────────────────────────────────────────────────────────╯
│
◇  Gateway auth ──────────────────────────────────────────────────────────────────────╮
│                                                                                     │
│  Gateway auth is off or missing a token. Token auth is now the recommended default  │
│  (including loopback).                                                              │
│                                                                                     │
├─────────────────────────────────────────────────────────────────────────────────────╯
│
◆  Generate and configure a gateway token now?
│  ● Yes / ○ No
└

run onboarding

1
$ openclaw onboard --install-daemon

verify the gateway is running

1
$ openclaw gateway status/restart

open the dashboard

1
$ openclaw dashboard
1
2
$ openclaw channels add
$ openclaw channels status --probe

飞书开放平台

1
$ openclaw pairing approve feishu 9NXNRWNA

~/.openclaw/openclaw.json

1
2
$ openclaw configure
$ openclaw configure --section model

创建 OpenClaw agent

方式一:通过 CLI 创建(推荐)

1. 创建新 agent:

1
openclaw agents add <name> --workspace ~/.openclaw/workspace-<name>

2. 绑定到特定渠道(可选):

1
openclaw agents add work --workspace ~/.openclaw/workspace-work --bind telegram:* --bind discord:*

3. 查看所有 agent:

1
openclaw agents list

4. 管理路由绑定:

1
2
3
openclaw agents bindings          # 查看当前绑定
openclaw agents bind --agent work --bind telegram:ops   # 绑定渠道
openclaw agents unbind --agent work --bind telegram:ops  # 解绑

方式二:直接编辑配置文件

~/.openclaw/openclaw.json 中的 agents.list 添加:

{
  agents: {
    list: [
      {
        id: "work",
        workspace: "~/.openclaw/workspace-work",
        identity: {
          name: "工作助手",
          emoji: "💼"
        }
      }
    ]
  }
}

设置 identity

在对应 workspace 里创建 IDENTITY.md

1
2
3
4
# IDENTITY.md - Who Am I?

- **Name:** 工作助手
- **Emoji:** 💼

或者用 CLI:

1
openclaw agents set-identity --agent work --name "工作助手" --emoji "💼" --from-identity

最小步骤只需要:

1
openclaw agents add myagent --workspace ~/.openclaw/workspace-myagent

每个 agent 有独立的 workspace(AGENTS.md、SOUL.md、USER.md 等)、独立 session 存储和路由绑定。