@cliptude/cli 0.1.3 → 0.1.7

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
@@ -19,20 +19,52 @@ cliptude auth login
19
19
 
20
20
  ```bash
21
21
  cliptude templates
22
+ cliptude template-options --format faceless_documentary
23
+ cliptude voices --provider elevenlabs
24
+ cliptude template-create --name "TSMC doc" --format faceless_documentary --set voice_id=<id> --set voice_name=George --set generation_model=pro --set faceless_documentary_style=investigative
25
+ cliptude template-create --name "TSMC doc" --format faceless_documentary --settings-file settings.json
22
26
  cliptude generate --template "Finance vector weekly" --title "Why index funds win" --prompt "why most retail traders underperform the S&P over 10 years, keep it for beginners" --duration 3-4
23
27
  cliptude generate --template "Finance vector weekly" --title "Why index funds win" --script-file script.txt
28
+ cliptude generate --template "Finance vector weekly" --title "Why index funds win" --voiceover narration.mp3
29
+ cliptude generate --template "My talking head" --title "Weekly recap" --talking-head clip.mp4
30
+ cliptude generate --template "My avatar weekly" --title "Grandma egg trick" --script-file script.txt --avatar-ai-footage --avatar-intro-only
31
+ cliptude script --template "Finance vector weekly" --title "Why index funds win" --prompt "why most retail traders underperform the S&P" --duration 3-4
32
+ cliptude voiceover --template "Finance vector weekly" --title "Why index funds win" --script-file script.txt
33
+ cliptude download-voiceover <job-id> --out narration.mp3
34
+ cliptude editor <job-id> # editor project id, revision, timeline item ids
35
+ cliptude agent <project-id> --prompt "Replace this shot with real footage of a TSMC fab" --items clip-1 --tier smart --wait
36
+ cliptude render <project-id> --wait # new MP4 of the edited timeline
37
+ cliptude continue <job-id>
24
38
  cliptude status <job-id>
25
39
  ```
26
40
 
27
- `--title` is required. Optional `--duration` is a wizard bucket (`3-4`, `6-8`, `10-12`, …). Omit it to use the template duration, or the word-count estimate when you pass `--script`. `generate` returns immediately (`queued`). Poll `status`.
41
+ No template yet? `template-create` makes one without the create wizard: pick a `voice_id` from `voices`, and see `template-options` for every other field, its choices and its default (unset fields take the wizard default). Values are validated like the wizard; uploads (custom music, avatars, characters) still need the wizard. MCP tools: `get_template_options`, `list_voices`, `create_template`.
28
42
 
29
- Faceless bring-your-own coding:
43
+ To revise a finished video, `editor` opens its timeline (item ids, times, text), `agent` asks Cliptude Agent for an edit (it charges agent credits; reference item ids with `--items`), and `render` exports a new MP4. MCP tools: `open_editor_project`, `get_editor_project`, `run_agent`, `get_agent_run`, `cancel_agent_run`, `render_project`, `get_render`.
30
44
 
