@yandy0725/mediagen-cli 0.3.1 → 0.4.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.
package/README.md CHANGED
@@ -28,6 +28,16 @@ mediagen image generate "a red fox in fresh snow, soft morning light" --provider
28
28
 
29
29
  Node >= 18, two runtime dependencies, a DashScope and/or Ark API key.
30
30
 
31
+ ## Using it from an agent
32
+
33
+ The skill in `skills/mediagen/SKILL.md` tells an agent what this CLI does and which rules
34
+ keep a paid request from being wasted. Install it either way:
35
+
36
+ ```bash
37
+ npx skills add yandy/mediagen-cli
38
+ mediagen skills install --dir ~/.claude/skills
39
+ ```
40
+
31
41
  ## Commands
32
42
 
33
43
  | command | what it does |
@@ -39,7 +49,7 @@ Node >= 18, two runtime dependencies, a DashScope and/or Ark API key.
39
49
  | `mediagen login` / `logout` / `auth status` | store, remove, inspect API keys |
40
50
  | `mediagen config show` / `config path` | resolved config, and where it lives |
41
51
  | `mediagen config add <name>` | create a provider in config.toml; everything else is a manual edit |
42
- | `mediagen skill install --dir <path>` | copy the packaged agent skill into `<path>/mediagen/`; re-run to replace it |
52
+ | `mediagen skills install --dir <path>` | copy the packaged agent skill into `<path>/mediagen/`; re-run to replace it |
43
53
 
44
54
  `mediagen image generate --help` and `mediagen video generate --help` are the
45
55
  reference: every flag, the model table, the size reference, examples. Everything below
@@ -254,22 +264,6 @@ download and 600 s per video download. For video that budget is the *whole* poll
254
264
  window, not one request: each create or poll gets 60 s, so a hung request cannot eat
255
265
  the budget, and the download has its own 600 s and is not counted against it.
256
266
 
257
- Working from an agent? Inside pi, install the skill as a pi package:
258
-
259
- ```bash
260
- pi install npm:@yandy0725/mediagen-cli
261
- ```
262
-
263
- That delivers `skills/mediagen/SKILL.md` only: pi never puts the `mediagen` command on
264
- `PATH`, so the CLI still comes from `npm install -g @yandy0725/mediagen-cli`. For any other
265
- agent, `mediagen skill install --dir <skills dir>` puts the same file where that agent
266
- already looks — e.g. `--dir ~/.claude/skills` — and re-running it after an upgrade replaces
267
- the old copy. Use one route, not both: pi loads skills by name, so the two copies collide — the
268
- directory you copied wins and pi only reports a `name "mediagen" collision` warning, which
269
- means a stale copy silently shadows the upgraded package. The skill describes what this CLI
270
- does, which tool to prefer when the project already generates media another way, and the
271
- rules that keep a paid request from being wasted.
272
-
273
267
  ---
274
268
 
275
269
  ## Development
package/README.zh-CN.md CHANGED
@@ -27,6 +27,15 @@ mediagen image generate "a red fox in fresh snow, soft morning light" --provider
27
27
 
28
28
  Node >= 18,两个运行时依赖,需要 DashScope 和/或方舟的 API key。
29
29
 
30
+ ## 在 Agent 里用
31
+
32
+ `skills/mediagen/SKILL.md` 这份技能告诉 agent 这个 CLI 能做什么、哪些规则能避免白花钱。两种装法:
33
+
34
+ ```bash
35
+ npx skills add yandy/mediagen-cli
36
+ mediagen skills install --dir ~/.claude/skills
37
+ ```
38
+
30
39
  ## 命令
31
40
 
32
41
  | 命令 | 作用 |
@@ -38,7 +47,7 @@ Node >= 18,两个运行时依赖,需要 DashScope 和/或方舟的 API key
38
47
  | `mediagen login` / `logout` / `auth status` | 保存、删除、查看 API key |
39
48
  | `mediagen config show` / `config path` | 解析后的配置,以及它存在哪里 |
40
49
  | `mediagen config add <name>` | 在 config.toml 里新建一条 provider(其余修改手写文件) |
41
- | `mediagen skill install --dir <path>` | 把自带的 agent 技能装到 `<path>/mediagen/`;重跑即覆盖 |
50
+ | `mediagen skills install --dir <path>` | 把自带的 agent 技能装到 `<path>/mediagen/`;重跑即覆盖 |
42
51
 
43
52
  `mediagen image generate --help` 与 `mediagen video generate --help` 才是参考手册:
44
53
  全部参数、模型表、尺寸表、示例。下面只是简化版。
@@ -229,19 +238,6 @@ OpenAI 兼容端点(`compatible-mode`)只在业务空间专属域名上提
229
238
  `timeout_seconds` 是**整个轮询窗口**,不是单次请求:建任务与每次轮询各自 60 秒,这样一个挂住
230
239
  的请求吃不掉预算;下载另有 600 秒,不计入预算。
231
240
 
