@ty_krystal/sei-ai 0.1.5 → 0.1.8

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 (53) hide show
  1. package/README.md +701 -175
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/api-docs.d.ts +20 -0
  7. package/dist/commands/api-docs.js +4 -5
  8. package/dist/commands/call.d.ts +27 -0
  9. package/dist/commands/call.js +12 -13
  10. package/dist/commands/dict/add-category.d.ts +31 -0
  11. package/dist/commands/dict/add-category.js +9 -10
  12. package/dist/commands/dict/add-item.d.ts +32 -0
  13. package/dist/commands/dict/add-item.js +11 -12
  14. package/dist/commands/dict/list.d.ts +22 -0
  15. package/dist/commands/dict/list.js +8 -9
  16. package/dist/commands/init/base-data.d.ts +26 -0
  17. package/dist/commands/init/base-data.js +14 -15
  18. package/dist/commands/query-sql.d.ts +24 -0
  19. package/dist/commands/query-sql.js +6 -8
  20. package/dist/commands/query.d.ts +21 -0
  21. package/dist/commands/query.js +6 -7
  22. package/dist/commands/relogin.d.ts +17 -0
  23. package/dist/commands/relogin.js +2 -3
  24. package/dist/commands/save.d.ts +21 -0
  25. package/dist/commands/save.js +6 -7
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +1 -2
  28. package/oclif.manifest.json +1302 -0
  29. package/package.json +63 -54
  30. package/config.example.json +0 -33
  31. package/dist/README.md +0 -239
  32. package/dist/cli-actions.js +0 -157
  33. package/dist/cli-helpers.js +0 -246
  34. package/dist/command-base/context.js +0 -10
  35. package/dist/command-base/output.js +0 -6
  36. package/dist/command-base/payload.js +0 -33
  37. package/dist/command-base/sei-command.js +0 -88
  38. package/dist/commands/stdio.js +0 -16
  39. package/dist/commands/streamable-http.js +0 -29
  40. package/dist/config.example.json +0 -33
  41. package/dist/config.js +0 -82
  42. package/dist/constants.js +0 -48
  43. package/dist/env.js +0 -33
  44. package/dist/errors.js +0 -55
  45. package/dist/logger.js +0 -71
  46. package/dist/openapi.js +0 -261
  47. package/dist/permissions.js +0 -209
  48. package/dist/schema.js +0 -112
  49. package/dist/sei-client.js +0 -535
  50. package/dist/server.js +0 -237
  51. package/dist/tools.js +0 -175
  52. package/dist/types.js +0 -1
  53. package/dist/utils.js +0 -53
