zerocut-cli 0.1.1 → 0.1.2

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,6 @@
1
1
  {
2
2
  "name": "zerocut-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "ZeroCut CLI: AI assistant CLI for creating and editing images/audio/video",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,24 @@ import { createProgressSpinner } from "../utils/progress";
7
7
  export const name = "video";
8
8
  export const description = "Video command: create video";
9
9
 
10
+ function resolveResultUrl(result: unknown): string | undefined {
11
+ if (!result || typeof result !== "object") {
12
+ return undefined;
13
+ }
14
+ const record = result as Record<string, unknown>;
15
+ if (typeof record.url === "string" && record.url.length > 0) {
16
+ return record.url;
17
+ }
18
+ const data = record.data;
19
+ if (data && typeof data === "object") {
20
+ const dataRecord = data as Record<string, unknown>;
21
+ if (typeof dataRecord.url === "string" && dataRecord.url.length > 0) {
22
+ return dataRecord.url;
23
+ }
24
+ }
25
+ return undefined;
26
+ }
27
+
10
28
  export function register(program: Command): void {
11
29
  const parent = program.command("video").description("Create a new video; requires --prompt");
12
30
 
@@ -137,11 +155,12 @@ export function register(program: Command): void {
137
155
  : undefined,
138
156
  onProgress: createProgressSpinner("inferencing"),
139
157
  });
158
+ const initialUrl = resolveResultUrl(res);
140
159
  try {
141
- if (res?.url) {
142
- const tosUrl = await syncToTOS(res.url as string);
160
+ if (initialUrl) {
161
+ const tosUrl = await syncToTOS(initialUrl);
143
162
  if (tosUrl) {
144
- res.url = tosUrl;
163
+ (res as Record<string, unknown>).url = tosUrl;
145
164
  }
146
165
  }
147
166
  } catch {}
@@ -149,7 +168,15 @@ export function register(program: Command): void {
149
168
  const output = typeof opts.output === "string" ? opts.output : undefined;
150
169
  if (output) {
151
170
  const dir = process.cwd();
152
- const url = res.url;
171
+ const url = resolveResultUrl(res);
172
+ if (!url) {
173
+ process.stderr.write(
174
+ "Cannot save --output because no video URL was returned. Please retry later or run without --output to inspect raw response.\n"
175
+ );
176
+ process.exitCode = 1;
177
+ console.log(res);
178
+ return;
179
+ }
153
180
  const response = await fetch(url);
154
181
  const buffer = Buffer.from(await response.arrayBuffer());
155
182
  const filePath = path.resolve(dir, output);
@@ -73,7 +73,9 @@ Validation rules:
73
73
  - `--prompt` must be non-empty
74
74
  - `--model` allowed: `seedream|seedream-pro|seedream-5l|banana|banana2|banana-pro|wan`
75
75
  - `--aspectRatio` allowed: `1:1|3:4|4:3|16:9|9:16|2:3|3:2|21:9|1:4|4:1|1:8|8:1`
76
+ - unless user specifies aspect ratio, default to `16:9`
76
77
  - `--resolution` allowed: `1K|2K|4K`
78
+ - unless user specifies resolution, default to `1K`
77
79
 
78
80
  ### video
79
81
 
@@ -107,6 +109,8 @@ Validation rules:
107
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`
108
110
  - `--duration` must be integer in `1-16`
109
111
  - `--aspectRatio` allowed: `9:16|16:9|1:1`
112
+ - unless user specifies aspect ratio, default to `16:9`
113
+ - unless user specifies resolution, default to `720p`
110
114
 
111
115
  Long video guidance:
112
116