clawby 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +68 -12
  2. package/dist/clawby.js +96 -62
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -2,17 +2,19 @@
2
2
 
3
3
  Clawby 的命令行客户端。一把 Clawby 的 key,就能把 Clawby 技能装到本机、保持更新、检查风险,并调用 Clawby 的全部数据接口。
4
4
 
5
- > **In English, briefly.** `clawby` is the command-line client of [Clawby](https://www.openclawby.com), the
5
+ > **In English, briefly.** `clawby` is the command-line client of [Clawby](https://www.clawby.xyz), the
6
6
  > financial data layer for AI agents. With one Clawby key it installs the Clawby skill and its modules, keeps
7
7
  > them up to date, scans them for risks, and calls every data interface through Clawby's relay. In a shell that
8
8
  > is not a terminal every command prints exactly one JSON object on stdout and exits with a code that says what
9
- > to do next, so an agent can drive it. `npm install -g clawby`, then `clawby login` and `clawby install`.
9
+ > to do next, so an agent can drive it. `clawby install` links the skill into every agent it finds on the machine
10
+ > (Claude Code, Codex, Cursor, Gemini CLI, OpenCode and some seventy more), and `clawby mcp` serves the same
11
+ > commands as MCP tools to an agent that has no shell. `npm install -g clawby`, then `clawby login` and `clawby install`.
10
12
  > `clawby help` and `clawby <command> --help` are in English or Chinese, by the machine's locale.
11
13
 
12
14
  ```
13
15
  npm install -g clawby # 需要 Node 20 或更新
14
16
  clawby login # 粘贴 key,或者用邮箱验证码登录(第一次登录即注册)
15
- clawby install # 安装技能和官方模块,并接到 Claude Code
17
+ clawby install # 安装技能和官方模块,并接到这台机器上的 agent(Claude Code、Codex、Cursor……)
16
18
  ```
17
19
 
18
20
  这个包只有一个文件(`dist/clawby.js`),没有任何依赖,安装时不运行任何脚本。
@@ -27,8 +29,8 @@ clawby install # 安装技能和官方模块,并接到 Claude Code
27
29
  | **调用接口** | `search` `describe` `call` `batch` | 三百多个数据接口走同一个中转,客户端自己排队限速 |
28
30
 
29
31
  另外还有账户(`whoami` `usage` `key` `email` `rename` `points` `invites` `tasks` `membership`)、
30
- 保险库(`pin` `vault`)、记忆备份(`memory`)和发布(`publish` `unpublish`)。`clawby help` 列出全部,
31
- `clawby <命令> --help` 是每条命令的用法。
32
+ 保险库(`pin` `vault`)、记忆备份(`memory`)、发布(`publish` `unpublish`)、读已安装的文档(`docs`)和 MCP 服务器(`mcp`)。
33
+ `clawby help` 列出全部,`clawby <命令> --help` 是每条命令的用法。
32
34
 
33
35
  ## 调用数据接口
34
36
 
@@ -67,6 +69,42 @@ clawby batch calls.json # [{"name": "…", "p
67
69
  | 9 | 安全检查没过 | 不要绕过,把发现告诉用户 |
68
70
  | 10 | 这个客户端比 Clawby 允许的最低版本还旧 | 用户同意后 `clawby update --self` |
69
71
 
72
+ ### MCP 模式
73
+
74
+ 没有 shell、只会调用工具的 agent,把 `clawby mcp` 注册成 MCP 服务器,用的是同一套命令:
75
+
76
+ ```
77
+ claude mcp add clawby -- clawby mcp # Claude Code
78
+ codex mcp add clawby -- clawby mcp # Codex
79
+ ```
80
+
81
+ 读 JSON 配置的客户端(Cursor、Gemini CLI、Windsurf……):
82
+
83
+ ```json
84
+ {"mcpServers": {"clawby": {"command": "clawby", "args": ["mcp"]}}}
85
+ ```
86
+
87
+ | 组 | 工具 | 对应的命令 |
88
+ |---|---|---|
89
+ | `data` | `search_interfaces` `describe_interface` `call_interface` `call_batch` | `search` `describe` `call` `batch` |
90
+ | `account` | `whoami` `usage` `vault_list` | `whoami` `usage` `vault list` |
91
+ | `modules` | `list_installed` `search_modules` `module_info` `add_module` `remove_module` `update_modules` `install_skill` | `list` `modules search` `modules info` `add` `remove` `update` `install` |
92
+ | `docs` | `read_docs` | `docs` |
93
+ | `safety` | `audit` `doctor` | `audit` `doctor` |
94
+
95
+ - **每个工具就是一条命令。** 返回的是那条命令的 JSON 对象,规则也是那条命令自己的:参数不对先被拒绝(不计调用)、
96
+ 客户端自己排队限速、太长的结果只给概要。批量调用里部分失败不算工具失败,每一条各有自己的 `ok`。
97
+ - **key 不经过 agent。** 服务器用本机保存的 key(先 `clawby login`)。没有任何工具会显示 key,也没有工具接收 key 或 PIN。
98
+ 登录、输入 PIN、打开保险库(`vault run`)、记忆备份、发布都**不做成工具**:这些要用户自己在终端里运行,工具会如实告诉 agent。
99
+ 工具不会启动任何程序。
100
+ - **装别人上传的模块仍然要用户同意。** `add_module` 不带 `confirmed: true` 会以 `confirmation_required` 结束,并给出上传者、
101
+ 扫描发现、它提到的域名;有高危发现时 `confirmed` 不够,必须用 `accept_risk` 点名那个版本。
102
+ - **`read_docs`** 让打不开文件的 agent 读技能文档(就是 `clawby docs`):只读出 Clawby 官方发布的文件,读之前先和安装时的校验值核对,
103
+ 之后被改过的文件不读出来;别人上传的模块不读出来,只告诉用户文件在哪。
104
+ - 工具调用一个一个排队执行,`ping` 和列工具不用等。客户端断开后,正在执行的那一条做完就退出,排着队的不再开始。
105
+ - `clawby mcp --tools data,docs` 只提供其中几组:每个工具的说明都占 agent 的上下文,只取数据的用户可以少开几组。
106
+ - 支持 MCP 协议 2024-11-05、2025-03-26、2025-06-18、2025-11-25(stdio)。
107
+
70
108
  ## 技能和模块
71
109
 
72
110
  技能是一个文件夹,真正的那一份在 `~/.clawby/skill`:
@@ -78,11 +116,27 @@ SKILL.md api/ mcp/ templates/ exec/ scripts/ reports/ ← 模
78
116
 
79
117
  - `clawby install` 装技能本身(`SKILL.md` 和每个目录的说明)以及 Clawby 官方的 API 文档、MCP、报告模板、执行器。
80
118
  脚本不会自动装,要 `clawby add scripts/<名字>`,或者 `clawby install --with-scripts`。
81
- - 检测到 `~/.claude` 就把 `~/.claude/skills/clawby` **链接**到这一份。别的 agent 用 `--dir <目录>`;不能用链接的地方加 `--copy`。
82
- 那个位置已经有别人的东西时不会覆盖,除非加 `--force`(原来的东西挪到 `~/.clawby/backup`,不删)。
119
+ - **自动接到这台机器上的 agent。** `clawby install` 按各 agent 的配置目录判断这台机器上装了哪些,在每个 agent 找技能的目录里
120
+ 放一个指向这一份的**链接**(见下面「认识哪些 agent」)。之后新装了 agent,再运行一次 `clawby install`;
121
+ `clawby doctor` 会列出每个 agent 接上了没有。
122
+ - `--agent <id>` 只接指定的(可以给多次,没检测到也照接);`--no-link` 一个都不接。
123
+ - 不认识的 agent 用 `--dir <它的技能目录>/clawby`。不跟随链接的地方用复制:`clawby install --dir <目录> --copy`
124
+ (复制的那份每次安装、更新时同步)。
125
+ - 那个位置已经有别人的东西时不会覆盖,除非加 `--force`(原来的东西挪到 `~/.clawby/backup`,不删)。
83
126
  - 模块更新时整个文件夹替换。用户手改过的内容不会丢:挪到 `~/.clawby/backup/`。`memory/`、`local/` 和用户自己建的文件夹不会被动。
84
127
  - 装下来的文件一律不带可执行权限。
85
128
 
129
+ ### 认识哪些 agent
130
+
131
+ 一共 73 种,按它们各自的配置目录是否存在来判断(`CLAUDE_CONFIG_DIR`、`CODEX_HOME`、`XDG_CONFIG_HOME` 这类环境变量照认)。
132
+
133
+ - **在自己的目录里找技能的**(各放一个链接,例如 Claude Code 是 `~/.claude/skills/clawby`):
134
+ `claude-code` `openclaw` `windsurf` `goose` `antigravity` `qwen-code` `iflow-cli` `trae` `trae-cn` `qoder` `qoder-cn` `codebuddy` `lingma` `minimax-code` `roo` `kiro-cli` `hermes-agent` `grok` `mistral-vibe` `augment` `continue` `crush` `junie` `openhands` `devin` `cortex` `forgecode` `aider-desk` `autohand-code` `bob` `codearts-agent` `codemaker` `codestudio` `command-code` `inference-sh` `jazz` `kode` `mcpjam` `moxby` `mux` `neovate` `ona` `pochi` `adal` `posit-assistant` `reasonix` `rovodev` `tabnine-cli` `terramind` `tinycloud` `zcode` `zencoder` `astrbot` `kimchi`
135
+ - **共用 `~/.agents/skills` 的**(只在那里放一个链接,所以技能不会出现两份):
136
+ `codex` `cursor` `gemini-cli` `opencode` `github-copilot` `amp` `cline` `droid` `kilo` `kimi-code-cli` `pi` `warp` `zed` `deepagents` `dexto` `firebender` `fx` `loaf` `sarvam-code`
137
+
138
+ 上面的写法就是 `--agent` 用的 id。各 agent 读哪个目录,依据的是 [vercel-labs/skills](https://github.com/vercel-labs/skills) 整理的清单。
139
+
86
140
  ### 一个模块从仓库到本机要过的关
87
141
 
88
142
  不管谁发布的,顺序相同,任何一步不过都不会写入任何文件:
@@ -100,6 +154,8 @@ SKILL.md api/ mcp/ templates/ exec/ scripts/ reports/ ← 模
100
154
  - 它声明依赖的别人的模块不会跟着装,只装它依赖的官方模块。
101
155
  7. 写入时用 Clawby 的记录生成 `module.json`(包里自带的那份不算数),并把每个文件的哈希记到 `~/.clawby/lock.json`。
102
156
 
157
+ 这几关保证的是:装下来的就是 Clawby 记录的那个压缩包(大小和 SHA-256 一致),并且过了本机的扫描。
158
+
103
159
  ### 扫描看什么
104
160
 
105
161
  扫描只读文件的文字,不运行任何东西。规则版本记在 `lock.json` 里,规则更新后 `clawby audit` 会按新规则重看。
@@ -125,7 +181,7 @@ clawby audit # 退出码 9 = 有高危
125
181
  clawby audit --fix # 顺手把权限过宽的文件收紧
126
182
  clawby audit --offline # 不联网,只查本机
127
183
  clawby audit --strict # 中等发现也算不通过
128
- clawby doctor # 体检:Node、代理、能否连上、key、技能、Claude Code 的链接
184
+ clawby doctor # 体检:Node、代理、能否连上、key、技能、每个 agent 接上了没有
129
185
  ```
130
186
 
131
187
  `audit` 查三方面:
@@ -209,14 +265,14 @@ clawby unpublish scripts/my-script@1.0.0 --yes
209
265
  out/ 太长的调用结果
210
266
  ```
211
267
 
212
- 卸载:`npm uninstall -g clawby`,再删掉 `~/.clawby` 和 `~/.claude/skills/clawby` 这个链接。
268
+ 卸载:`npm uninstall -g clawby`,再删掉 `~/.clawby`,以及各 agent 技能目录里那个叫 `clawby` 的链接
269
+ (卸载前 `clawby list --json` 的 `links` 列出了全部位置)。
213
270
 
214
271
  ## 还没做
215
272
 
216
- - 上传时服务器端的扫描、官方模块的签名:现在的保证是「拿到的就是 Clawby 记录的那个压缩包」,靠 SHA-256。
217
- - MCP 模式、`clawby migrate`(从旧的 clawby-data 技能迁移)。
218
- - 除 Claude Code 之外其它 agent 的自动识别(现在用 `--dir`)。
219
273
  - X 账号绑定、SBT 验证、钱包登录:这些要浏览器或钱包,在网页上做。
274
+ - MCP 协议的 2026-07-28 版(没有握手、每个请求自带版本):收到这种请求会回答支持哪几个版本。
275
+ - 替 agent 改它的 MCP 配置:注册 `clawby mcp` 要用户自己运行上面那一行。
220
276
 
221
277
  ## License
222
278