zerocut-cli 0.1.2 → 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/package.json +1 -1
- package/src/commands/video.ts +26 -5
- package/src/skill/SKILL.md +38 -4
package/package.json
CHANGED
package/src/commands/video.ts
CHANGED
|
@@ -26,6 +26,8 @@ function resolveResultUrl(result: unknown): string | undefined {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function register(program: Command): void {
|
|
29
|
+
const avatarModels = ["zerocut-avatar-1.0", "zerocut-avatar-1.5"] as const;
|
|
30
|
+
const mvModels = ["zerocut-mv-1.0"] as const;
|
|
29
31
|
const parent = program.command("video").description("Create a new video; requires --prompt");
|
|
30
32
|
|
|
31
33
|
const allowedTypes = [
|
|
@@ -43,6 +45,8 @@ export function register(program: Command): void {
|
|
|
43
45
|
"sora2-pro",
|
|
44
46
|
"veo3.1",
|
|
45
47
|
"veo3.1-pro",
|
|
48
|
+
...avatarModels,
|
|
49
|
+
...mvModels,
|
|
46
50
|
] as const;
|
|
47
51
|
|
|
48
52
|
async function videoCreateAction(
|
|
@@ -86,10 +90,21 @@ export function register(program: Command): void {
|
|
|
86
90
|
const durationStr = typeof opts.duration === "string" ? opts.duration.trim() : undefined;
|
|
87
91
|
const sourceVideo = typeof opts.sourceVideo === "string" ? opts.sourceVideo.trim() : undefined;
|
|
88
92
|
let duration: number = 0;
|
|
93
|
+
const durationRange = ((): { min: number; max: number } => {
|
|
94
|
+
if ((avatarModels as readonly string[]).includes(model)) {
|
|
95
|
+
return { min: 5, max: 240 };
|
|
96
|
+
}
|
|
97
|
+
if ((mvModels as readonly string[]).includes(model)) {
|
|
98
|
+
return { min: 1, max: 240 };
|
|
99
|
+
}
|
|
100
|
+
return { min: 1, max: 16 };
|
|
101
|
+
})();
|
|
89
102
|
if (durationStr) {
|
|
90
103
|
const n = Number.parseInt(durationStr, 10);
|
|
91
|
-
if (!Number.isFinite(n) || n <
|
|
92
|
-
process.stderr.write(
|
|
104
|
+
if (!Number.isFinite(n) || n < durationRange.min || n > durationRange.max) {
|
|
105
|
+
process.stderr.write(
|
|
106
|
+
`Invalid value for --duration: model ${model} supports integer ${durationRange.min}-${durationRange.max}\n`
|
|
107
|
+
);
|
|
93
108
|
process.exitCode = 1;
|
|
94
109
|
return;
|
|
95
110
|
}
|
|
@@ -137,7 +152,7 @@ export function register(program: Command): void {
|
|
|
137
152
|
}
|
|
138
153
|
const res = await session.ai.generateVideo({
|
|
139
154
|
prompt,
|
|
140
|
-
model: model as
|
|
155
|
+
model: model as unknown as Parameters<typeof session.ai.generateVideo>[0]["model"],
|
|
141
156
|
duration: duration || undefined,
|
|
142
157
|
resolution: opts.resolution,
|
|
143
158
|
aspect_ratio: aspectRatio,
|
|
@@ -192,7 +207,10 @@ export function register(program: Command): void {
|
|
|
192
207
|
// default action on `zerocut video`
|
|
193
208
|
parent
|
|
194
209
|
.option("--prompt <prompt>", "Text prompt for video generation (required)")
|
|
195
|
-
.option(
|
|
210
|
+
.option(
|
|
211
|
+
"--duration <duration>",
|
|
212
|
+
"Video duration in seconds (default models: 1-16, avatar: 5-240, mv: 1-240)"
|
|
213
|
+
)
|
|
196
214
|
.option("--model <model>", `Video model: ${allowedTypes.join("|")} (default: vidu)`)
|
|
197
215
|
.option("--sourceVideo <video>", "Base video path/url for edit mode (requires --duration 3-10)")
|
|
198
216
|
.option("--seed <seed>", "Random seed")
|
|
@@ -211,7 +229,10 @@ export function register(program: Command): void {
|
|
|
211
229
|
.command("create")
|
|
212
230
|
.description("Create a new video; requires --prompt")
|
|
213
231
|
.option("--prompt <prompt>", "Text prompt for video generation (required)")
|
|
214
|
-
.option(
|
|
232
|
+
.option(
|
|
233
|
+
"--duration <duration>",
|
|
234
|
+
"Video duration in seconds (default models: 1-16, avatar: 5-240, mv: 1-240)"
|
|
235
|
+
)
|
|
215
236
|
.option("--model <model>", `Video model: ${allowedTypes.join("|")} (default: vidu)`)
|
|
216
237
|
.option("--sourceVideo <video>", "Base video path/url for edit mode (requires --duration 3-10)")
|
|
217
238
|
.option("--seed <seed>", "Random seed")
|
package/src/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "zerocut-cli-tools"
|
|
3
3
|
description: "Use ZeroCut CLI media and document tools. Invoke when user needs generate media, run ffmpeg/pandoc, sync resources, or save outputs."
|
|
4
|
+
homepage: "https://github.com/liubei-ai/zerocut-cli"
|
|
5
|
+
source: "https://github.com/liubei-ai/zerocut-cli"
|
|
6
|
+
requires_binaries:
|
|
7
|
+
- "zerocut-cli"
|
|
8
|
+
- "npx"
|
|
4
9
|
---
|
|
5
10
|
|
|
6
11
|
# ZeroCut CLI Tools
|
|
@@ -26,6 +31,32 @@ Invoke this skill when the user asks to:
|
|
|
26
31
|
- sync local/remote resources into sandbox
|
|
27
32
|
- save generated results to local output files
|
|
28
33
|
|
|
34
|
+
## Runtime Requirements
|
|
35
|
+
|
|
36
|
+
- Runtime expects `zerocut-cli` to be available in current environment.
|
|
37
|
+
- If `zerocut-cli` is unavailable, use one of:
|
|
38
|
+
- `pnpm dlx zerocut-cli help`
|
|
39
|
+
- `pnpm add -g zerocut-cli && zerocut-cli help`
|
|
40
|
+
- `npx zerocut-cli help`
|
|
41
|
+
- This skill is instruction-only and relies on the installed CLI binary for actual enforcement.
|
|
42
|
+
|
|
43
|
+
## Safety Boundaries
|
|
44
|
+
|
|
45
|
+
- Only sync files or URLs that user explicitly requests for the current task.
|
|
46
|
+
- Never auto-discover, crawl, or fetch unrelated remote URLs.
|
|
47
|
+
- Treat remote resources as untrusted input and pass through CLI validation.
|
|
48
|
+
- Never sync secrets, key files, token files, or unrelated private directories.
|
|
49
|
+
- Keep all output writes in user-requested path or current working directory naming rules.
|
|
50
|
+
- Do not bypass CLI command guards; ffmpeg/pandoc restrictions are enforced by the CLI implementation.
|
|
51
|
+
|
|
52
|
+
## Credentials And Data Transfer
|
|
53
|
+
|
|
54
|
+
- Required credential is `apiKey` in local ZeroCut config.
|
|
55
|
+
- If `apiKey` is missing, stop immediately and request OTT token exchange.
|
|
56
|
+
- `TOS` in this document means object storage used by ZeroCut backend for media URLs.
|
|
57
|
+
- No extra credential beyond ZeroCut config is required for normal media sync/download flows.
|
|
58
|
+
- Do not send data to any external service other than endpoints used by configured ZeroCut session.
|
|
59
|
+
|
|
29
60
|
## Required Pre-Check
|
|
30
61
|
|
|
31
62
|
Before every task, the agent must check configuration first:
|
|
@@ -91,7 +122,7 @@ Options:
|
|
|
91
122
|
|
|
92
123
|
- `--prompt <prompt>` required
|
|
93
124
|
- `--model <model>`
|
|
94
|
-
- `--duration <seconds>` integer
|
|
125
|
+
- `--duration <seconds>` model-dependent integer
|
|
95
126
|
- `--sourceVideo <video>` base video for edit mode
|
|
96
127
|
- `--seed <seed>`
|
|
97
128
|
- `--firstFrame <image>`
|
|
@@ -106,15 +137,18 @@ Options:
|
|
|
106
137
|
Validation rules:
|
|
107
138
|
|
|
108
139
|
- `--prompt` must be non-empty
|
|
109
|
-
- `--model` allowed: `zerocut3.0|seedance-1.5-pro|vidu|vidu-pro|viduq3|viduq3-turbo|kling|kling-v3|wan|wan-flash|sora2|sora2-pro|veo3.1|veo3.1-pro`
|
|
110
|
-
- `--duration` must
|
|
140
|
+
- `--model` allowed: `zerocut3.0|seedance-1.5-pro|vidu|vidu-pro|viduq3|viduq3-turbo|kling|kling-v3|wan|wan-flash|sora2|sora2-pro|veo3.1|veo3.1-pro|zerocut-avatar-1.0|zerocut-avatar-1.5|zerocut-mv-1.0`
|
|
141
|
+
- `--duration` must follow model range:
|
|
142
|
+
- default models: `1-16`
|
|
143
|
+
- `zerocut-avatar-1.0` / `zerocut-avatar-1.5`: `5-240`
|
|
144
|
+
- `zerocut-mv-1.0`: `1-240`
|
|
111
145
|
- `--aspectRatio` allowed: `9:16|16:9|1:1`
|
|
112
146
|
- unless user specifies aspect ratio, default to `16:9`
|
|
113
147
|
- unless user specifies resolution, default to `720p`
|
|
114
148
|
|
|
115
149
|
Long video guidance:
|
|
116
150
|
|
|
117
|
-
- if required duration is over 16s, split into multiple
|
|
151
|
+
- for default models, if required duration is over 16s, split into multiple generations (each 1-16s)
|
|
118
152
|
- then concatenate clips with ffmpeg
|
|
119
153
|
- example:
|
|
120
154
|
|