31
- ```bash
32
- cliptude generate --template "My Faceless" --title "Why index funds win" --prompt "why most retail traders underperform the S&P over 10 years, keep it for beginners" --faceless-coding external
33
- cliptude kit <job-id> --out ./kit.zip
34
- cliptude submit-project <job-id> ./project.zip
35
- ```
45
+ ### Agent-planned videos
46
+
47
+ On Faceless Documentary, Faceless Top 10 and Avatar Video templates an agent can plan every visual and leave Cliptude
48
+ only the voicing, sourcing and rendering:
49
+
50
+ 1. `cliptude plan-job` (stops at `plan_ready`), `cliptude narration <job>`.
51
+ 2. `cliptude catalog --compact`, then `--types a,b` for full entries (`--premium` lists only the premium boards).
52
+ 3. `cliptude plan-check <job> plan.json` until valid, `cliptude plan-lock <job> plan.json`, `cliptude continue <job>`.
53
+ The job stops at `ready_for_edit`: built and charged, not rendered.
54
+ 4. `cliptude plan-review <job>`: every picture or clip (asked vs used, link to the file) and every graphic (the props
55
+ it will be drawn with, or why it is missing). `cliptude plan-report <job>` adds each fallback.
56
+ 5. To revise, `plan-check` / `plan-lock` a new plan on the same job and `continue` again: same narration, unchanged
57
+ media reused, nothing more charged.
58
+ 6. Render once: `cliptude editor <job>`, `cliptude render <project> --wait`.
59
+
60
+ MCP tools: `create_plan_job`, `get_narration`, `get_kind_catalog`, `check_plan`, `lock_plan`, `get_plan`,
61
+ `continue_job`, `get_plan_review`, `get_plan_report`, then `open_editor_project` and `render_project`.
62
+ The plan sets the look (theme, style, colours, music), every graphic with its own data, colours and sound, the
63
+ footage under every beat, the transition on each cut, two-image reveals, and free sound effects; `get_kind_catalog`
64
+ lists the graphics, `transitions`, `reveal_styles` and `sounds` (with previews). The plan schema and rules are in
65
+ `skills/cliptude-plan/SKILL.md`. The job costs the same as the website price.
66
+
67
+ `--title` is required. Provide **one** of `--prompt`, `--script` / `--script-file`, `--voiceover`, or `--talking-head`. Never copy the title into `--prompt`. If you only have a topic, follow **cliptude-script** (web search → spoken narration → `--script-file`), or ask Cliptude to write it with `cliptude script`. After a completed `script` or `voiceover` job, `cliptude continue <job-id>` turns that same job into a full video (reuses the script; voiceover jobs reuse the TTS file). `--voiceover` is a local audio file (same as create.html); it is transcribed and skips TTS — do not combine it with prompt/script. `--talking-head` is a presenter video on a Talking Head template (MP4, MOV, WEBM, AVI); it is transcribed and skips TTS. Optional `--duration` is a wizard bucket (`3-4`, `6-8`, `10-12`, …). Omit it to use the template duration, or the word-count estimate when you pass `--script`. Uploaded audio or talking-head video sets duration from the file. Avatar Video templates can override **Avatar Intro Only** and **AI Image + AI Video** with `--avatar-intro-only` / `--no-avatar-intro-only` and `--avatar-ai-footage` / `--no-avatar-ai-footage`. Omit those flags to keep the template. `generate` / `script` / `voiceover` / `continue` return immediately (`queued`). Poll `status`.
36
68
 
37
69
  ## MCP
38
70
 
@@ -7,7 +7,7 @@ from typing import Any
7
7
 
8
8
  import httpx
9
9
 
10
- from cliptude_mcp.client import resolve_base_url
10
+ from cliptude_mcp.client import django_proxy_headers, resolve_base_url
11
11
 
12
12
 
13
13
  def _resource_url() -> str:
@@ -39,6 +39,7 @@ class CliptudeTokenVerifier:
39
39
  headers={
40
40
  "Authorization": f"Bearer {token}",
41
41
  "Accept": "application/json",
42
+ **django_proxy_headers(self.base_url),
42
43
  },
43
44
  )
44
45
  except httpx.HTTPError:
@@ -80,3 +81,34 @@ def auth_settings():
80
81
  resource_server_url=AnyHttpUrl(_resource_url()),
81
82
  required_scopes=["jobs"],
82
83
  )
