@yandy0725/mediagen-cli 0.0.0-stage → 0.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.
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@yandy0725/mediagen-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
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
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "mediagen": "./dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "skills"
13
+ ],
14
+ "keywords": [
15
+ "cli",
16
+ "image",
17
+ "image-generation",
18
+ "image-editing",
19
+ "video",
20
+ "video-generation",
21
+ "text-to-video",
22
+ "seedance",
23
+ "minimax",
24
+ "text-to-image",
25
+ "qwen",
26
+ "dashscope",
27
+ "seedream",
28
+ "doubao",
29
+ "ark",
30
+ "agent"
31
+ ],
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "scripts": {
36
+ "build": "tsup src/cli.ts --format esm --target node18 --clean",
37
+ "test": "vitest run",
38
+ "dev": "tsx src/cli.ts",
39
+ "prepack": "npm run build"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/yandy/mediagen-cli.git"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/yandy/mediagen-cli/issues"
47
+ },
48
+ "homepage": "https://github.com/yandy/mediagen-cli#readme",
49
+ "publishConfig": {
50
+ "access": "public",
51
+ "registry": "https://registry.npmjs.org/"
52
+ },
53
+ "dependencies": {
54
+ "commander": "^12.1.0",
55
+ "smol-toml": "^1.3.1"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^22.10.2",
59
+ "tsup": "^8.3.5",
60
+ "tsx": "^4.19.2",
61
+ "typescript": "^5.7.2",
62
+ "vitest": "^2.1.8"
63
+ }
64
+ }
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: mediagen
3
+ description: How to drive `mediagen`, a non-interactive CLI that generates and edits images and generates short videos, writing every result to a local file and printing its path. Covers what it can and cannot do, one-time setup, four commands worth copying, and the rules that keep a paid request from being wasted.
4
+ ---
5
+
6
+ # mediagen
7
+
8
+ Images and video from a command line: every result is written to a local file and the path
9
+ is printed. Each successful call is a paid vendor request — and for video the money is
10
+ spent when the task is created, minutes before the clip exists.
11
+
12
+ Flags, models, sizes, exit codes and more examples live in the CLI itself:
13
+
14
+ ```bash
15
+ mediagen --help
16
+ mediagen image generate --help
17
+ mediagen video generate --help
18
+ ```
19
+
20
+ ## What it does
21
+
22
+ - `image generate "<prompt>"` — a new image from a description.
23
+ - `image edit "<prompt>" --image ./photo.jpg` — a change to an existing image: restyle,
24
+ recolour, add or remove something, render text (CJK or Latin) into it, upscale (the same
25
+ `--image` with a larger `--size`), or combine several references (repeat `--image`, and
26
+ say which image is which in the prompt).
27
+ - `video generate "<prompt>"` — a short clip from text, or from one first frame.
28
+ - `video status <task-id>` — collect a clip whose run was interrupted. Reads only; it
29
+ cannot spend money.
30
+
31
+ ## What it cannot do
32
+
33
+ Audio, documents, long-form video, editing or joining existing clips, describing or
34
+ analysing an image (it writes images, it cannot see them), and local pixel work — crop,
35
+ resize, convert, compress. Those belong to other tools.
36
+
37
+ ## If the project already generates media
38
+
39
+ Another CLI, a hosted service, a script in the repo, a provider the user already pays for:
40
+ use that one. `mediagen` is one option among several, so reach for it when it is what the
41
+ project has, or when the user asks for it by name.
42
+
43
+ ## Setup, once
44
+
45
+ ```bash
46
+ mediagen config show # any command writes and validates config.toml on first use
47
+ mediagen login --api-key sk-... # the key for the default provider; --provider <name> for another
48
+ mediagen auth status # which key each provider would use, masked
49
+ ```
50
+
51
+ Providers, their protocols and their models live in `config.toml`; `mediagen config add`
52
+ creates an entry without hand-editing, and `mediagen config show` prints what resolves.
53
+ The README covers the file's shape.
54
+
55
+ ## Four commands worth copying
56
+
57
+ ```bash
58
+ # a new image; files land in --out-dir (default: config output_dir, else the cwd)
59
+ mediagen image generate "a red fox in fresh snow, soft morning light" --out-dir ./out
60
+
61
+ # change a local image (local paths are read and sent as data URLs)
62
+ mediagen image edit "make the sky sunset orange, keep the composition" --image ./photo.jpg
63
+
64
+ # a video task without waiting for the render (the id comes back immediately)
65
+ mediagen video generate "a fox running through deep snow, golden hour" --no-wait --json
66
+
67
+ # collect a task you already paid for; nothing is created and nothing is billed
68
+ mediagen video status cgt-20261028-abcd --json
69
+ ```
70
+
71
+ These go to whichever entry `config.toml` marks as its default. `--provider <name>` picks a
72
+ different entry from that file; the names in the CLI's own examples are only what the first
73
+ run seeds, and `mediagen config show` prints the ones this machine has.
74
+
75
+ Add `--json` whenever you intend to parse the result: without it stdout is one absolute
76
+ path per line and warnings go to stderr. Keep `--n` at 1 while iterating on a prompt: on
77
+ some dialects each image is a separate paid request (`image generate --help` says which).
78
+
79
+ ## Rules
80
+
81
+ 1. Report the saved path(s) exactly as printed. That is the deliverable; a generation the
82
+ user cannot find was wasted money.
83
+ 2. Never re-run a request that already produced files, and never re-submit a video task
84
+ whose id you have: `video status <id>` collects it without paying again. Retry only a
85
+ clean failure that produced no task at all.
86
+ 3. Never print an API key. The CLI only ever prints it masked.
87
+ 4. When your own command timeout is short, prefer `video generate --no-wait --json`: a
88
+ blocking generate that you kill mid-poll leaves a paid task behind.