热爱技术,追求卓越
不断求索,精益求精

玩玩clawdbot,源码编译运行

最近,一款名为 Clawdbot 的人工智能工具在各大社交媒体上刷屏,成为硅谷的新晋热词。短短时间内,这款工具开源后就收获了 31.5k Star,热度仍在持续攀升。

Clawdbot 是一款开源、以通讯为核心的人工智能助手,可在个人设备上运行,你能通过 WhatsApp、Telegram、Slack、Discord、Google Chat、Signal、iMessage、Microsoft Teams、WebChat 等应用与其沟通。

它不像 ChatGPT 那样偏向单次问答,更像是一位私人 AI 操作员——你可以像给同事或朋友发消息一样,通过通讯软件与其互动。目前,大多数用户选择通过 Telegram 与自己的私人 Clawdbot 聊天。

clawdbot相关地址

github地址:

https://github.com/clawdbot/clawdbot

文档地址:

https://docs.clawd.bot/

源码安装

前置条件:需要node.js版本22以上。

clone代码

git clone https://github.com/clawdbot/clawdbot.git

若无pnpm,则全局安装:

npm install -g pnpm

安装pnpm出现如下错误:

PS F:\dev\code\clawdbot> npm install -g pnpm
npm : 无法加载文件 F:\dev\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ npm install -g pnpm
+ ~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

这个错误是因为 PowerShell 的执行策略阻止了脚本运行。以管理员身份运行 PowerShell ,执行:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

输入 Y 确认更改,再安装pnpm。

用vscode打开项目代码,在vscode终端运行:

pnpm install

安装过程如下:

PS F:\dev\code\clawdbot> pnpm install
Scope: all 30 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1033
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Downloading clawdbot@2026.1.24-3: 12.86 MB/12.86 MB, done
Downloading @lydell/node-pty-win32-x64@1.2.0-beta.3: 7.30 MB/7.30 MB, done
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: F:\.pnpm-store\v10
  Virtual store is at:             node_modules/.pnpm
Downloading @wasm-audio-decoders/opus-ml@0.0.2: 6.39 MB/6.39 MB, done
Downloading @img/sharp-win32-x64@0.34.5: 8.69 MB/8.69 MB, done
Downloading ogg-opus-decoder@1.7.3: 6.87 MB/6.87 MB, done
Downloading pdfjs-dist@5.4.530: 9.88 MB/9.88 MB, done
Downloading @napi-rs/canvas-win32-x64-msvc@0.1.88: 15.69 MB/15.69 MB, done
Downloading node-llama-cpp@3.15.0: 28.03 MB/28.03 MB, done
Downloading @node-llama-cpp/win-x64@3.15.0: 6.83 MB/6.83 MB, done
Downloading @lancedb/lancedb-win32-x64-msvc@0.23.0: 48.90 MB/48.90 MB, done
Downloading @node-llama-cpp/win-x64-vulkan@3.15.0: 23.40 MB/23.40 MB, done
Downloading @node-llama-cpp/win-x64-cuda@3.15.0: 116.78 MB/116.78 MB, done
Downloading @typescript/native-preview-win32-x64@7.0.0-dev.20260124.1: 8.44 MB/8.44 MB, done
Downloading @rolldown/binding-win32-x64-msvc@1.0.0-rc.1: 8.38 MB/8.38 MB, done
Downloading @oxlint-tsgolint/win32-x64@0.11.1: 11.95 MB/11.95 MB, done
Downloading @node-llama-cpp/win-x64-cuda-ext@3.15.0: 191.97 MB/191.97 MB, done
Progress: resolved 1033, reused 297, downloaded 735, added 1033, done
node_modules/.pnpm/protobufjs@6.8.8/node_modules/protobufjs: Running postinstall script, done in 96ms
node_modules/.pnpm/sharp@0.34.5/node_modules/sharp: Running install script, done in 226ms
node_modules/.pnpm/esbuild@0.27.2/node_modules/esbuild: Running postinstall script, done in 385ms
node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs: Running postinstall script, done in 96ms
node_modules/.pnpm/protobufjs@8.0.0/node_modules/protobufjs: Running postinstall script, done in 75ms
node_modules/.pnpm/@matrix-org+matrix-sdk-crypto-nodejs@0.4.0/node_modules/@matrix-org/matrix-sdk-crypto-nodejs: Running postinstall script, done in 21.3s
node_modules/.pnpm/@whiskeysockets+baileys@7.0_f116e6060e428c73be68680ef2311927/node_modules/@whiskeysockets/baileys: Running preinstall script, done in 78ms
 WARN  Failed to create bin at F:\dev\code\clawdbot\extensions\line\node_modules\.bin\clawdbot. ENOENT: no such file or directory, stat 'F:\dev\code\clawdbot\dist\entry.js.EXE'
 WARN  Failed to create bin at F:\dev\code\clawdbot\extensions\googlechat\node_modules\.bin\clawdbot. ENOENT: no such file or directory, stat 'F:\dev\code\clawdbot\dist\entry.js.EXE'
 WARN  Failed to create bin at F:\dev\code\clawdbot\extensions\matrix\node_modules\.bin\clawdbot. ENOENT: no such file or directory, stat 'F:\dev\code\clawdbot\dist\entry.js.EXE'   
 WARN  Failed to create bin at F:\dev\code\clawdbot\extensions\nostr\node_modules\.bin\clawdbot. ENOENT: no such file or directory, stat 'F:\dev\code\clawdbot\dist\entry.js.EXE'    
 WARN  Failed to create bin at F:\dev\code\clawdbot\extensions\twitch\node_modules\.bin\clawdbot. ENOENT: no such file or directory, stat 'F:\dev\code\clawdbot\dist\entry.js.EXE'   
 WARN  3 other warnings