232
- 在 Agent 里用?在 pi 里,把这份技能当成 pi 包安装:
233
-
234
- ```bash
235
- pi install npm:@yandy0725/mediagen-cli
236
- ```
237
-
238
- 它只送 `skills/mediagen/SKILL.md`:pi 不会把 `mediagen` 命令放进 `PATH`,命令仍来自
239
- `npm install -g @yandy0725/mediagen-cli`。其他 agent 用 `mediagen skill install --dir <技能目录>`
240
- 把同一个文件装到它已经在读的位置(例如 `--dir ~/.claude/skills`),升级后重跑一次即可覆盖。
241
- 两条路线只选一条:pi 按技能名加载,两份同名技能会冲突——复制出来的那份胜出,pi 只给一条
242
- name "mediagen" collision 警告,于是旧副本会静默盖住升级后的包。这份技能说明这个 CLI
243
- 能做什么、项目已有别的生成工具时该用哪个,以及哪些规则能避免白花钱。
244
-
245
241
  ---
246
242
 
247
243
  ## 开发
package/dist/cli.js CHANGED
@@ -102,12 +102,12 @@ default_provider = "volcengine"
102
102
 
103
103
  [providers.volcengine]
104
104
  base_url = "https://ark.cn-beijing.volces.com"
105
- api_key_env = "ARK_API_KEY" # which environment variable holds this provider's key
105
+ api_key_env = "VOLCENGINE_API_KEY" # which environment variable holds this provider's key
106
106
 
107
107
  [providers.volcengine.image]
108
108
  api_type = "ark"
109
109
  default = "doubao-seedream-5-0-flash-260915"
110
- models = ["doubao-seedream-5-0-flash-260915", "doubao-seedream-5-0-pro"]
110
+ models = ["doubao-seedream-5-0-flash-260915", "doubao-seedream-5-0-pro-260628"]
111
111
 
112
112
  [providers.volcengine.video]
113
113
  api_type = "ark"
@@ -120,7 +120,7 @@ models = ["doubao-seedance-1-0-pro-250528"] # ids are dated snapshots; add m
120
120
  # instead \u2014 https://{workspace-id}.cn-beijing.maas.aliyuncs.com \u2014 which is also
121
121
  # where Alibaba recommends sending native calls.
122
122
  base_url = "https://dashscope.aliyuncs.com"
123
- api_key_env = "DASHSCOPE_API_KEY"
123
+ api_key_env = "ALIYUN_API_KEY"
124
124
 
125
125
  [providers.aliyun.image]
126
126
  api_type = "dashscope" # input.messages + parameters, output.choices[].image
@@ -2500,7 +2500,7 @@ Subcommands:
2500
2500
  config show the resolved configuration, with a source note for each value
2501
2501
  config path where config.toml lives
2502
2502
  config add create a provider in config.toml (edit the file for anything else)
2503
- skill install copy the agent skill this package ships into a directory you name
2503
+ skills install copy the agent skill this package ships into a directory you name
2504
2504
  video generate create and pay for a video task, then save the result
2505
2505
  video status look at one task once, and save its video if it finished
2506
2506
 
@@ -2746,8 +2746,8 @@ function createProgram(options = {}) {
2746
2746
  config.command("add <name>").description("Create a [providers.<name>] table in config.toml").option("--api-type <dialect>", "protocol dialect: openai, dashscope, ark or minimax").option("--base-url <url>", "the provider's origin, e.g. https://ark.cn-beijing.volces.com").option("--task <image|video>", "which task table to create (default: image)").option("--model <id>", "the model id this task defaults to").option("--api-key-env <VAR>", "environment variable holding this provider's key").option("--json", "print a JSON result").action(async (name, flags) => {
2747
2747
  runConfigAdd(name, flags);
2748
2748
  });
2749
- const skill = program.command("skill").description("Install the agent skill this package ships");
2750
- skill.command("install").description("Copy the skill into a directory an agent reads skills from, replacing an older copy").option("--dir <path>", "the skills directory, e.g. ~/.claude/skills (the skill lands in <path>/mediagen)").option("--json", "print a JSON result").action(async (flags) => {
2749
+ const skills = program.command("skills").description("Install the agent skill this package ships");
2750
+ skills.command("install").description("Copy the skill into a directory an agent reads skills from, replacing an older copy").option("--dir <path>", "the skills directory, e.g. ~/.claude/skills (the skill lands in <path>/mediagen)").option("--json", "print a JSON result").action(async (flags) => {
2751
2751
  runSkillInstall(flags);
2752
2752
  });
2753
2753
  const image = program.command("image").description("Generate and edit images");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yandy0725/mediagen-cli",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Non-interactive image generation and editing, plus short video generation, for agents: qwen-image, doubao/seedream, doubao/seedance, MiniMax H3, files on disk, JSON output.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,13 +11,7 @@
11
11
  "dist",
12
12
  "skills"
13
13
  ],
14
- "pi": {
15
- "skills": [
16
- "./skills"
17
- ]
18
- },
19
14
  "keywords": [
20
- "pi-package",
21
15
  "cli",
22
16
  "image",
23
17
  "image-generation",
@@ -42,8 +42,8 @@ project has, or when the user asks for it by name.
42
42
 
43
43
  ## Setup, once
44
44
 
45
- This skill carries no binary: `mediagen` must already be on `PATH`, and the pi package that
46
- delivered this skill does not put it there. If `command -v mediagen` prints nothing:
45
+ This skill carries no binary: `mediagen` must already be on `PATH`, and installing this
46
+ skill never puts it there. If `command -v mediagen` prints nothing:
47
47
 
48
48
  ```bash
49
49
  npm install -g @yandy0725/mediagen-cli