@manturhub/cli 0.7.0 → 0.8.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/LICENSE +21 -0
- package/README.md +35 -48
- package/bin/cli.js +300 -66
- package/lib/api.js +49 -14
- package/lib/archive.js +146 -0
- package/lib/config.js +28 -3
- package/lib/download.js +45 -0
- package/lib/login-link.js +36 -7
- package/lib/params.js +102 -0
- package/lib/setup.js +10 -91
- package/lib/skill-install.js +56 -45
- package/lib/skill.js +31 -18
- package/lib/suite-install.js +43 -57
- package/lib/update-check.js +2 -1
- package/package.json +12 -5
- package/lib/mcp.js +0 -108
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ManturHub
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,68 +1,55 @@
|
|
|
1
1
|
# @manturhub/cli
|
|
2
2
|
|
|
3
|
-
ManturHub
|
|
3
|
+
ManturHub 算子广场的统一 Agent 调用通道。CLI 通过 REST 实时发现和调用全部上线算子,也可浏览配方、安装平台 Skill 和 Agent 套件;新算子上线后无需更新 CLI 即可发现。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. **stdio MCP server** —— 给 Claude Code / Codex / Cursor / Claude Desktop 等当本地 MCP server。stdio 是所有 AI 客户端都稳定支持的传输,装上这个 CLI 就一行接入,绕开各家对远程传输支持参差的坑。
|
|
7
|
-
|
|
8
|
-
## 安装
|
|
5
|
+
## 安装与登录
|
|
9
6
|
|
|
10
7
|
```bash
|
|
11
8
|
npm install -g @manturhub/cli
|
|
12
|
-
|
|
9
|
+
manturhub login
|
|
13
10
|
```
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## 上手三步
|
|
12
|
+
`login` 默认打开浏览器授权,API Key 只保存在 `~/.manturhub/config.json`(权限 `600`)。无浏览器环境可设置 `MANTURHUB_KEY`,或通过 stdin 导入,避免进入 shell history:
|
|
18
13
|
|
|
19
14
|
```bash
|
|
20
|
-
|
|
21
|
-
manturhub login --key sk-你的key
|
|
22
|
-
|
|
23
|
-
# 2. 验证(列出全部上线算子)
|
|
24
|
-
manturhub ls
|
|
25
|
-
|
|
26
|
-
# 3. 调一个算子试试
|
|
27
|
-
manturhub run op.text.commerce-copy --json '{"product_info":"便携榨汁杯,USB充电,300ml","scene":"product_title","tone":"lively"}'
|
|
15
|
+
printf '%s' "$YOUR_MANTURHUB_KEY" | manturhub login --key-stdin
|
|
28
16
|
```
|
|
29
17
|
|
|
30
|
-
|
|
18
|
+
需要 Node.js ≥ 18。也可免安装运行:`npx -y @manturhub/cli <命令>`。
|
|
31
19
|
|
|
32
|
-
|
|
33
|
-
```toml
|
|
34
|
-
[mcp_servers.manturhub]
|
|
35
|
-
command = "manturhub"
|
|
36
|
-
args = ["mcp"]
|
|
37
|
-
env = { MANTURHUB_KEY = "sk-你的key" }
|
|
38
|
-
```
|
|
20
|
+
## 快速开始
|
|
39
21
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
```bash
|
|
23
|
+
# 发现与查看算子无需登录
|
|
24
|
+
manturhub ls --cat text
|
|
25
|
+
manturhub describe op.text.commerce-copy
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
# 先查实时价格,再调用
|
|
28
|
+
manturhub quote op.text.commerce-copy
|
|
29
|
+
manturhub run op.text.commerce-copy --json '{"product_info":"便携榨汁杯,USB 充电,300ml","scene":"product_title","tone":"lively"}'
|
|
48
30
|
```
|
|
49
|
-
域可选: `manturhub`(全部) · `drama`(剧本) · `production`(制片) · `ecom-video`(电商视频)。
|
|
50
31
|
|
|
51
|
-
|
|
32
|
+
CLI 会在付费调用前按算子实时 schema 校验未知字段、必填项、类型和枚举,校验失败不会发起 invoke。
|
|
33
|
+
|
|
34
|
+
## 主要命令
|
|
52
35
|
|
|
53
36
|
| 命令 | 说明 |
|
|
54
37
|
|---|---|
|
|
55
|
-
| `manturhub
|
|
56
|
-
| `manturhub
|
|
57
|
-
| `manturhub
|
|
58
|
-
| `manturhub run <算子ID> --json '{}'` |
|
|
59
|
-
| `manturhub
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`manturhub
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
38
|
+
| `manturhub ls [--cat image\|video\|audio\|text\|data] [--json]` | 实时列出上线算子 |
|
|
39
|
+
| `manturhub describe <算子ID> [--json]` | 查看精确入参与异步属性 |
|
|
40
|
+
| `manturhub quote <算子ID> [--json]` | 查询 Java API 返回的实时计费公式 |
|
|
41
|
+
| `manturhub run <算子ID> --json '{}'` | 调用算子;异步任务默认轮询到终态 |
|
|
42
|
+
| `manturhub run <算子ID> --json-file params.json` | 从文件读取参数,适合长提示词和自动化 |
|
|
43
|
+
| `manturhub upload <本地文件>` | 流式上传图片、音频或视频并输出公网 URL |
|
|
44
|
+
| `manturhub status <poll_url>` | 查询 `run --no-wait` 返回的异步任务 |
|
|
45
|
+
| `manturhub balance [--json]` | 查询余额及美元等值(1 馒头 = $0.01 USD) |
|
|
46
|
+
| `manturhub skill ls [--json]` / `skill add <slug> --client codex` | 浏览和安装业务 Skill |
|
|
47
|
+
| `manturhub recipe [关键词]` / `recipe get <ID>` | 搜索并查看已验证配方 |
|
|
48
|
+
| `manturhub suite ls [--json]` / `suite install <slug>` | 安装多角色 Agent 套件,不复制 API Key |
|
|
49
|
+
| `manturhub init` | 给当前项目写入 Agent 使用引导 |
|
|
50
|
+
|
|
51
|
+
机器消费输出可在支持的查询命令上加 `--json`。进度和提示写入 stderr,JSON 结果写入 stdout。
|
|
52
|
+
|
|
53
|
+
环境变量:`MANTURHUB_KEY`(优先于配置文件) · `MANTURHUB_BASE`(测试或私有部署覆盖,默认 `https://hub.mantur.ai`)。
|
|
54
|
+
|
|
55
|
+
ManturHub 算子广场:https://hub.mantur.ai
|