dependencies:
+ @agentclientprotocol/sdk 0.13.1
+ @aws-sdk/client-bedrock 3.975.0
+ @buape/carbon 0.14.0
+ @clack/prompts 0.11.0
+ @grammyjs/runner 2.0.3
+ @grammyjs/transformer-throttler 1.2.1
+ @homebridge/ciao 1.3.4
+ @line/bot-sdk 10.6.0
+ @lydell/node-pty 1.2.0-beta.3
+ @mariozechner/pi-agent-core 0.49.3
+ @mariozechner/pi-ai 0.49.3
+ @mariozechner/pi-coding-agent 0.49.3
+ @mariozechner/pi-tui 0.49.3
+ @mozilla/readability 0.6.0
+ @sinclair/typebox 0.34.47
+ @slack/bolt 4.6.0
+ @slack/web-api 7.13.0
+ @whiskeysockets/baileys 7.0.0-rc.9
+ ajv 8.17.1
+ body-parser 2.2.2
+ chalk 5.6.2
+ chokidar 5.0.0
+ chromium-bidi 13.0.1
+ cli-highlight 2.1.11
+ commander 14.0.2
+ croner 9.1.0
+ detect-libc 2.1.2
+ discord-api-types 0.38.37
+ dotenv 17.2.3
+ express 5.2.1
+ file-type 21.3.0
+ grammy 1.39.3
+ hono 4.11.4
+ jiti 2.6.1
+ json5 2.2.3
+ jszip 3.10.1
+ linkedom 0.18.12
+ long 5.3.2
+ markdown-it 14.1.0
+ node-edge-tts 1.2.9
+ osc-progress 0.3.0
+ pdfjs-dist 5.4.530
+ playwright-core 1.58.0
+ proper-lockfile 4.1.2
+ qrcode-terminal 0.12.0
+ sharp 0.34.5
+ sqlite-vec 0.1.7-alpha.2
+ tar 7.5.4
+ tslog 4.10.2
+ undici 7.19.0
+ ws 8.19.0
+ yaml 2.8.2
+ zod 4.3.6

optionalDependencies:
+ @napi-rs/canvas 0.1.88
+ node-llama-cpp 3.15.0

devDependencies:
+ @grammyjs/types 3.23.0
+ @lit-labs/signals 0.2.0
+ @lit/context 1.1.6
+ @mariozechner/mini-lit 0.2.1
+ @types/body-parser 1.19.6
+ @types/express 5.0.6
+ @types/markdown-it 14.1.2
+ @types/node 25.0.10
+ @types/proper-lockfile 4.1.4
 WARN  11 other warnings 0.12.2
+ @types/ws 8.18.1
+ @typescript/native-preview 7.0.0-dev.20260124.1
+ @vitest/coverage-v8 4.0.18
+ docx-preview 0.3.7
+ lit 3.3.2
+ lucide 0.563.0
+ ollama 0.6.3
+ oxfmt 0.26.0
+ oxlint 1.41.0
+ oxlint-tsgolint 0.11.1
+ quicktype-core 23.2.6
+ rolldown 1.0.0-rc.1
+ signal-utils 0.21.1
+ tsx 4.21.0
+ typescript 5.9.3
+ vitest 4.0.18
+ wireit 0.14.12

