@hadialmarzooq/agent-media-cli 0.1.0 → 0.2.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 +63 -0
- package/dist/index.js +14 -1
- package/package.json +6 -4
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @hadialmarzooq/agent-media-cli
|
|
2
|
+
|
|
3
|
+
JSON-first CLI for deterministic, verified media workflows.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Command-line interface for [Agent Media](https://github.com/HadiAlMarzooq/agent-media). Every command outputs one JSON document to stdout. Optional progress is newline-delimited JSON on stderr — so automation never receives mixed output.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @hadialmarzooq/agent-media-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Prerequisites: Node.js 22+, `ffmpeg` and `ffprobe` on `PATH`.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Inspect media metadata
|
|
21
|
+
agent-media inspect demo.mp4
|
|
22
|
+
|
|
23
|
+
# Five verified workflows
|
|
24
|
+
agent-media vertical demo.mp4 --output vertical.mp4 --max-size 25 --progress
|
|
25
|
+
agent-media optimize demo.mp4 --output web.mp4 --max-size 10 --progress
|
|
26
|
+
agent-media normalize demo.mp4 --output normalized.mp4
|
|
27
|
+
agent-media extract-audio demo.mp4 --output audio.m4a
|
|
28
|
+
agent-media extract-frame demo.mp4 --output frame.jpg --at 2
|
|
29
|
+
|
|
30
|
+
# Explicit plan → execute → verify pipeline
|
|
31
|
+
agent-media plan demo.mp4 --aspect 9:16 --max-size 25 --out plan.json
|
|
32
|
+
agent-media execute plan.json --output replay.mp4 --progress
|
|
33
|
+
agent-media verify replay.mp4 --against plan.json
|
|
34
|
+
|
|
35
|
+
# Detect local FFmpeg capabilities
|
|
36
|
+
agent-media capabilities
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Output format
|
|
40
|
+
|
|
41
|
+
Successes write JSON to stdout:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"path": "/abs/path/vertical.mp4",
|
|
46
|
+
"kind": "video",
|
|
47
|
+
"video": { "width": 1080, "height": 1920, "codec": "h264", "pixelFormat": "yuv420p" },
|
|
48
|
+
"verification": { "passed": true, "checks": { ... }, "failures": [] }
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Failures write structured JSON to stderr with stable `code`, `message`, `context`, and `suggestedActions`.
|
|
53
|
+
|
|
54
|
+
## Documentation
|
|
55
|
+
|
|
56
|
+
- [Full docs](https://github.com/HadiAlMarzooq/agent-media/tree/main/docs)
|
|
57
|
+
- [Getting started](https://github.com/HadiAlMarzooq/agent-media/blob/main/docs/getting-started.md)
|
|
58
|
+
- [API reference](https://github.com/HadiAlMarzooq/agent-media/blob/main/docs/api.md)
|
|
59
|
+
- [Errors and recovery](https://github.com/HadiAlMarzooq/agent-media/blob/main/docs/errors.md)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
optimizeForWeb,
|
|
22
22
|
normalize,
|
|
23
23
|
extractAudio,
|
|
24
|
-
extractFrame
|
|
24
|
+
extractFrame,
|
|
25
|
+
concatenate
|
|
25
26
|
} from "@hadialmarzooq/agent-media-ffmpeg";
|
|
26
27
|
var packageVersion = createRequire(import.meta.url)("../package.json").version;
|
|
27
28
|
function createProgram() {
|
|
@@ -124,6 +125,18 @@ function createProgram() {
|
|
|
124
125
|
})
|
|
125
126
|
);
|
|
126
127
|
});
|
|
128
|
+
program.command("concatenate <input>").description("Concatenate multiple media sources into a single verified output.").requiredOption("--inputs <paths...>", "additional input paths to concatenate").requiredOption("--output <path>", "output media path").option("--overwrite", "allow output replacement").option("--progress", "write NDJSON progress events to stderr").action(async (input, options) => {
|
|
129
|
+
const onProgress = progressWriter(Boolean(options.progress));
|
|
130
|
+
print(
|
|
131
|
+
await concatenate({
|
|
132
|
+
input,
|
|
133
|
+
inputs: options.inputs,
|
|
134
|
+
output: options.output,
|
|
135
|
+
overwrite: options.overwrite,
|
|
136
|
+
...onProgress === void 0 ? {} : { onProgress }
|
|
137
|
+
})
|
|
138
|
+
);
|
|
139
|
+
});
|
|
127
140
|
program.command("execute <plan>").description("Execute a saved plan.").requiredOption("--output <path>", "output media path").option("--overwrite", "allow output replacement").option("--progress", "write NDJSON progress events to stderr").action(async (planPath, options) => {
|
|
128
141
|
const plan = parsePlan(await readFile(planPath, "utf8"));
|
|
129
142
|
const onProgress = progressWriter(Boolean(options.progress));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadialmarzooq/agent-media-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "JSON-first CLI for deterministic, verified media workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"media",
|
|
@@ -29,15 +29,17 @@
|
|
|
29
29
|
"main": "./dist/index.js",
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
|
-
"dist"
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
33
35
|
],
|
|
34
36
|
"publishConfig": {
|
|
35
37
|
"access": "public"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"commander": "15.0.0",
|
|
39
|
-
"@hadialmarzooq/agent-media-core": "0.
|
|
40
|
-
"@hadialmarzooq/agent-media-ffmpeg": "0.
|
|
41
|
+
"@hadialmarzooq/agent-media-core": "0.2.0",
|
|
42
|
+
"@hadialmarzooq/agent-media-ffmpeg": "0.2.0"
|
|
41
43
|
},
|
|
42
44
|
"scripts": {
|
|
43
45
|
"build": "tsup src/index.ts --format esm --dts",
|