84
+
85
+
86
+ def protected_resource_metadata() -> dict[str, Any]:
87
+ """RFC 9728 document. Served at both path-inserted and origin-root well-known URLs."""
88
+ return {
89
+ "resource": _resource_url(),
90
+ "authorization_servers": [_issuer_url()],
91
+ "bearer_methods_supported": ["header"],
92
+ "scopes_supported": ["jobs"],
93
+ }
94
+
95
+
96
+ def authorization_server_metadata() -> dict[str, Any]:
97
+ """RFC 8414 document pointing at cliptude.com (not the MCP origin)."""
98
+ issuer = _issuer_url()
99
+ return {
100
+ "issuer": issuer,
101
+ "authorization_endpoint": f"{issuer}/o/authorize/",
102
+ "token_endpoint": f"{issuer}/o/token/",
103
+ "registration_endpoint": f"{issuer}/o/register/",
104
+ "revocation_endpoint": f"{issuer}/o/revoke_token/",
105
+ "response_types_supported": ["code"],
106
+ "grant_types_supported": ["authorization_code", "refresh_token"],
107
+ "code_challenge_methods_supported": ["S256"],
108
+ "token_endpoint_auth_methods_supported": [
109
+ "none",
110
+ "client_secret_post",
111
+ "client_secret_basic",
112
+ ],
113
+ "scopes_supported": ["jobs"],
114
+ }
@@ -1,4 +1,4 @@
1
- """Tiny CLI wrapping /api/v1: auth | templates | generate | status | jobs | account | cancel."""
1
+ """Tiny CLI wrapping /api/v1: auth | templates | template-create | template-options | voices | generate | editor | agent | render | script | voiceover | continue | status | jobs | account | cancel."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -35,6 +35,36 @@ def _resolve_template_id(client: CliptudeClient, value: str) -> str:
35
35
  raise CliptudeApiError(f"Template not found: {value}")
36
36
 
37
37
 
38
+ def _parse_set_args(pairs: list[str]) -> dict:
39
+ out = {}
40
+ for pair in pairs:
41
+ key, sep, raw = pair.partition("=")
42
+ if not sep or not key.strip():
43
+ raise CliptudeApiError(f"--set expects KEY=VALUE, got {pair!r}")
44
+ try:
45
+ value = json.loads(raw)
46
+ except json.JSONDecodeError:
47
+ value = raw
48
+ out[key.strip()] = value
49
+ return out
50
+
51
+
52
+ _DONE_STATUSES = {"completed", "failed", "cancelled", "conflict"}
53
+
54
+
55
+ def _wait(fetch, status_of, *, interval: float = 10.0, timeout: float = 3600.0):
56
+ import time
57
+
58
+ deadline = time.monotonic() + timeout
59
+ while True:
60
+ payload = fetch()
61
+ status = str(status_of(payload) or "").lower()
62
+ if status in _DONE_STATUSES or time.monotonic() > deadline:
63
+ return payload
64
+ print(f"{status or 'pending'}...", file=sys.stderr)
65
+ time.sleep(interval)
66
+
67
+
38
68
  def _run_auth(auth_cmd: str) -> None:
39
69
  from cliptude_mcp.auth_login import AuthLoginError, login
40
70
  from cliptude_mcp.credentials import clear_credentials, stored_access_token
@@ -86,6 +116,37 @@ def main(argv: list[str] | None = None) -> None:
86
116
  t.add_argument("--limit", type=int, default=20)
87
117
  t.add_argument("--offset", type=int, default=0)
88
118
 
119
+ tc = sub.add_parser(
120
+ "template-create",
121
+ help="Create a template from settings (no wizard)",
122
+ formatter_class=argparse.RawDescriptionHelpFormatter,
123
+ epilog=(
124
+ "example:\n"
125
+ ' cliptude template-create --name "TSMC doc" --format faceless_documentary '
126
+ "--set voice_id=JBFqnCBsd6RMkjVDRZzb --set voice_name=George --set generation_model=pro "
127
+ "--set faceless_documentary_style=investigative --set faceless_documentary_primary=#E11D48\n"
128
+ ' cliptude template-create --name "TSMC doc" --format faceless_documentary --settings-file settings.json\n'
129
+ "See cliptude template-options --format <format> for every field and its choices."
130
+ ),
131
+ )
132
+ tc.add_argument("--name", required=True)
133
+ tc.add_argument("--format", required=True, help="e.g. faceless_documentary, vector_explainer")
134
+ tc.add_argument("--settings-file", default="", help="JSON object of settings")
135
+ tc.add_argument(
136
+ "--set",
137
+ action="append",
138
+ default=[],
139
+ metavar="KEY=VALUE",
140
+ help="One setting; VALUE is parsed as JSON when possible (true, 0.4, [\"a\"]), else a string. Repeatable.",
141
+ )
142
+
143
+ to = sub.add_parser("template-options", help="Fields, choices and defaults for template-create")
144
+ to.add_argument("--format", required=True)
145
+
146
+ vc = sub.add_parser("voices", help="List voices for template-create (voice_id)")
147
+ vc.add_argument("--provider", default="elevenlabs", help="elevenlabs, minimax, cartesia, inworld, voicetory")
148
+ vc.add_argument("--language", default="")
149
+
89
150
  g = sub.add_parser(
90
151
  "generate",
91
152
  help="Start a job",
@@ -94,7 +155,13 @@ def main(argv: list[str] | None = None) -> None:
94
155
  "example:\n"
95
156
  ' cliptude generate --template "Finance vector weekly" --title "Why index funds win" '
96
157
  '--prompt "why most retail traders underperform the S&P over 10 years, keep it for beginners" '
97
- '--duration 3-4'
158
+ '--duration 3-4\n'
159
+ ' cliptude generate --template "Finance vector weekly" --title "Why index funds win" '
160
+ '--script-file script.txt\n'
161
+ ' cliptude generate --template "Finance vector weekly" --title "Why index funds win" '
162
+ '--voiceover narration.mp3\n'
163
+ ' cliptude generate --template "My talking head" --title "Weekly recap" '
164
+ '--talking-head clip.mp4'
98
165
  ),
99
166
  )
100
167
  g.add_argument("--template", required=True, help="Template name or UUID")
@@ -107,23 +174,207 @@ def main(argv: list[str] | None = None) -> None:
107
174
  g.add_argument("--script", default="")
108
175
  g.add_argument("--script-file", default="")
109
176
  g.add_argument(
110
- "--faceless-coding",
177
+ "--voiceover",
178
+ default="",
179
+ help="Path to a narration audio file (MP3, M4A, WAV, …). Transcribed; skips TTS. Do not combine with --prompt or --script.",
180
+ )
181
+ g.add_argument(
182
+ "--talking-head",
111
183
  default="",
112
- help="external = you author Faceless storyboard/HTML; omit for Cliptude coding",
184
+ help="Path to a talking-head presenter video (MP4, MOV, WEBM, AVI). Requires a Talking Head template. Transcribed; skips TTS. Do not combine with --prompt, --script, or --voiceover.",
113
185
  )
114
186
  g.add_argument(
115
187
  "--duration",
116
188
  default="",
117
189
  help="Wizard duration bucket, e.g. 3-4 or 6-8. Default: template duration (or estimated from --script)",
118
190
  )
191
+ g.add_argument(
192
+ "--avatar-intro-only",
193
+ action=argparse.BooleanOptionalAction,
194
+ default=None,
195
+ help=(
196
+ "Avatar Video: Avatar Intro Only (HeyGen in a short opening). "
197
+ "Omit to use the template. Only valid for Avatar Video templates."
198
+ ),
199
+ )
200
+ g.add_argument(
201
+ "--avatar-ai-footage",
202
+ action=argparse.BooleanOptionalAction,
203
+ default=None,
204
+ help=(
205
+ "Avatar Video: AI Image + AI Video instead of stock/YouTube. "
206
+ "Omit to use the template. Only valid for Avatar Video templates."
207
+ ),
208
+ )
209
+ g.add_argument(
210
+ "--disable-animations",
211
+ action=argparse.BooleanOptionalAction,
212
+ default=None,
213
+ help="No animated text reveals or motion graphics. Omit to use the template.",
214
+ )
215
+ g.add_argument(
216
+ "--disable-overlays",
217
+ action=argparse.BooleanOptionalAction,
218
+ default=None,
219
+ help="No text overlays or graphic elements over footage (captions unaffected). Omit to use the template.",
220
+ )
221
+ g.add_argument(
222
+ "--disable-effects",
223
+ action=argparse.BooleanOptionalAction,
224
+ default=None,
225
+ help="No color grading, film grain, or light leaks. Ken Burns is unaffected. Omit to use the template.",
226
+ )
227
+ g.add_argument(
228
+ "--disable-transitions",
229
+ action=argparse.BooleanOptionalAction,
230
+ default=None,
231
+ help="No scene transitions; hard cuts only. Omit to use the template.",
232
+ )
233
+ g.add_argument(
234
+ "--exclude-animation-type",
235
+ action="append",
236
+ dest="excluded_animation_types",
237
+ default=None,
238
+ metavar="TYPE",
239
+ help="Exclude an animation type from this video. Repeatable. Omit to use the template.",
240
+ )
241
+ g.add_argument(
242
+ "--exclude-transition",
243
+ action="append",
244
+ dest="excluded_transition_kinds",
245
+ default=None,
246
+ metavar="SLUG",
247
+ help="Exclude a transition (e.g. flip-horizontal) from auto-selection. Repeatable. Omit to use the template.",
248
+ )
119
249
 
120
- k = sub.add_parser("kit", help="Download Faceless coding kit zip")
121
- k.add_argument("job_id")
122
- k.add_argument("--out", default="kit.zip")
250
+ sc = sub.add_parser(
251
+ "script",
252
+ help="Generate a spoken script only (no video)",
253
+ formatter_class=argparse.RawDescriptionHelpFormatter,
254
+ epilog=(
255
+ "example:\n"
256
+ ' cliptude script --template "Finance vector weekly" --title "Why index funds win" '
257
+ '--prompt "why most retail traders underperform the S&P" --duration 3-4'
258
+ ),
259
+ )
260
+ sc.add_argument("--template", required=True, help="Template name or UUID")
261
+ sc.add_argument("--title", required=True)
262
+ sc.add_argument("--prompt", required=True, help="Topic or brief. Cliptude writes the narration.")
263
+ sc.add_argument("--duration", default="", help="Wizard duration bucket, e.g. 3-4 or 6-8")
123
264
 
124
- sp = sub.add_parser("submit-project", help="Upload Faceless project zip")
125
- sp.add_argument("job_id")
126
- sp.add_argument("zip_path")
265
+ vo = sub.add_parser(
266
+ "voiceover",
267
+ help="Generate TTS audio only (no video)",
268
+ formatter_class=argparse.RawDescriptionHelpFormatter,
269
+ epilog=(
270
+ "example:\n"
271
+ ' cliptude voiceover --template "Finance vector weekly" --title "Why index funds win" '
272
+ '--script-file script.txt'
273
+ ),
274
+ )
275
+ vo.add_argument("--template", required=True, help="Template name or UUID")
276
+ vo.add_argument("--title", required=True)
277
+ vo.add_argument("--prompt", default="", help="Topic or brief. Cliptude writes the narration then voices it.")
278
+ vo.add_argument("--script", default="")
279
+ vo.add_argument("--script-file", default="")
280
+ vo.add_argument("--duration", default="", help="Wizard duration bucket, e.g. 3-4 or 6-8")
281
+
282
+ dv = sub.add_parser("download-voiceover", help="Download voiceover MP3 for a completed voiceover job")
283
+ dv.add_argument("job_id")
284
+ dv.add_argument("--out", default="voiceover.mp3")
285
+
286
+ cont = sub.add_parser(
287
+ "continue",
288
+ help="Turn a completed script/voiceover job, or a plan job with a locked plan, into a full video",
289
+ formatter_class=argparse.RawDescriptionHelpFormatter,
290
+ epilog=(
291
+ "example:\n"
292
+ " cliptude continue <job-id>"
293
+ ),
294
+ )
295
+ cont.add_argument("job_id")
296
+
297
+ pj = sub.add_parser(
298
+ "plan-job",
299
+ help="Start an agent-planned job: Cliptude voices the narration and stops at plan_ready",
300
+ formatter_class=argparse.RawDescriptionHelpFormatter,
301
+ epilog=(
302
+ "example:\n"
303
+ ' cliptude plan-job --template "TSMC doc" --title "The island" --script-file script.txt\n'
304
+ " cliptude narration <job-id> > narration.json\n"
305
+ " cliptude catalog --format faceless_documentary --compact\n"
306
+ " cliptude plan-check <job-id> plan.json (repeat until valid)\n"
307
+ " cliptude plan-lock <job-id> plan.json && cliptude continue <job-id>\n"
308
+ " cliptude plan-report <job-id>"
309
+ ),
310
+ )
311
+ pj.add_argument("--template", required=True, help="Template name or UUID (Faceless Documentary, Top 10, Avatar Video)")
312
+ pj.add_argument("--title", required=True)
313
+ pj.add_argument("--prompt", default="", help="Topic or brief. Cliptude writes the narration.")
314
+ pj.add_argument("--script", default="")
315
+ pj.add_argument("--script-file", default="")
316
+ pj.add_argument("--voiceover", default="", help="Local audio to use as the narration (aligned, not re-voiced)")
317
+ pj.add_argument("--duration", default="", help="Wizard duration bucket, e.g. 6-8")
318
+
319
+ nr = sub.add_parser("narration", help="Numbered sentences and word timings of a plan_ready job")
320
+ nr.add_argument("job_id")
321
+
322
+ cat = sub.add_parser("catalog", help="Graphics an agent can place (kinds, types, overlay styles)")
323
+ cat.add_argument("--format", default="", help="faceless_documentary, faceless_top_10 or avatar_video")
324
+ cat.add_argument("--theme", default="")
325
+ cat.add_argument("--compact", action="store_true", help="One summary line per graphic")
326
+ cat.add_argument("--types", default="", help="Comma-separated types/styles for full entries")
327
+ cat.add_argument("--premium", action="store_true", help="Only the premium boards")
328
+
329
+ for name, text in (("plan-check", "Validate a plan file (nothing stored)"), ("plan-lock", "Validate and lock a plan file")):
330
+ pc = sub.add_parser(name, help=text)
331
+ pc.add_argument("job_id")
332
+ pc.add_argument("plan_file", help="JSON file with the cliptude.plan/v1 plan")
333
+
334
+ pg = sub.add_parser("plan-get", help="Show the locked plan")
335
+ pg.add_argument("job_id")
336
+ pv = sub.add_parser("plan-review", help="The built design beat by beat and graphic by graphic (review before rendering)")
337
+ pv.add_argument("job_id")
338
+ pr = sub.add_parser("plan-report", help="What sourcing used for each media request of the locked plan")
339
+ pr.add_argument("job_id")
340
+
341
+ ed = sub.add_parser("editor", help="Open the timeline editor project for a completed job (prints the timeline)")
342
+ ed.add_argument("job_id")
343
+
344
+ ag = sub.add_parser(
345
+ "agent",
346
+ help="Ask Cliptude Agent to edit a project's timeline",
347
+ formatter_class=argparse.RawDescriptionHelpFormatter,
348
+ epilog=(
349
+ "example:\n"
350
+ ' cliptude agent 123 --prompt "Replace this shot with real footage of a TSMC fab" --items clip-1 --wait\n'
351
+ "Item ids come from cliptude editor <job-id> (timeline[].id)."
352
+ ),
353
+ )
354
+ ag.add_argument("project_id")
355
+ ag.add_argument("--prompt", default="", help="Edit request in plain English")
356
+ ag.add_argument("--prompt-file", default="")
357
+ ag.add_argument("--items", default="", help="Comma-separated timeline item ids the request is about")
358
+ ag.add_argument("--tier", default="fast", help="fast or smart (see cliptude agent-tiers)")
359
+ ag.add_argument("--chat", default="", help="Continue an existing agent chat id")
360
+ ag.add_argument("--wait", action="store_true", help="Poll until the run finishes")
361
+
362
+ ags = sub.add_parser("agent-status", help="Get a Cliptude Agent run")
363
+ ags.add_argument("project_id")
364
+ ags.add_argument("run_id")
365
+
366
+ agc = sub.add_parser("agent-cancel", help="Cancel a Cliptude Agent run")
367
+ agc.add_argument("project_id")
368
+ agc.add_argument("run_id")
369
+
370
+ sub.add_parser("agent-tiers", help="List Cliptude Agent tiers")
371
+
372
+ rn = sub.add_parser("render", help="Render an edited project to a new MP4")
373
+ rn.add_argument("project_id")
374
+ rn.add_argument("--wait", action="store_true", help="Poll until the render finishes")
375
+
376
+ rs = sub.add_parser("render-status", help="Get an editor render (output_url when done)")
377
+ rs.add_argument("render_id")
127
378
 
128
379
  s = sub.add_parser("status", help="Get job status")
129
380
  s.add_argument("job_id")
@@ -145,11 +396,74 @@ def main(argv: list[str] | None = None) -> None:
145
396
  try:
146
397
  if args.cmd == "templates":
147
398
  _print(client.list_templates(limit=args.limit, offset=args.offset))
399
+ elif args.cmd == "template-create":
400
+ settings = {}
401
+ if args.settings_file:
402
+ settings = json.loads(Path(args.settings_file).read_text(encoding="utf-8"))
403
+ if not isinstance(settings, dict):
404
+ raise CliptudeApiError("--settings-file must contain a JSON object.")
405
+ settings.update(_parse_set_args(args.set))
406
+ _print(client.create_template(name=args.name, format=args.format, settings=settings))
407
+ elif args.cmd == "template-options":
408
+ _print(client.template_options(args.format))
409
+ elif args.cmd == "voices":
410
+ _print(client.list_voices(provider=args.provider, language=args.language or None))
148
411
  elif args.cmd == "generate":
149
412
  script = args.script
150
413
  if args.script_file:
151
414
  script = Path(args.script_file).read_text(encoding="utf-8")
152
- if not (args.prompt or script):
415
+ voiceover = (args.voiceover or "").strip()
416
+ talking_head = (args.talking_head or "").strip()
417
+ if talking_head and voiceover:
418
+ raise CliptudeApiError("Use --talking-head or --voiceover, not both.")
419
+ if talking_head and (args.prompt or script):
420
+ raise CliptudeApiError(
421
+ "Use --talking-head or --prompt/--script, not both. "
422
+ "An uploaded talking head is transcribed and used as the narration."
423
+ )
424
+ if voiceover and (args.prompt or script):
425
+ raise CliptudeApiError(
426
+ "Use --voiceover or --prompt/--script, not both. "
427
+ "An uploaded file is transcribed and used as the narration."
428
+ )
429
+ if not talking_head and not voiceover and not (args.prompt or script):
430
+ raise CliptudeApiError(
431
+ "Provide --prompt, --script / --script-file, --voiceover, or --talking-head."
432
+ )
433
+ template_id = _resolve_template_id(client, args.template)
434
+ _print(client.create_job(
435
+ template_id=template_id,
436
+ title=args.title,
437
+ prompt=args.prompt or None,
438
+ script=script or None,
439
+ duration=(args.duration or None),
440
+ voiceover_path=voiceover or None,
441
+ talking_head_path=talking_head or None,
442
+ avatar_intro_only=args.avatar_intro_only,
443
+ avatar_ai_footage=args.avatar_ai_footage,
444
+ disable_animations=args.disable_animations,
445
+ disable_overlays=args.disable_overlays,
446
+ disable_effects=args.disable_effects,
447
+ disable_transitions=args.disable_transitions,
448
+ excluded_animation_types=args.excluded_animation_types,
449
+ excluded_transition_kinds=args.excluded_transition_kinds,
450
+ ))
451
+ elif args.cmd == "script":
452
+ if not (args.prompt or "").strip():
453
+ raise CliptudeApiError("Provide --prompt.")
454
+ template_id = _resolve_template_id(client, args.template)
455
+ _print(client.create_job(
456
+ template_id=template_id,
457
+ title=args.title,
458
+ prompt=args.prompt,
459
+ duration=(args.duration or None),
460
+ output="script",
461
+ ))
462
+ elif args.cmd == "voiceover":
463
+ script = args.script
464
+ if args.script_file:
465
+ script = Path(args.script_file).read_text(encoding="utf-8")
466
+ if not (args.prompt or "").strip() and not (script or "").strip():
153
467
  raise CliptudeApiError("Provide --prompt or --script / --script-file.")
154
468
  template_id = _resolve_template_id(client, args.template)
155
469
  _print(client.create_job(
@@ -157,15 +471,79 @@ def main(argv: list[str] | None = None) -> None:
157
471
  title=args.title,
158
472
  prompt=args.prompt or None,
159
473
  script=script or None,
160
- faceless_coding=(args.faceless_coding or None),
161
474
  duration=(args.duration or None),
475
+ output="voiceover",
476
+ ))
477
+ elif args.cmd == "plan-job":
478
+ script = args.script
479
+ if args.script_file:
480
+ script = Path(args.script_file).read_text(encoding="utf-8")
481
+ voiceover = (args.voiceover or "").strip()
482
+ if not (args.prompt or "").strip() and not (script or "").strip() and not voiceover:
483
+ raise CliptudeApiError("Provide --prompt, --script / --script-file, or --voiceover.")
484
+ template_id = _resolve_template_id(client, args.template)
485
+ _print(client.create_job(
486
+ template_id=template_id,
487
+ title=args.title,
488
+ prompt=args.prompt or None,
489
+ script=script or None,
490
+ voiceover_path=voiceover or None,
491
+ duration=(args.duration or None),
492
+ output="plan",
493
+ ))
494
+ elif args.cmd == "narration":
495
+ _print(client.get_narration(args.job_id))
496
+ elif args.cmd == "catalog":
497
+ types = [t.strip() for t in (args.types or "").split(",") if t.strip()]
498
+ _print(client.get_kind_catalog(
499
+ format=args.format or None, theme=args.theme or None, compact=args.compact, types=types or None,
500
+ premium=args.premium,
162
501
  ))
163
- elif args.cmd == "kit":
502
+ elif args.cmd in ("plan-check", "plan-lock"):
503
+ plan = json.loads(Path(args.plan_file).read_text(encoding="utf-8"))
504
+ _print(client.put_plan(args.job_id, plan, dry_run=args.cmd == "plan-check"))
505
+ elif args.cmd == "plan-get":
506
+ _print(client.get_plan(args.job_id))
507
+ elif args.cmd == "plan-review":
508
+ _print(client.get_plan_review(args.job_id))
509
+ elif args.cmd == "plan-report":
510
+ _print(client.get_plan_report(args.job_id))
511
+ elif args.cmd == "download-voiceover":
164
512
  dest = Path(args.out)
165
- client.download_coding_kit_file(args.job_id, dest)
513
+ client.download_voiceover_file(args.job_id, dest)
166
514
  _print({"ok": True, "path": str(dest.resolve())})
167
- elif args.cmd == "submit-project":
168
- _print(client.submit_faceless_project(args.job_id, args.zip_path))
515
+ elif args.cmd == "continue":
516
+ _print(client.continue_job(args.job_id))
517
+ elif args.cmd == "editor":
518
+ _print(client.open_editor_project(args.job_id))
519
+ elif args.cmd == "agent":
520
+ prompt = args.prompt
521
+ if args.prompt_file:
522
+ prompt = Path(args.prompt_file).read_text(encoding="utf-8")
523
+ if not (prompt or "").strip():
524
+ raise CliptudeApiError("Provide --prompt or --prompt-file.")
525
+ items = [i.strip() for i in (args.items or "").split(",") if i.strip()]
526
+ payload = client.run_agent(
527
+ args.project_id, prompt=prompt, tier=args.tier, referenced_item_ids=items, chat_id=args.chat or None
528
+ )
529
+ if args.wait:
530
+ run_id = (payload.get("run") or {}).get("id")
531
+ payload = _wait(lambda: client.get_agent_run(args.project_id, run_id), lambda p: (p.get("run") or {}).get("status"))
532
+ _print(payload)
533
+ elif args.cmd == "agent-status":
534
+ _print(client.get_agent_run(args.project_id, args.run_id))
535
+ elif args.cmd == "agent-cancel":
536
+ _print(client.cancel_agent_run(args.project_id, args.run_id))
537
+ elif args.cmd == "agent-tiers":
538
+ _print(client.agent_tiers())
539
+ elif args.cmd == "render":
540
+ payload = client.render_project(args.project_id)
541
+ if args.wait:
542
+ render_id = (payload.get("render") or {}).get("id")
543
+ payload = _wait(lambda: client.get_render(render_id), lambda p: (p.get("render") or {}).get("status"))
544
+ _print(payload)
545
+ elif args.cmd == "render-status":
546
+ _print(client.get_render(args.render_id))
169
547
  elif args.cmd == "status":
170
548
  _print(client.get_job(args.job_id))
171
549
  elif args.cmd == "jobs":