╭ Warning ───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                            │
│   Ignored build scripts: clawdbot, core-js, node-llama-cpp.                                │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.   │
│                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

. postinstall$ node scripts/postinstall.js
└─ Done in 200ms
Done in 10m 44.1s using pnpm v10.23.0
PS F:\dev\code\clawdbot> 

运行命令安装UI依赖项:

pnpm ui:build

执行结果:

PS F:\dev\code\clawdbot> pnpm ui:build

> clawdbot@2026.1.25 ui:build F:\dev\code\clawdbot
> node scripts/ui.js build


> clawdbot-control-ui@ build F:\dev\code\clawdbot\ui
> vite build

vite v7.3.1 building client environment for production...
✓ 115 modules transformed.
../dist/control-ui/index.html                   0.52 kB │ gzip:  0.31 kB
../dist/control-ui/assets/index-CjW_qQ45.css   74.84 kB │ gzip: 13.13 kB
../dist/control-ui/assets/index-BpF4fdeM.js   351.30 kB │ gzip: 93.56 kB │ map: 988.47 kB
✓ built in 757ms

运行构建命令:

pnpm build

执行如下:

PS F:\dev\code\clawdbot> pnpm build

> clawdbot@2026.1.25 build F:\dev\code\clawdbot
> tsc -p tsconfig.json && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts

[copy-hook-metadata] Copied boot-md/HOOK.md
[copy-hook-metadata] Copied command-logger/HOOK.md
[copy-hook-metadata] Copied session-memory/HOOK.md
[copy-hook-metadata] Copied soul-evil/HOOK.md
[copy-hook-metadata] Done

由于源码构建后未全局安装,所以从代码目录中通过 pnpm执行安装守护进程:

pnpm clawdbot onboard --install-daemon

执行结果如下:

PS F:\dev\code\clawdbot> pnpm clawdbot onboard --install-daemon

> clawdbot@2026.1.25 clawdbot F:\dev\code\clawdbot
> node scripts/run-node.mjs "onboard" "--install-daemon"

[clawdbot] Building TypeScript (dist is stale).

🦞 Clawdbot 2026.1.25 (481bd33) — We ship features faster than Apple ships calculator updates.

Windows detected.
WSL2 is strongly recommended; native Windows is untested and more problematic.
Guide: https://docs.clawd.bot/windows
░████░█░░░░░█████░█░░░█░███░░████░░████░░▀█▀
█░░░░░█░░░░░█░░░█░█░█░█░█░░█░█░░░█░█░░░█░░█░
█░░░░░█░░░░░█████░█░█░█░█░░█░████░░█░░░█░░█░
█░░░░░█░░░░░█░░░█░█░█░█░█░░█░█░░█░░█░░░█░░█░
░████░█████░█░░░█░░█░█░░███░░████░░░███░░░█░
              🦞 FRESH DAILY 🦞
┌  Clawdbot onboarding
│
◇  Security ──────────────────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  Security warning — please read.                                                        │
│                                                                                         │
│  Clawdbot 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 Clawdbot.  │
│  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:                                                                         │
│  clawdbot security audit --deep                                                         │
│  clawdbot security audit --fix                                                          │
│                                                                                         │
│  Must read: https://docs.clawd.bot/gateway/security                                     │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯
│
◆  I understand this is powerful and inherently risky. Continue?
│  ○ Yes / ● No

选择 Yes 后, Enter继续。

Onboarding mode,选择:

● Manual (Configure port, network, Tailscale, and auth options.)

接下来的步骤:

◇  Onboarding mode
│  Manual
│
◇  Existing config detected ─────────╮
│                                    │
│  workspace: ~\clawd                │
│  model: anthropic/claude-opus-4-5  │
│  gateway.mode: local               │
│  gateway.port: 18789               │
│  gateway.bind: loopback            │
│                                    │
├────────────────────────────────────╯
│
◇  Config handling
│  Reset
│
◇  Reset scope
│  Full reset (config + creds + sessions + workspace)
Failed to move to Trash (manual delete): C:\Users\ASUS\.clawdbot\clawdbot.json
Failed to move to Trash (manual delete): C:\Users\ASUS\.clawdbot\agents\main\sessions
Failed to move to Trash (manual delete): C:\Users\ASUS\clawd
│
◇  What do you want to set up?
│  Local gateway (this machine)
│
◆  Workspace directory
│  F:\clawdbot_workspace█

按照操作提示进行即可。

赞(0)
未经允许不得转载:LoveCTO » 玩玩clawdbot,源码编译运行

热爱技术 追求卓越 精益求精