@eevee-ta/cli 0.1.0-beta.1
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.
- package/README.md +492 -0
- package/assets/skills/eevee-mcp/SKILL.md +127 -0
- package/assets/skills/eevee-mcp/reference.md +105 -0
- package/assets/skills/eevee-migration/SKILL.md +181 -0
- package/assets/skills/eevee-project-setup/SKILL.md +266 -0
- package/dist/src/bin/cli.js +237 -0
- package/dist/src/bin/cli.js.map +1 -0
- package/dist/src/commands/business-command.js +340 -0
- package/dist/src/commands/business-command.js.map +1 -0
- package/dist/src/commands/config-command.js +71 -0
- package/dist/src/commands/config-command.js.map +1 -0
- package/dist/src/commands/intl-command.js +131 -0
- package/dist/src/commands/intl-command.js.map +1 -0
- package/dist/src/commands/lint-command.js +105 -0
- package/dist/src/commands/lint-command.js.map +1 -0
- package/dist/src/commands/mcp-command.js +167 -0
- package/dist/src/commands/mcp-command.js.map +1 -0
- package/dist/src/commands/skill-command.js +116 -0
- package/dist/src/commands/skill-command.js.map +1 -0
- package/dist/src/lib/args.js +77 -0
- package/dist/src/lib/args.js.map +1 -0
- package/dist/src/lib/business-catalog.js +445 -0
- package/dist/src/lib/business-catalog.js.map +1 -0
- package/dist/src/lib/config.js +69 -0
- package/dist/src/lib/config.js.map +1 -0
- package/dist/src/lib/intl-catalog.js +58 -0
- package/dist/src/lib/intl-catalog.js.map +1 -0
- package/dist/src/lib/intl-config.js +125 -0
- package/dist/src/lib/intl-config.js.map +1 -0
- package/dist/src/lib/intl-downloader.js +217 -0
- package/dist/src/lib/intl-downloader.js.map +1 -0
- package/dist/src/lib/intl-serializers/csv.js +25 -0
- package/dist/src/lib/intl-serializers/csv.js.map +1 -0
- package/dist/src/lib/intl-serializers/custom.js +23 -0
- package/dist/src/lib/intl-serializers/custom.js.map +1 -0
- package/dist/src/lib/intl-serializers/index.js +22 -0
- package/dist/src/lib/intl-serializers/index.js.map +1 -0
- package/dist/src/lib/intl-serializers/js.js +10 -0
- package/dist/src/lib/intl-serializers/js.js.map +1 -0
- package/dist/src/lib/intl-serializers/json.js +7 -0
- package/dist/src/lib/intl-serializers/json.js.map +1 -0
- package/dist/src/lib/intl-serializers/properties.js +43 -0
- package/dist/src/lib/intl-serializers/properties.js.map +1 -0
- package/dist/src/lib/intl-serializers/ts.js +16 -0
- package/dist/src/lib/intl-serializers/ts.js.map +1 -0
- package/dist/src/lib/intl-serializers/xml.js +21 -0
- package/dist/src/lib/intl-serializers/xml.js.map +1 -0
- package/dist/src/lib/json.js +40 -0
- package/dist/src/lib/json.js.map +1 -0
- package/dist/src/lib/lint-config.js +180 -0
- package/dist/src/lib/lint-config.js.map +1 -0
- package/dist/src/lib/lint-java.js +226 -0
- package/dist/src/lib/lint-java.js.map +1 -0
- package/dist/src/lib/lint-types.js +2 -0
- package/dist/src/lib/lint-types.js.map +1 -0
- package/dist/src/lib/lint-web.js +183 -0
- package/dist/src/lib/lint-web.js.map +1 -0
- package/dist/src/lib/lint.js +192 -0
- package/dist/src/lib/lint.js.map +1 -0
- package/dist/src/lib/mcp-client.js +185 -0
- package/dist/src/lib/mcp-client.js.map +1 -0
- package/dist/src/lib/output.js +34 -0
- package/dist/src/lib/output.js.map +1 -0
- package/dist/src/lib/skill-installer.js +123 -0
- package/dist/src/lib/skill-installer.js.map +1 -0
- package/dist/src/lib/tool-docs.js +66 -0
- package/dist/src/lib/tool-docs.js.map +1 -0
- package/dist/src/lib/types.js +2 -0
- package/dist/src/lib/types.js.map +1 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
# @eevee/cli
|
|
2
|
+
|
|
3
|
+
`@eevee/cli` 是 eevee MCP 服务的业务化命令行客户端和 Agent Skill 管理工具。公开命令采用稳定 `<group> <action>` 规范;也可以继续使用完整 MCP 能力(tools/resources/prompts/request/notify)。CLI 可直接给 Codex、Claude Code 或其他终端 Agent 使用,也适合人工排查 eevee 数据。
|
|
4
|
+
|
|
5
|
+
运行时零依赖,只需要 Node.js 20.4+。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
本地开发或全局启用:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd eevee-cli
|
|
13
|
+
npm install
|
|
14
|
+
npm run build
|
|
15
|
+
npm link # 同时提供 eevee 和 eevee-cli 命令
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
已发布后从 npm 安装:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g @eevee/cli@latest
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
从本地仓库目录全局安装:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 配置服务器地址和 token
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
eevee config set --url http://127.0.0.1:10001/mcp
|
|
34
|
+
eevee config set --token <your-user-token>
|
|
35
|
+
eevee ping
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
也可以一次写入:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
eevee config set \
|
|
42
|
+
--url http://127.0.0.1:10001/mcp \
|
|
43
|
+
--token 00000000-0000-4000-8000-000000000001
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
默认配置文件是 `~/.eevee-cli/config.json`,权限为 `0600`。可用 `EEVEE_CLI_CONFIG=/path/config.json` 改变位置。
|
|
47
|
+
|
|
48
|
+
优先级:
|
|
49
|
+
|
|
50
|
+
1. 命令行:`--url` / `--token`
|
|
51
|
+
2. 环境:`EEVEE_MCP_URL` / `EEVEE_TOKEN`
|
|
52
|
+
3. 持久配置:`~/.eevee-cli/config.json`
|
|
53
|
+
4. URL 默认:`http://127.0.0.1:10001/mcp`
|
|
54
|
+
|
|
55
|
+
查看有效配置时 token 默认遮蔽;确认原始值时使用 `--reveal`:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
eevee config show
|
|
59
|
+
eevee config show --reveal
|
|
60
|
+
eevee config get token --reveal
|
|
61
|
+
eevee config unset --token
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
不要把真实 token 提交到代码仓库。需要更换时可调用服务端 `/api/v1/auth/reset-token` 后重新执行 `config set`。
|
|
65
|
+
|
|
66
|
+
## 命令总览
|
|
67
|
+
|
|
68
|
+
| 命令 | 说明 |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `eevee <group> <action>` | 推荐:执行 project、version、term、translation 等约 50 个业务动作 |
|
|
71
|
+
| `eevee business` / `eevee -h` | 查看全部业务命令;`-h` 会列全协议命令 |
|
|
72
|
+
| `eevee <group> <action> --help` | 查看该动作的 path/query/body 参数和类型 |
|
|
73
|
+
| `eevee config show/set/get/unset/path` | 管理服务器地址和用户 token |
|
|
74
|
+
| `eevee doctor` | 校验配置、MCP 连接、tools/list 和已装 Skill |
|
|
75
|
+
| `eevee ping` | 完成完整 MCP initialize 握手并调用 ping |
|
|
76
|
+
| `eevee tools list/docs/call` | 列出工具、展示详细用法、调用 MCP tool |
|
|
77
|
+
| `eevee resources ...` | list/templates/read/subscribe/unsubscribe |
|
|
78
|
+
| `eevee prompts ...` | list/get |
|
|
79
|
+
| `eevee request <method>` | 调用任意标准 MCP JSON-RPC method |
|
|
80
|
+
| `eevee notify <method>` | 发送 JSON-RPC notification |
|
|
81
|
+
| `eevee skills install/update/...` | 安装内置 Agent Skill 到 Claude/Codex/global 目录 |
|
|
82
|
+
| `eevee lint [files...]` | 本地国际化检查;`eslint-plugin-eevee/no-created` 的 CLI 迁移版 |
|
|
83
|
+
|
|
84
|
+
联网命令均支持临时覆盖:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
eevee --url https://staging.example.com/mcp \
|
|
88
|
+
--token <token> \
|
|
89
|
+
--timeout 30000 \
|
|
90
|
+
ping
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 本地国际化检查
|
|
94
|
+
|
|
95
|
+
`eevee lint` 把 `eslint-plugin-eevee` 的 `no-created` 规则迁移为本地检查器。Web 适配器直接解析
|
|
96
|
+
TypeScript AST,支持 `.ts`、`.tsx`、`.js`、`.jsx`、`.mjs` 和 `.cjs`,不依赖目标项目安装 ESLint:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
eevee lint
|
|
100
|
+
eevee lint apps/gaia/src
|
|
101
|
+
eevee lint --staged
|
|
102
|
+
eevee lint --source changed
|
|
103
|
+
eevee lint --language web --json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
检查配置优先读取 `.eevee-lint.json`、`.eeveerc.json`,然后读取 `package.json` 的 `eevee.lint`:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"eevee": {
|
|
111
|
+
"lint": {
|
|
112
|
+
"refresh": {
|
|
113
|
+
"config": "intl.download.json"
|
|
114
|
+
},
|
|
115
|
+
"languages": {
|
|
116
|
+
"web": {
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"root": ".",
|
|
119
|
+
"intlConfig": "intl.json",
|
|
120
|
+
"includes": ["apps/**/*.{ts,tsx,js,jsx}"],
|
|
121
|
+
"excludes": ["**/*.test.*", "**/mock/**"],
|
|
122
|
+
"excludeAscii": true,
|
|
123
|
+
"tagMatchMap": {
|
|
124
|
+
"apps/gaia/**/*": ["gaia"],
|
|
125
|
+
"apps/sso/**/*": ["sso"]
|
|
126
|
+
},
|
|
127
|
+
"excludeProperties": ["title", "description"],
|
|
128
|
+
"excludeTrack": true
|
|
129
|
+
},
|
|
130
|
+
"java": {
|
|
131
|
+
"enabled": true,
|
|
132
|
+
"root": ".",
|
|
133
|
+
"intlConfig": ".eevee/intl.json",
|
|
134
|
+
"includes": ["*/src/main/java/**/*.java"],
|
|
135
|
+
"excludes": ["**/src/test/**", "**/generated/**"],
|
|
136
|
+
"tagMatchMap": {
|
|
137
|
+
"*/src/main/java/**/*": ["server"]
|
|
138
|
+
},
|
|
139
|
+
"localeMethods": ["getLocaleMessage", "tryLocaleMessage", "getMessage"],
|
|
140
|
+
"checkHardcoded": true,
|
|
141
|
+
"excludeMethods": ["trace", "debug", "info", "warn", "error"]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`intlConfig` 复用旧插件的 `intl.json` 结构;CLI 只读取 `outPaths` 下的 `zh-CN*.json` 作为平台词条。
|
|
150
|
+
`excludePropertys` 和 `execludeTrack` 这两个旧拼写继续兼容,推荐新配置使用上面的规范拼写。
|
|
151
|
+
|
|
152
|
+
`eevee lint` 在检查前强制同步一次平台词条快照,下载完成后再读取 `intlConfig` 指向的本地 JSON。
|
|
153
|
+
`refresh.config` 指向 `eevee intl download` 使用的目标数组配置;不配置时默认读取项目
|
|
154
|
+
`package.json` 的 `eevee.intl`。
|
|
155
|
+
|
|
156
|
+
同步失败、平台返回 0 词条、本地词条文件解析失败,都会直接阻断检查;不会退回旧快照,也不会提供
|
|
157
|
+
`--no-refresh` 旁路。词条同步成功但代码引用的 key 未登记时,诊断为 `unregistered`,退出码同样是 `1`。
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# 使用独立下载目标配置;同步仍然强制执行
|
|
161
|
+
eevee lint --refresh-config intl.download.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
提交前推荐使用:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
eevee lint --staged
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
发现问题退出码为 `1`。`--json` 输出 `{ok:true,data}` envelope,其中 `data.passed=false` 表示检查执行成功但存在诊断;
|
|
171
|
+
配置或执行失败仍是 `{ok:false}`。每条诊断包含 `code`、精确位置、原文、中文说明和 `hint`:
|
|
172
|
+
|
|
173
|
+
- `missing-intl`:文案没有接入国际化;
|
|
174
|
+
- `tag-mismatch`:词条存在,但不属于当前文件配置的标签;
|
|
175
|
+
- `unregistered`:词条不在当前平台数据中。
|
|
176
|
+
|
|
177
|
+
当前不开启源码自动修复。改写文案需要选择词条 key、补充导入并确认运行时 API,自动改写容易产生语义错误;
|
|
178
|
+
因此诊断只输出确定性建议,`--fix` 作为保留参数。后续只有在能生成稳定 key 且不影响导入/类型/运行时行为时,
|
|
179
|
+
才应把对应诊断标记为 `fixable=true`。
|
|
180
|
+
|
|
181
|
+
### Java 后端项目接入
|
|
182
|
+
|
|
183
|
+
Java 适配器解析 `.java` 文件,适合 Spring Boot 后端仓库:
|
|
184
|
+
|
|
185
|
+
- 校验 `LocaleHandler.getLocaleMessage(...)`、`tryLocaleMessage(...)`、`MessageSource.getMessage(...)`
|
|
186
|
+
第一参数里的直写字符串是否登记到配置的 EEVEE tag;
|
|
187
|
+
- 检查 Java 字符串字面量中的硬编码中文;
|
|
188
|
+
- 默认排除日志方法(`trace/debug/info/warn/error` 等)、单测断言和注解描述;
|
|
189
|
+
- 默认排除 `**/src/test/**` 和 `**/generated/**`。
|
|
190
|
+
|
|
191
|
+
后端仓库无 `package.json` 时,推荐在仓库根目录放 `.eevee-lint.json`。完整结构如下:
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"refresh": {
|
|
196
|
+
"config": ".eevee/download.json"
|
|
197
|
+
},
|
|
198
|
+
"languages": {
|
|
199
|
+
"web": { "enabled": false },
|
|
200
|
+
"java": {
|
|
201
|
+
"enabled": true,
|
|
202
|
+
"root": ".",
|
|
203
|
+
"intlConfig": ".eevee/intl.json",
|
|
204
|
+
"includes": ["*/src/main/java/**/*.java"],
|
|
205
|
+
"excludes": ["**/src/test/**", "**/generated/**"],
|
|
206
|
+
"tagMatchMap": {
|
|
207
|
+
"*/src/main/java/**/*": ["server"]
|
|
208
|
+
},
|
|
209
|
+
"checkHardcoded": true
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
`.eevee/intl.json` 只负责告诉检查器去哪里读快照:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{ "outPaths": [{ "path": "locales" }] }
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`.eevee/download.json` 使用 `eevee intl download` 的目标数组格式:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
[
|
|
225
|
+
{
|
|
226
|
+
"outPath": ".eevee/locales",
|
|
227
|
+
"format": "json",
|
|
228
|
+
"languages": { "zh-CN": "zh-CN" },
|
|
229
|
+
"projects": [{ "projectId": 1, "tags": [123] }]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
把 `projectId` 和 tag ID 换成后端词条项目实际值。提交检测推荐在 Git `pre-commit` 中执行:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
npx @eevee/cli lint --staged --language java
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Business command layer
|
|
241
|
+
|
|
242
|
+
Business commands 是主要接口,命名规范固定为 `<group> <action>`。它把底层 `call_api_operation` 封装成语义稳定、参数有类型的命令,不需要手工查找 `operation_id`:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# 看全部领域和命令
|
|
246
|
+
eevee business
|
|
247
|
+
|
|
248
|
+
# Standard syntax
|
|
249
|
+
eevee project list
|
|
250
|
+
eevee project create --name Demo --locales zh-CN,en-US
|
|
251
|
+
eevee project detail 12
|
|
252
|
+
eevee translation set-content --id 12 --term-id 34 --locale zh-CN --content 你好
|
|
253
|
+
eevee project delete 12 --yes
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
支持的域包括:project/version/term/translation/tag-group/tag/permission/log/profile/config/user。完整矩阵直接在 `eevee -h` 中列出。每个动作的完整 flag、位置说明、类型和必填状态用 `--help` 查看:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
eevee term create --help
|
|
260
|
+
eevee translation assign-translators --help
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
命令路由只接受 `<group> <action>`;中文内容只用于说明和描述,不再参与命令解析。
|
|
264
|
+
|
|
265
|
+
输出约定:
|
|
266
|
+
|
|
267
|
+
- human 输出会解开 REST `{status,data,msg}` 包裹,列表渲染成表格;
|
|
268
|
+
- `--json` 输出稳定的 `{ok,data}`;
|
|
269
|
+
- `--raw` 输出完整 MCP CallToolResult;
|
|
270
|
+
- 所有 delete/clear 命令必须显式加 `--yes`;
|
|
271
|
+
- 联网业务命令同样可加 `--url`、`--token` 和 `--timeout`。
|
|
272
|
+
|
|
273
|
+
## 内置 MCP 工具详解
|
|
274
|
+
|
|
275
|
+
用权威列表检查服务器当前暴露的全部 tools:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
eevee tools list
|
|
279
|
+
eevee tools list --raw
|
|
280
|
+
eevee tools list --json
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
每个工具的实时 schema 和固定工作流说明都可以离线式查看:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
eevee tools docs [tool-name]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### 1. list_api_operations:发现 API
|
|
290
|
+
|
|
291
|
+
用途:从运行时 Swagger/OpenAPI 目录搜索 operation_id、HTTP 方法、路径、参数位置和摘要。
|
|
292
|
+
|
|
293
|
+
常用筛选:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
eevee tools call list_api_operations '{"method":"GET","search":"terms","limit":20}'
|
|
297
|
+
eevee tools call list_api_operations '{"tag":"项目"}'
|
|
298
|
+
eevee tools call list_api_operations '{"search":"translation status"}'
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
适用场景:
|
|
302
|
+
|
|
303
|
+
- 不知道某个业务动作对应哪个接口;
|
|
304
|
+
- 需要 `operation_id`;
|
|
305
|
+
- 需要按项目、版本、词条、翻译、标签、权限、日志等关键词探索接口。
|
|
306
|
+
|
|
307
|
+
### 2. get_api_operation:读取契约
|
|
308
|
+
|
|
309
|
+
用途:获取单个操作的 path/query/header 参数和 application/json body schema。
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
eevee tools call get_api_operation '{"operation_id":"<operation-id>"}'
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
调用写操作前必须先读契约,确认:
|
|
316
|
+
|
|
317
|
+
- 哪些值属于 `parameters.path`;
|
|
318
|
+
- 哪些值属于 `parameters.query`;
|
|
319
|
+
- body 的必填字段和类型;
|
|
320
|
+
- 是否不支持通过 MCP 直接上传 multipart 文件。
|
|
321
|
+
|
|
322
|
+
### 3. call_api_operation:执行 API
|
|
323
|
+
|
|
324
|
+
用途:以当前 token 用户身份回环调用 REST API。服务端会继续执行原有角色权限、登录态校验和审计逻辑。
|
|
325
|
+
|
|
326
|
+
读示例:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
eevee tools call call_api_operation \
|
|
330
|
+
'{"operation_id":"ProjectsController_list","parameters":{}}'
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
带路径参数:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
eevee tools call call_api_operation \
|
|
337
|
+
'{"operation_id":"ProjectsController_detail","parameters":{"id":1}}'
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
带 query/body 的通用形态:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
eevee tools call call_api_operation \
|
|
344
|
+
'{"operation_id":"<write-operation-id>","parameters":{"id":1},"body":{"name":"example"}}'
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
大 payload 用文件。文件内容是 MCP `arguments` 的完整对象,必须包含 `operation_id`:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
cat >/tmp/eevee-api-call.json <<'JSON'
|
|
351
|
+
{
|
|
352
|
+
"operation_id": "<create-operation-id>",
|
|
353
|
+
"body": {
|
|
354
|
+
"name": "demo",
|
|
355
|
+
"locales": ["zh-CN", "en-US"]
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
JSON
|
|
359
|
+
|
|
360
|
+
eevee tools call call_api_operation --args @/tmp/eevee-api-call.json
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
安全约定:
|
|
364
|
+
|
|
365
|
+
- `delete` / `clear` / 批量更新 / 解冻等破坏性动作必须由用户明确要求后执行;
|
|
366
|
+
- 先读取详情或列表确认 ID,再修改;
|
|
367
|
+
- 结果的 `isError=true` 时停止并把真实错误反馈给用户;
|
|
368
|
+
- 不要伪造返回数据中不存在的字段或 ID。
|
|
369
|
+
|
|
370
|
+
## 标准 MCP 能力映射
|
|
371
|
+
|
|
372
|
+
CLI 每次请求都会按 Streamable HTTP 规范完成 `initialize` → `notifications/initialized` → 目标请求,并透传 Bearer token 与 `Mcp-Session-Id`。
|
|
373
|
+
|
|
374
|
+
Resources:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
eevee resources list
|
|
378
|
+
eevee resources templates
|
|
379
|
+
eevee resources read eevee://example/resource
|
|
380
|
+
eevee resources subscribe eevee://example/resource
|
|
381
|
+
eevee resources unsubscribe eevee://example/resource
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Prompts:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
eevee prompts list
|
|
388
|
+
eevee prompts get code-review --args '{"language":"TypeScript"}'
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
任意标准 method/notification(包括 server 当前新增而 CLI 尚未包一层快捷方式的能力):
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
eevee request logging/setLevel '{"level":"info"}'
|
|
395
|
+
eevee request completion/complete '{"ref":{"type":"ref/prompt","name":"review"},"argument":{"name":"code","value":"..."}}'
|
|
396
|
+
eevee notify notifications/cancelled '{"requestId":"<id>","reason":"user cancelled"}'
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
`roots/list`、`sampling/createMessage`、`elicitation/create` 属于 server 向 client 发起的回调方向。CLI 是一次性进程,不声明这些客户端 callback capability;因此不会向服务端误报支持。
|
|
400
|
+
|
|
401
|
+
输出格式:
|
|
402
|
+
|
|
403
|
+
- 默认 human-readable;tool text result 会原样打印;
|
|
404
|
+
- `--raw` 输出完整 MCP result;
|
|
405
|
+
- `--json` 输出 `{ok:true,data:...}` envelope。
|
|
406
|
+
|
|
407
|
+
## Agent Skill 快速安装
|
|
408
|
+
|
|
409
|
+
仓库中已经内置 `assets/skills/eevee-mcp/SKILL.md` 和 `reference.md`。
|
|
410
|
+
|
|
411
|
+
默认复制到当前用户的 Codex + Claude 全局目录:
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
eevee skills install
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
实际路径:
|
|
418
|
+
|
|
419
|
+
- Codex: `$CODEX_HOME/skills/eevee-mcp`,默认 `~/.codex/skills/eevee-mcp`
|
|
420
|
+
- Claude Code: `$CLAUDE_CONFIG_DIR/skills/eevee-mcp`,默认 `~/.claude/skills/eevee-mcp`
|
|
421
|
+
- Universal/兼容 Agent Skills 实现: `$EEVEE_AGENT_HOME/skills/eevee-mcp`,默认 `~/.agents/skills/eevee-mcp`
|
|
422
|
+
|
|
423
|
+
显式选择 agent:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
eevee skills install codex,claude
|
|
427
|
+
eevee skills install codex
|
|
428
|
+
eevee skills install universal
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
复制到某个项目的 Claude/Codex 目录:
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
cd /path/to/repo
|
|
435
|
+
eevee skills install codex,claude --project .
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
复制到任意自定义 skills 根目录:
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
mkdir -p .agents/skills
|
|
442
|
+
eevee skills install universal --dir .agents/skills
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
强制刷新、预演和卸载:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
eevee skills update
|
|
449
|
+
eevee skills install --dry-run
|
|
450
|
+
eevee skills uninstall --yes
|
|
451
|
+
eevee skills uninstall codex --global --yes
|
|
452
|
+
eevee skills uninstall claude --project . --yes
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
管理查询:
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
eevee skills list
|
|
459
|
+
eevee skills paths
|
|
460
|
+
eevee skills info
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Claude/Codex 重启后加载名为 `eevee-mcp` 的 skill。Skill 内容指导 Agent 先 discover contract,再 call tool,并避免未授权的破坏性变更。
|
|
464
|
+
|
|
465
|
+
## 诊断与故障排查
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
eevee doctor
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
常见问题:
|
|
472
|
+
|
|
473
|
+
| 现象 | 处理 |
|
|
474
|
+
|---|---|
|
|
475
|
+
| 缺少 token | `eevee config set --token ...` 或设置 `EEVEE_TOKEN` |
|
|
476
|
+
| `ECONNREFUSED` | 用 `curl` 确认 server 地址和端口,或修正 `--url` |
|
|
477
|
+
| HTTP 401 | 用户 token 无效/冻结/已重置,重新设置 token |
|
|
478
|
+
| method not found | 用 `eevee tools list` 确认 server capabilities |
|
|
479
|
+
| 响应超时 | 提高 `--timeout`,检查网关对长连接/SSE 的限制 |
|
|
480
|
+
|
|
481
|
+
协议头使用 `Authorization: Bearer <token>`、`Accept: application/json, text/event-stream`、`Content-Type: application/json` 和协商后的 `MCP-Protocol-Version`。
|
|
482
|
+
|
|
483
|
+
## 开发
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
npm run build # TypeScript 编译到 dist/src
|
|
487
|
+
npm run check # build + Node.js test runner
|
|
488
|
+
npm run cli -- help # 本地调用 CLI
|
|
489
|
+
node dist/src/bin/cli.js doctor
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
单测覆盖 CLI 参数解析、配置持久化/遮蔽/覆盖、JSON 参数解析、MCP initialize/session/Bearer 握手,以及 skill 复制。
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eevee-mcp
|
|
3
|
+
description: Operate eevee through the @eevee/cli business commands—projects, versions, terms, translations, tags, permissions, logs—and retain access to raw MCP tools/resources/prompts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# eevee business-aware MCP skill
|
|
7
|
+
|
|
8
|
+
Use this skill when a user asks Codex/Claude or another terminal Agent to inspect or change data on an eevee i18n server. Prefer **business-meaningful CLI commands** over hand-written JSON-RPC.
|
|
9
|
+
|
|
10
|
+
## Golden rules
|
|
11
|
+
|
|
12
|
+
1. Read before write. Resolve IDs with list/detail commands.
|
|
13
|
+
2. Never guess project/version/term/tag/user IDs.
|
|
14
|
+
3. Destructive delete/clear operations require explicit `--yes`; ask the user first if they did not request deletion.
|
|
15
|
+
4. Report actual response data verbatim. If `isError=true`, stop and show the error instead of inventing fields.
|
|
16
|
+
5. Keep the user's personal token private; never print it or put it in code/docs/tests.
|
|
17
|
+
|
|
18
|
+
## First-run setup
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
eevee ping
|
|
22
|
+
|
|
23
|
+
# Set once per machine/home directory
|
|
24
|
+
eevee config set --url https://eevee.example.com/mcp
|
|
25
|
+
eevee config set --token <user-token>
|
|
26
|
+
|
|
27
|
+
# Inspect without revealing the token
|
|
28
|
+
eevee doctor
|
|
29
|
+
eevee config show
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Temporary overrides have highest precedence and work on any connected command:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
eevee project list --url http://127.0.0.1:10001/mcp --token "$EEVEE_TOKEN" --json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Start from business intent
|
|
39
|
+
|
|
40
|
+
List every packaged business command by domain:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
eevee business # complete matrix of every business command
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Get exact flags/types for one operation:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
eevee project create --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Common examples:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
eevee project list
|
|
56
|
+
eevee project create --name Demo --locales zh-CN,en-US --description '示例项目'
|
|
57
|
+
eevee project detail 12
|
|
58
|
+
eevee version list 12
|
|
59
|
+
eevee version create --id 12 --name 'Release 1' --status 2
|
|
60
|
+
eevee term create --id 12 --version-id 34 --name login.button \
|
|
61
|
+
--translations '{"zh-CN":"登录","en-US":"Sign in"}'
|
|
62
|
+
eevee translation set-content --id 12 --term-id 56 --locale zh-CN --content 登录
|
|
63
|
+
eevee translation assign-translators --id 12 --locales zh-CN,en-US --translator-ids 2,3
|
|
64
|
+
eevee permission list 12
|
|
65
|
+
eevee log list --id 12 --page 1 --page-size 20
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Add `--json` for machine-readable `{ok,data}` output, or `--raw` to inspect the complete MCP result.
|
|
69
|
+
|
|
70
|
+
## Fallback: raw server tools
|
|
71
|
+
|
|
72
|
+
The current eevee MCP server exposes three REST-backed tools. Use these only for an operation not yet represented by the business catalog, or while diagnosing it:
|
|
73
|
+
|
|
74
|
+
- `list_api_operations`: search runtime Swagger operations by method/tag/text and obtain `operation_id`.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
eevee tools call list_api_operations '{"method":"GET","search":"terms","limit":50}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- `get_api_operation`: read path/query/body contracts and required types before calling.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
eevee tools call get_api_operation '{"operation_id":"<operation_id>"}'
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- `call_api_operation`: execute the selected API as the token owner.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
eevee tools call call_api_operation '{"operation_id":"<read-id>"}'
|
|
90
|
+
eevee tools call call_api_operation '{"operation_id":"<write-id>","parameters":{"id":1},"body":{"name":"demo"}}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Always inspect current capability with `eevee tools list`; future servers may expose more tools.
|
|
94
|
+
|
|
95
|
+
## Other standard MCP surfaces
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
eevee resources list
|
|
99
|
+
eevee resources templates
|
|
100
|
+
eevee resources read <uri>
|
|
101
|
+
eevee prompts list
|
|
102
|
+
eevee prompts get <prompt-name> --args '{"key":"value"}'
|
|
103
|
+
eevee request <method> '<params-json>'
|
|
104
|
+
eevee notify <method> --params '<params-json>'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Use `eevee request` for standard methods without a dedicated subcommand and `eevee notify` for JSON-RPC notifications. Use `@file.json` where JSON payload arguments are accepted to keep large payloads out of shell history.
|
|
108
|
+
|
|
109
|
+
## Installation into agents
|
|
110
|
+
|
|
111
|
+
Default installation copies this skill into Codex + Claude global directories:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
eevee skills install
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Other supported targets:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
eevee skills install codex
|
|
121
|
+
eevee skills install claude
|
|
122
|
+
eevee skills install universal # ~/.agents/skills
|
|
123
|
+
eevee skills install codex,claude --project . # repository-local copies
|
|
124
|
+
eevee skills install universal --dir .agents/skills
|
|
125
|
+
eevee skills update
|
|
126
|
+
eevee skills paths
|
|
127
|
+
```
|