package/README.md CHANGED
@@ -1,239 +1,765 @@
1
- # sei-ai
1
+ sei-cli
2
+ =================
3
+
4
+ A new CLI generated with oclif
5
+
6
+
7
+ [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
8
+ [![Version](https://img.shields.io/npm/v/sei-cli.svg)](https://npmjs.org/package/sei-cli)
9
+ [![Downloads/week](https://img.shields.io/npm/dw/sei-cli.svg)](https://npmjs.org/package/sei-cli)
10
+
11
+
12
+ <!-- toc -->
13
+ * [Usage](#usage)
14
+ * [Commands](#commands)
15
+ <!-- tocstop -->
16
+ # Usage
17
+ <!-- usage -->
18
+ ```sh-session
19
+ $ npm install -g @ty_krystal/sei-ai
20
+ $ sei-ai COMMAND
21
+ running command...
22
+ $ sei-ai (--version)
23
+ @ty_krystal/sei-ai/0.1.8 linux-x64 node-v24.17.0
24
+ $ sei-ai --help [COMMAND]
25
+ USAGE
26
+ $ sei-ai COMMAND
27
+ ...
28
+ ```
29
+ <!-- usagestop -->
30
+ # Commands
31
+ <!-- commands -->
32
+ * [`sei-ai api-docs`](#sei-ai-api-docs)
33
+ * [`sei-ai call METHOD PATH`](#sei-ai-call-method-path)
34
+ * [`sei-ai dict:add-category NAME TYPECODE`](#sei-ai-dictadd-category-name-typecode)
35
+ * [`sei-ai dict:add-item CODE NAME TYPECODE`](#sei-ai-dictadd-item-code-name-typecode)
36
+ * [`sei-ai dict:list`](#sei-ai-dictlist)
37
+ * [`sei-ai help [COMMAND]`](#sei-ai-help-command)
38
+ * [`sei-ai init:base-data`](#sei-ai-initbase-data)
39
+ * [`sei-ai plugins`](#sei-ai-plugins)
40
+ * [`sei-ai plugins:add PLUGIN`](#sei-ai-pluginsadd-plugin)
41
+ * [`sei-ai plugins:inspect PLUGIN...`](#sei-ai-pluginsinspect-plugin)
42
+ * [`sei-ai plugins:install PLUGIN`](#sei-ai-pluginsinstall-plugin)
43
+ * [`sei-ai plugins:link PATH`](#sei-ai-pluginslink-path)
44
+ * [`sei-ai plugins:remove [PLUGIN]`](#sei-ai-pluginsremove-plugin)
45
+ * [`sei-ai plugins:reset`](#sei-ai-pluginsreset)
46
+ * [`sei-ai plugins:uninstall [PLUGIN]`](#sei-ai-pluginsuninstall-plugin)
47
+ * [`sei-ai plugins:unlink [PLUGIN]`](#sei-ai-pluginsunlink-plugin)
48
+ * [`sei-ai plugins:update`](#sei-ai-pluginsupdate)
49
+ * [`sei-ai query`](#sei-ai-query)
50
+ * [`sei-ai query-sql SQL`](#sei-ai-query-sql-sql)
51
+ * [`sei-ai relogin`](#sei-ai-relogin)
52
+ * [`sei-ai save`](#sei-ai-save)
53
+ * [`sei-ai sql SQL`](#sei-ai-sql-sql)
54
+
55
+ ## `sei-ai api-docs`
56
+
57
+ Export and render OpenAPI docs
58
+
59
+ ```
60
+ USAGE
61
+ $ sei-ai api-docs [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
62
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>] [--format
63
+ <value>] [--keyword <value>] [--output <value>]
64
+
65
+ FLAGS
66
+ --account=<value> AI 登录账号
67
+ --account-checkcode=<value> AI 登录验证码
68
+ --account-project=<value> AI 登录项目
69
+ --ai-key=<value> AI 登录密钥
70
+ --base-url=<value> SEI 基础地址
71
+ --config=<value> 配置文件路径
72
+ --format=<value> [default: markdown] 输出格式
73
+ --keyword=<value> 过滤关键字
74
+ --output=<value> 输出文件路径
75
+ --role=<value> AI 登录角色
76
+ --timeout=<value> 请求超时(毫秒)
77
+ --token=<value> 固定 token
78
+
79
+ DESCRIPTION
80
+ Export and render OpenAPI docs
81
+
82
+ Fetches the SEI OpenAPI document and renders a markdown or JSON summary.
83
+ ```
84
+
85
+ _See code: [src/commands/api-docs.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/api-docs.ts)_
86
+
87
+ ## `sei-ai call METHOD PATH`
88
+
89
+ Call a SEI endpoint
90
+
91
+ ```
92
+ USAGE
93
+ $ sei-ai call METHOD PATH [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>]
94
+ [--account <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
95
+ [--allow-empty] [--allow-failure] [--file <value>] [--json <value>] [--no-token] [--stdin]
96
+
97
+ ARGUMENTS
98
+ METHOD HTTP method
99
+ PATH Request path
100
+
101
+ FLAGS
102
+ --account=<value> AI 登录账号
103
+ --account-checkcode=<value> AI 登录验证码
104
+ --account-project=<value> AI 登录项目
105
+ --ai-key=<value> AI 登录密钥
106
+ --allow-empty 允许空响应
107
+ --allow-failure 允许失败响应
108
+ --base-url=<value> SEI 基础地址
109
+ --config=<value> 配置文件路径
110
+ --file=<value> JSON file path
111
+ --json=<value> JSON payload
112
+ --no-token 不附带 token
113
+ --role=<value> AI 登录角色
114
+ --stdin Read JSON payload from stdin
115
+ --timeout=<value> 请求超时(毫秒)
116
+ --token=<value> 固定 token
117
+
118
+ DESCRIPTION
119
+ Call a SEI endpoint
120
+
121
+ Makes an authenticated request to a SEI endpoint.
122
+ ```
123
+
124
+ _See code: [src/commands/call.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/call.ts)_
125
+
126
+ ## `sei-ai dict:add-category NAME TYPECODE`
127
+
128
+ Add a dictionary category
129
+
130
+ ```
131
+ USAGE
132
+ $ sei-ai dict:add-category NAME TYPECODE [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>]
133
+ [--account <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
134
+ [--allow-failure] [--body <value>] [--code <value>] [--ctype <value>] [--dict-flag <value>] [--ename <value>]
135
+ [--memo <value>] [--sort <value>] [--sysid <value>] [--uuid <value>]
136
+
137
+ ARGUMENTS
138
+ NAME 字典名称
139
+ TYPECODE 字典类别编码
140
+
141
+ FLAGS
142
+ --account=<value> AI 登录账号
143
+ --account-checkcode=<value> AI 登录验证码
144
+ --account-project=<value> AI 登录项目
145
+ --ai-key=<value> AI 登录密钥
146
+ --allow-failure 允许失败响应
147
+ --base-url=<value> SEI 基础地址
148
+ --body=<value> 附加内容
149
+ --code=<value> 字典代码
150
+ --config=<value> 配置文件路径
151
+ --ctype=<value> 分类类型
152
+ --dict-flag=<value> 字典标记
153
+ --ename=<value> 英文名
154
+ --memo=<value> 备注
155
+ --role=<value> AI 登录角色
156
+ --sort=<value> 排序号
157
+ --sysid=<value> 系统编号
158
+ --timeout=<value> 请求超时(毫秒)
159
+ --token=<value> 固定 token
160
+ --uuid=<value> UUID
161
+
162
+ DESCRIPTION
163
+ Add a dictionary category
164
+
165
+ Builds and saves a SEI dictionary category row.
166
+ ```
167
+
168
+ _See code: [src/commands/dict/add-category.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/dict/add-category.ts)_
169
+
170
+ ## `sei-ai dict:add-item CODE NAME TYPECODE`
171
+
172
+ Add a dictionary item
173
+
174
+ ```
175
+ USAGE
176
+ $ sei-ai dict:add-item CODE NAME TYPECODE [--config <value>] [--base-url <value>] [--ai-key <value>] [--role
177
+ <value>] [--account <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout
178
+ <value>] [--allow-failure] [--body <value>] [--ctype <value>] [--dict-flag <value>] [--ename <value>] [--memo
179
+ <value>] [--parent <value>] [--sort <value>] [--sysid <value>] [--uuid <value>]
180
+
181
+ ARGUMENTS
182
+ CODE 字典项编码
183
+ NAME 字典项名称
184
+ TYPECODE 字典类别编码
185
+
186
+ FLAGS
187
+ --account=<value> AI 登录账号
188
+ --account-checkcode=<value> AI 登录验证码
189
+ --account-project=<value> AI 登录项目
190
+ --ai-key=<value> AI 登录密钥
191
+ --allow-failure 允许失败响应
192
+ --base-url=<value> SEI 基础地址
193
+ --body=<value> 附加内容
194
+ --config=<value> 配置文件路径
195
+ --ctype=<value> 分类类型
196
+ --dict-flag=<value> 字典标记
197
+ --ename=<value> 英文名
198
+ --memo=<value> 备注
199
+ --parent=<value> 父级编号
200
+ --role=<value> AI 登录角色
201
+ --sort=<value> 排序号
202
+ --sysid=<value> 系统编号
203
+ --timeout=<value> 请求超时(毫秒)
204
+ --token=<value> 固定 token
205
+ --uuid=<value> UUID
206
+
207
+ DESCRIPTION
208
+ Add a dictionary item
209
+
210
+ Builds and saves a SEI dictionary item row.
211
+ ```
212
+
213
+ _See code: [src/commands/dict/add-item.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/dict/add-item.ts)_
214
+
215
+ ## `sei-ai dict:list`
216
+
217
+ List dictionary entries
218
+
219
+ ```
220
+ USAGE
221
+ $ sei-ai dict:list [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
222
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
223
+ [--allow-failure] [--flat] [--keyword <value>] [--size <value>] [--type <value>]
224
+
225
+ FLAGS
226
+ --account=<value> AI 登录账号
227
+ --account-checkcode=<value> AI 登录验证码
228
+ --account-project=<value> AI 登录项目
229
+ --ai-key=<value> AI 登录密钥
230
+ --allow-failure 允许失败响应
231
+ --base-url=<value> SEI 基础地址
232
+ --config=<value> 配置文件路径
233
+ --flat 只输出平铺结果
234
+ --keyword=<value> 过滤关键字
235
+ --role=<value> AI 登录角色
236
+ --size=<value> [default: 1000] 返回条数
237
+ --timeout=<value> 请求超时(毫秒)
238
+ --token=<value> 固定 token
239
+ --type=<value> 字典类型
240
+
241
+ DESCRIPTION
242
+ List dictionary entries
243
+
244
+ Queries SEI dictionary data and optionally renders the tree structure.
245
+ ```
246
+
247
+ _See code: [src/commands/dict/list.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/dict/list.ts)_
248
+
249
+ ## `sei-ai help [COMMAND]`
250
+
251
+ Display help for sei-ai.
252
+
253
+ ```
254
+ USAGE
255
+ $ sei-ai help [COMMAND...] [-n]
256
+
257
+ ARGUMENTS
258
+ [COMMAND...] Command to show help for.
259
+
260
+ FLAGS
261
+ -n, --nested-commands Include all nested commands in the output.
262
+
263
+ DESCRIPTION
264
+ Display help for sei-ai.
265
+ ```
266
+
267
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.52/src/commands/help.ts)_
268
+
269
+ ## `sei-ai init:base-data`
270
+
271
+ Initialize base data
272
+
273
+ ```
274
+ USAGE
275
+ $ sei-ai init:base-data [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
276
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
277
+ [--admin-name <value>] [--admin-password <value>] [--admin-role <value>] [--admin-role-name <value>] [--admin-uid
278
+ <value>] [--allow-failure] [--reset-admin-password] [--sql-file <value>] [--sysid <value>]
279
+
280
+ FLAGS
281
+ --account=<value> AI 登录账号
282
+ --account-checkcode=<value> AI 登录验证码
283
+ --account-project=<value> AI 登录项目
284
+ --admin-name=<value> 管理员名称
285
+ --admin-password=<value> 管理员密码
286
+ --admin-role=<value> 管理员角色
287
+ --admin-role-name=<value> 管理员角色名称
288
+ --admin-uid=<value> 管理员 UID
289
+ --ai-key=<value> AI 登录密钥
290
+ --allow-failure 允许失败响应
291
+ --base-url=<value> SEI 基础地址
292
+ --config=<value> 配置文件路径
293
+ --reset-admin-password 重置管理员密码
294
+ --role=<value> AI 登录角色
295
+ --sql-file=<value> 初始化 SQL 文件
296
+ --sysid=<value> 系统编号
297
+ --timeout=<value> 请求超时(毫秒)
298
+ --token=<value> 固定 token
299
+
300
+ DESCRIPTION
301
+ Initialize base data
302
+
303
+ Executes the base seed SQL and clears SEI caches.
304
+ ```
305
+
306
+ _See code: [src/commands/init/base-data.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/init/base-data.ts)_
307
+
308
+ ## `sei-ai plugins`
309
+
310
+ List installed plugins.
311
+
312
+ ```
313
+ USAGE
314
+ $ sei-ai plugins [--json] [--core]
315
+
316
+ FLAGS
317
+ --core Show core plugins.
318
+
319
+ GLOBAL FLAGS
320
+ --json Format output as json.
321
+
322
+ DESCRIPTION
323
+ List installed plugins.
324
+
325
+ EXAMPLES
326
+ $ sei-ai plugins
327
+ ```
328
+
329
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/index.ts)_
330
+
331
+ ## `sei-ai plugins:add PLUGIN`
332
+
333
+ Installs a plugin into sei-ai.
334
+
335
+ ```
336
+ USAGE
337
+ $ sei-ai plugins:add PLUGIN... [--json] [-f] [-h] [-s | -v]
338
+
339
+ ARGUMENTS
340
+ PLUGIN... Plugin to install.
341
+
342
+ FLAGS
343
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
344
+ -h, --help Show CLI help.
345
+ -s, --silent Silences npm output.
346
+ -v, --verbose Show verbose npm output.
347
+
348
+ GLOBAL FLAGS
349
+ --json Format output as json.
350
+
351
+ DESCRIPTION
352
+ Installs a plugin into sei-ai.
353
+
354
+ Uses npm to install plugins.
355
+
356
+ Installation of a user-installed plugin will override a core plugin.
2
357
 
3
- 独立的 SEI MCP 服务,使用 `@modelcontextprotocol/sdk` 运行。
4
- 支持 `stdio`、`streamable-http` 和开发者 CLI 启动,默认只开放受控的低代码查询、保存和字段元数据工具,`querySql` 默认关闭。
5
- CLI 已迁移到 `oclif`,命令面改为顶层子命令。
358
+ Use the SEI_AI_NPM_LOG_LEVEL environment variable to set the npm loglevel.
359
+ Use the SEI_AI_NPM_REGISTRY environment variable to set the npm registry.
6
360
 
7
- ## 安装
361
+ ALIASES
362
+ $ sei-ai plugins:add
363
+
364
+ EXAMPLES
365
+ Install a plugin from npm registry.
366
+
367
+ $ sei-ai plugins:add myplugin
368
+
369
+ Install a plugin from a github url.
370
+
371
+ $ sei-ai plugins:add https://github.com/someuser/someplugin
372
+
373
+ Install a plugin from a github slug.
374
+
375
+ $ sei-ai plugins:add someuser/someplugin
376
+ ```
377
+
378
+ ## `sei-ai plugins:inspect PLUGIN...`
379
+
380
+ Displays installation properties of a plugin.
381
+
382
+ ```
383
+ USAGE
384
+ $ sei-ai plugins:inspect PLUGIN...
385
+
386
+ ARGUMENTS
387
+ PLUGIN... [default: .] Plugin to inspect.
388
+
389
+ FLAGS
390
+ -h, --help Show CLI help.
391
+ -v, --verbose
392
+
393
+ GLOBAL FLAGS
394
+ --json Format output as json.
395
+
396
+ DESCRIPTION
397
+ Displays installation properties of a plugin.
398
+
399
+ EXAMPLES
400
+ $ sei-ai plugins:inspect myplugin
401
+ ```
402
+
403
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/inspect.ts)_
404
+
405
+ ## `sei-ai plugins:install PLUGIN`
406
+
407
+ Installs a plugin into sei-ai.
8
408
 
9
- ```bash
10
- npm install -g sei-ai
11
409
  ```
410
+ USAGE
411
+ $ sei-ai plugins:install PLUGIN... [--json] [-f] [-h] [-s | -v]
412
+
413
+ ARGUMENTS
414
+ PLUGIN... Plugin to install.
415
+
416
+ FLAGS
417
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
418
+ -h, --help Show CLI help.
419
+ -s, --silent Silences npm output.
420
+ -v, --verbose Show verbose npm output.
421
+
422
+ GLOBAL FLAGS
423
+ --json Format output as json.
424
+
425
+ DESCRIPTION
426
+ Installs a plugin into sei-ai.
427
+
428
+ Uses npm to install plugins.
429
+
430
+ Installation of a user-installed plugin will override a core plugin.
431
+
432
+ Use the SEI_AI_NPM_LOG_LEVEL environment variable to set the npm loglevel.
433
+ Use the SEI_AI_NPM_REGISTRY environment variable to set the npm registry.
434
+
435
+ ALIASES
436
+ $ sei-ai plugins:add
437
+
438
+ EXAMPLES
439
+ Install a plugin from npm registry.
440
+
441
+ $ sei-ai plugins:install myplugin
442
+
443
+ Install a plugin from a github url.
444
+
445
+ $ sei-ai plugins:install https://github.com/someuser/someplugin
12
446
 
13
- ## 命令
447
+ Install a plugin from a github slug.
14
448
 
15
- ```bash
16
- pnpm -F sei-ai-mcp dev -- --config ./apps/sei-ai-mcp/config.example.json
17
- pnpm -F sei-ai-mcp run start:stdio
18
- pnpm -F sei-ai-mcp run start:http
19
- pnpm -F sei-ai-mcp run build
20
- pnpm -F sei-ai-mcp run test
449
+ $ sei-ai plugins:install someuser/someplugin
21
450
  ```
22
451
 
23
- 打包后 CLI:
452
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/install.ts)_
453
+
454
+ ## `sei-ai plugins:link PATH`
455
+
456
+ Links a plugin into the CLI for development.
24
457
 
25
- ```bash
26
- sei-ai help
27
- sei-ai stdio --config ./config.example.json
28
- sei-ai streamable-http --host 0.0.0.0 --port 3000 --path /mcp --config ./config.example.json
29
- sei-ai api-docs --format markdown
30
- sei-ai relogin
31
- sei-ai query-sql "SELECT _UID,_NAME FROM _SYS_USER"
32
- sei-ai call POST /api/sei/data/removeAllCache --json '{}'
33
- sei-ai dict:list --type status
34
- sei-ai dict:add-category sex 性别
35
- sei-ai dict:add-item sex male 男
36
- sei-ai init:base-data --sysid sys --admin-uid admin
37
458
  ```
459
+ USAGE
460
+ $ sei-ai plugins:link PATH [-h] [--install] [-v]
461
+
462
+ ARGUMENTS
463
+ PATH [default: .] path to plugin
464
+
465
+ FLAGS
466
+ -h, --help Show CLI help.
467
+ -v, --verbose
468
+ --[no-]install Install dependencies after linking the plugin.
38
469
 
39
- ## 开发者 CLI
470
+ DESCRIPTION
471
+ Links a plugin into the CLI for development.
40
472
 
41
- CLI 是新增的开发者命令面,不会改变现有 MCP server 的启动方式、tool 列表或 Host 集成配置。
473
+ Installation of a linked plugin will override a user-installed or core plugin.
42
474
 
43
- 命令示例:
475
+ e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
476
+ command will override the user-installed or core plugin implementation. This is useful for development work.
44
477
 
45
- ```bash
46
- sei-ai query --json '{"head":{"module":"sys_user"},"option":{"fields":"_UID,_NAME"}}'
47
- sei-ai save --json '{"head":{"module":"sys_user"},"data":[{"action":"edit","rows":[{"keyVal":"admin","row":{"_NAME":"管理员"}}]}]}'
48
- sei-ai query-sql "SELECT _UID,_NAME FROM _SYS_USER" --page 1 --size 20
49
- sei-ai api-docs --keyword login --format json
50
- sei-ai relogin --role admin
478
+
479
+ EXAMPLES
480
+ $ sei-ai plugins:link myplugin
51
481
  ```
52
482
 
53
- 常用认证参数:
483
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/link.ts)_
484
+
485
+ ## `sei-ai plugins:remove [PLUGIN]`
486
+
487
+ Removes a plugin from the CLI.
488
+
489
+ ```
490
+ USAGE
491
+ $ sei-ai plugins:remove [PLUGIN...] [-h] [-v]
54
492
 
55
- - `--base-url`
56
- - `--ai-key`
57
- - `--role`
58
- - `--account`
59
- - `--account-project`
60
- - `--account-checkcode`
61
- - `--token`
62
- - `--timeout`
493
+ ARGUMENTS
494
+ [PLUGIN...] plugin to uninstall
63
495
 
64
- 环境变量加载规则:
496
+ FLAGS
497
+ -h, --help Show CLI help.
498
+ -v, --verbose
65
499
 
66
- - 启动时会自动读取当前工作目录下的 `.env.local` 和 `.env`
67
- - 加载顺序为 `.env.local` `.env`
68
- - 已经存在的进程环境变量不会被 `.env` 覆盖
69
- - 显式 CLI 参数仍然优先于环境变量
500
+ DESCRIPTION
501
+ Removes a plugin from the CLI.
70
502
 
71
- 载荷输入支持:
503
+ ALIASES
504
+ $ sei-ai plugins:unlink
505
+ $ sei-ai plugins:remove
72
506
 
73
- - `--json '<payload>'`
74
- - `--file ./payload.json`
75
- - `--stdin`
507
+ EXAMPLES
508
+ $ sei-ai plugins:remove myplugin
509
+ ```
76
510
 
77
- 当前命令面:
511
+ ## `sei-ai plugins:reset`
78
512
 
79
- - `stdio`
80
- - `streamable-http`
81
- - `query`
82
- - `save`
83
- - `call`
84
- - `query-sql`
85
- - `sql`
86
- - `api-docs`
87
- - `relogin`
88
- - `dict:list`
89
- - `dict:add-category`
90
- - `dict:add-item`
91
- - `init:base-data`
513
+ Remove all user-installed and linked plugins.
92
514
 
93
- HTTP 模式:
515
+ ```
516
+ USAGE
517
+ $ sei-ai plugins:reset [--hard] [--reinstall]
94
518
 
95
- ```bash
96
- pnpm -F sei-ai-mcp dev -- --transport streamable-http --host 0.0.0.0 --port 3000 --path /mcp --config ./apps/sei-ai-mcp/config.example.json
519
+ FLAGS
520
+ --hard Delete node_modules and package manager related files in addition to uninstalling plugins.
521
+ --reinstall Reinstall all plugins after uninstalling.
97
522
  ```
98
523
 
99
- Docker Compose:
524
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/reset.ts)_
525
+
526
+ ## `sei-ai plugins:uninstall [PLUGIN]`
527
+
528
+ Removes a plugin from the CLI.
100
529
 
101
- ```bash
102
- docker compose -f apps/sei-ai-mcp/docker-compose.yml up -d --build
103
530
  ```
531
+ USAGE
532
+ $ sei-ai plugins:uninstall [PLUGIN...] [-h] [-v]
533
+
534
+ ARGUMENTS
535
+ [PLUGIN...] plugin to uninstall
104
536
 
105
- 容器默认暴露 `http://127.0.0.1:3719/mcp`,并通过 `host.docker.internal` 访问宿主机上的 SEI 后端。
106
- 如果后端也在 compose 中运行,把 `SEI_BASE_URL` 改成对应服务名即可。
537
+ FLAGS
538
+ -h, --help Show CLI help.
539
+ -v, --verbose
107
540
 
108
- ## 配置
541
+ DESCRIPTION
542
+ Removes a plugin from the CLI.
109
543
 
110
- 支持的配置项:
544
+ ALIASES
545
+ $ sei-ai plugins:unlink
546
+ $ sei-ai plugins:remove
547
+
548
+ EXAMPLES
549
+ $ sei-ai plugins:uninstall myplugin
550
+ ```
111
551
 
112
- - `baseUrl`
113
- - `auth.mode`: `ai-login` 或 `token`
114
- - `auth.token`
115
- - `auth.aiKey`
116
- - `auth.account`
117
- - `auth.role`
118
- - `tools.query`
119
- - `tools.save`
120
- - `tools.schema`
121
- - `tools.querySql`
122
- - `targets.modules`
123
- - `targets.tables`
124
- - `targets.sources`
125
- - `targets.views`
126
-
127
- 敏感值可通过环境变量注入:
552
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/uninstall.ts)_
128
553
 
129
- - `SEI_BASE_URL`
130
- - `SEI_AI_LOGIN_KEY`
131
- - `SEI_AI_LOGIN_ACCOUNT`
132
- - `SEI_AI_LOGIN_ROLE`
133
- - `SEI_TOKEN`
134
- - `SEI_MCP_TRANSPORT`
135
- - `SEI_MCP_HOST`
136
- - `SEI_MCP_PORT`
137
- - `SEI_MCP_PATH`
138
- - `SEI_MCP_HTTP_JSON_RESPONSE`
554
+ ## `sei-ai plugins:unlink [PLUGIN]`
139
555
 
140
- 例如可以在项目目录写:
556
+ Removes a plugin from the CLI.
141
557
 
142
- ```bash
143
- SEI_BASE_URL=http://127.0.0.1:8081
144
- SEI_AI_LOGIN_KEY=dev-ai-secret
145
- SEI_AI_LOGIN_ROLE=admin
146
558
  ```
559
+ USAGE
560
+ $ sei-ai plugins:unlink [PLUGIN...] [-h] [-v]
147
561
 
148
- ## 权限模型
562
+ ARGUMENTS
563
+ [PLUGIN...] plugin to uninstall
149
564
 
150
- - 未配置目标时默认拒绝。
151
- - 查询字段必须命中白名单。
152
- - 保存字段必须命中白名单。
153
- - `querySql` 默认关闭,只允许单条 `SELECT/WITH`。
154
- - stdio 日志只写 `stderr`,不污染 MCP 协议输出。
565
+ FLAGS
566
+ -h, --help Show CLI help.
567
+ -v, --verbose
155
568
 
156
- 注意:
569
+ DESCRIPTION
570
+ Removes a plugin from the CLI.
157
571
 
158
- - 上面的权限模型只约束 MCP tool 面。
159
- - 开发者 CLI 直接调用 SEI HTTP 接口,不走 MCP 白名单过滤,因此它是调试/开发入口,不是给模型暴露的 tool 面。
572
+ ALIASES
573
+ $ sei-ai plugins:unlink
574
+ $ sei-ai plugins:remove
160
575
 
161
- ## 工具
576
+ EXAMPLES
577
+ $ sei-ai plugins:unlink myplugin
578
+ ```
162
579
 
163
- - `sei_query`
164
- - `sei_save`
165
- - `sei_schema`
166
- - `sei_query_sql`(默认关闭)
580
+ ## `sei-ai plugins:update`
167
581
 
168
- ## MCP Host
582
+ Update installed plugins.
169
583
 
170
- 可直接作为 stdio MCP server 启动,再由上层 Host 注册。
584
+ ```
585
+ USAGE
586
+ $ sei-ai plugins:update [-h] [-v]
171
587
 
172
- stdio Host 配置示例:
588
+ FLAGS
589
+ -h, --help Show CLI help.
590
+ -v, --verbose
173
591
 
174
- ```json
175
- {
176
- "mcpServers": {
177
- "sei-ai-mcp": {
178
- "command": "sei-ai",
179
- "args": [
180
- "stdio",
181
- "--config",
182
- "/abs/path/config.dev.json"
183
- ]
184
- }
185
- }
186
- }
592
+ DESCRIPTION
593
+ Update installed plugins.
187
594
  ```
188
595
 
189
- HTTP 模式可直接挂载到容器端口,Host 地址示例:
596
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.78/src/commands/plugins/update.ts)_
597
+
598
+ ## `sei-ai query`
599
+
600
+ Query SEI data
190
601
 
191
- ```json
192
- {
193
- "mcpServers": {
194
- "sei-ai-mcp": {
195
- "url": "http://127.0.0.1:3719/mcp"
196
- }
197
- }
198
- }
199
602
  ```
603
+ USAGE
604
+ $ sei-ai query [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
605
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
606
+ [--allow-failure] [--file <value>] [--json <value>] [--stdin]
607
+
608
+ FLAGS
609
+ --account=<value> AI 登录账号
610
+ --account-checkcode=<value> AI 登录验证码
611
+ --account-project=<value> AI 登录项目
612
+ --ai-key=<value> AI 登录密钥
613
+ --allow-failure 允许失败响应
614
+ --base-url=<value> SEI 基础地址
615
+ --config=<value> 配置文件路径
616
+ --file=<value> JSON file path
617
+ --json=<value> JSON payload
618
+ --role=<value> AI 登录角色
619
+ --stdin Read JSON payload from stdin
620
+ --timeout=<value> 请求超时(毫秒)
621
+ --token=<value> 固定 token
622
+
623
+ DESCRIPTION
624
+ Query SEI data
625
+
626
+ Sends a SEI query payload.
627
+ ```
628
+
629
+ _See code: [src/commands/query.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/query.ts)_
200
630
 
201
- ## Spring AI Java 接入
631
+ ## `sei-ai query-sql SQL`
202
632
 
203
- 如果 `apps/backend` 通过 Spring AI MCP client 接入,直接使用 `streamable-http`:
633
+ Query SEI with SQL
204
634
 
205
- ```yaml
206
- spring:
207
- ai:
208
- mcp:
209
- client:
210
- enabled: true
211
- type: SYNC
212
- request-timeout: 30s
213
- toolcallback:
214
- enabled: true
215
- streamable-http:
216
- connections:
217
- sei-ai-mcp:
218
- url: http://127.0.0.1:3719
219
- endpoint: /mcp
220
635
  ```
636
+ USAGE
637
+ $ sei-ai query-sql SQL [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
638
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
639
+ [--allow-failure] [--page <value>] [--size <value>]
640
+
641
+ ARGUMENTS
642
+ SQL SQL 语句
643
+
644
+ FLAGS
645
+ --account=<value> AI 登录账号
646
+ --account-checkcode=<value> AI 登录验证码
647
+ --account-project=<value> AI 登录项目
648
+ --ai-key=<value> AI 登录密钥
649
+ --allow-failure 允许失败响应
650
+ --base-url=<value> SEI 基础地址
651
+ --config=<value> 配置文件路径
652
+ --page=<value> [default: 1] 页码
653
+ --role=<value> AI 登录角色
654
+ --size=<value> [default: 20] 每页条数
655
+ --timeout=<value> 请求超时(毫秒)
656
+ --token=<value> 固定 token
657
+
658
+ DESCRIPTION
659
+ Query SEI with SQL
660
+
661
+ Executes querySQL against SEI using a SQL string.
662
+
663
+ ALIASES
664
+ $ sei-ai sql
665
+ ```
666
+
667
+ _See code: [src/commands/query-sql.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/query-sql.ts)_
221
668
 
222
- 如果后端默认直接访问宿主机暴露端口,可这样配置:
669
+ ## `sei-ai relogin`
223
670
 
224
- ```bash
225
- SEI_AI_MCP_HTTP_URL=http://127.0.0.1:3719
226
- SEI_AI_MCP_HTTP_ENDPOINT=/mcp
671
+ Refresh the login token
672
+
673
+ ```
674
+ USAGE
675
+ $ sei-ai relogin [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
676
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
677
+
678
+ FLAGS
679
+ --account=<value> AI 登录账号
680
+ --account-checkcode=<value> AI 登录验证码
681
+ --account-project=<value> AI 登录项目
682
+ --ai-key=<value> AI 登录密钥
683
+ --base-url=<value> SEI 基础地址
684
+ --config=<value> 配置文件路径
685
+ --role=<value> AI 登录角色
686
+ --timeout=<value> 请求超时(毫秒)
687
+ --token=<value> 固定 token
688
+
689
+ DESCRIPTION
690
+ Refresh the login token
691
+
692
+ Forces a fresh ai-login and prints the new token.
227
693
  ```
228
694
 
229
- 如果是宿主机或外部服务直连容器暴露端口,则访问地址为:
695
+ _See code: [src/commands/relogin.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/relogin.ts)_
696
+
697
+ ## `sei-ai save`
698
+
699
+ Save SEI data
230
700
 
231
- ```bash
232
- http://127.0.0.1:3719/mcp
233
701
  ```
702
+ USAGE
703
+ $ sei-ai save [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
704
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
705
+ [--allow-failure] [--file <value>] [--json <value>] [--stdin]
706
+
707
+ FLAGS
708
+ --account=<value> AI 登录账号
709
+ --account-checkcode=<value> AI 登录验证码
710
+ --account-project=<value> AI 登录项目
711
+ --ai-key=<value> AI 登录密钥
712
+ --allow-failure 允许失败响应
713
+ --base-url=<value> SEI 基础地址
714
+ --config=<value> 配置文件路径
715
+ --file=<value> JSON file path
716
+ --json=<value> JSON payload
717
+ --role=<value> AI 登录角色
718
+ --stdin Read JSON payload from stdin
719
+ --timeout=<value> 请求超时(毫秒)
720
+ --token=<value> 固定 token
721
+
722
+ DESCRIPTION
723
+ Save SEI data
724
+
725
+ Sends a SEI save payload.
726
+ ```
727
+
728
+ _See code: [src/commands/save.ts](https://github.com/tanyu/sei-ai/blob/v0.1.8/src/commands/save.ts)_
234
729
 
730
+ ## `sei-ai sql SQL`
235
731
 
732
+ Query SEI with SQL
236
733
 
237
- npm version patch --no-git-tag-version
238
- pnpm run build
239
- npm publish --access public --cache /tmp/sei-ai-npm-cache
734
+ ```
735
+ USAGE
736
+ $ sei-ai sql SQL [--config <value>] [--base-url <value>] [--ai-key <value>] [--role <value>] [--account
737
+ <value>] [--account-project <value>] [--account-checkcode <value>] [--token <value>] [--timeout <value>]
738
+ [--allow-failure] [--page <value>] [--size <value>]
739
+
740
+ ARGUMENTS
741
+ SQL SQL 语句
742
+
743
+ FLAGS
744
+ --account=<value> AI 登录账号
745
+ --account-checkcode=<value> AI 登录验证码
746
+ --account-project=<value> AI 登录项目
747
+ --ai-key=<value> AI 登录密钥
748
+ --allow-failure 允许失败响应
749
+ --base-url=<value> SEI 基础地址
750
+ --config=<value> 配置文件路径
751
+ --page=<value> [default: 1] 页码
752
+ --role=<value> AI 登录角色
753
+ --size=<value> [default: 20] 每页条数
754
+ --timeout=<value> 请求超时(毫秒)
755
+ --token=<value> 固定 token
756
+
757
+ DESCRIPTION
758
+ Query SEI with SQL
759
+
760
+ Executes querySQL against SEI using a SQL string.
761
+
762
+ ALIASES
763
+ $ sei-ai sql
764
+ ```
765
+ <!-- commandsstop -->