@gitruck/cli 1.1.9 → 1.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/AGENT.md +37 -1
- package/CHANGELOG.md +602 -390
- package/README.en.md +79 -11
- package/README.md +77 -11
- package/dist/index.js +262 -223
- package/package.json +69 -68
- package/skills/gtrk-ai-drama/SKILL.md +1 -1
- package/skills/gtrk-food-recap/SKILL.md +1 -1
- package/skills/gtrk-live-slicing/SKILL.md +2 -0
- package/skills/gtrk-mg/SKILL.md +35 -3
- package/skills/gtrk-narration/SKILL.md +1 -0
- package/skills/gtrk-talking-head/SKILL.md +42 -1
- package/skills/gtrk-travel-recap/SKILL.md +2 -0
- package/skills/gtrk-voiceover/SKILL.md +4 -2
package/README.en.md
CHANGED
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
| ⚙️ | `gtrk init` | Guided one-time setup (API key + Jianying draft folder), then forget about it |
|
|
35
35
|
| 🩺 | `gtrk doctor` | Health check: config / cloud connectivity / Jianying folder / runtime in one shot |
|
|
36
36
|
| 📦 | `gtrk deps` | Runtime assets: `status` shows where ffmpeg/fonts come from and under which licence, `install` fetches them from the Gitruck Cloud mirror (**must be triggered explicitly — never a silent auto-download**) |
|
|
37
|
-
| 🤖 | `gtrk skills install` | Installs the
|
|
37
|
+
| 🤖 | `gtrk skills install` | Installs the 18 bundled CLI skills into the agents detected on this machine, via the generic `skills` adapter plus a gtrk supplement layer; `--all` covers every registered host; `gtrk skills recommend --scene <id>` browses the bundled third-party skill catalog (snapshot, offline, recommend-only) and `gtrk skills add <owner/repo>` installs through the adapter and registers the skill in the show config `style.skills` |
|
|
38
38
|
| ⬆️ | `gtrk upgrade` | Upgrade the CLI to the latest version + refresh skills (config preserved); `--check` only reports |
|
|
39
|
-
| 🎞️ | `gtrk render` | Render a gtrk project (EDL) locally → finished mp4 (requires ffmpeg); output frames are allocated against the **cumulative** timeline (per-clip rounding never accumulates, so the picture cannot drift away from the voiceover); runs a QC pass afterwards and writes `.qc.json` (`--no-qc` skips it) |
|
|
39
|
+
| 🎞️ | `gtrk render` | Render a gtrk project (EDL) locally → finished mp4 (requires ffmpeg); composites **every visible overlay layer** in contract z-order (B-roll and other overlay video tracks + MG particles; `hidden` tracks stay out); output frames are allocated against the **cumulative** timeline (per-clip rounding never accumulates, so the picture cannot drift away from the voiceover); runs a QC pass afterwards and writes `.qc.json` (`--no-qc` skips it); picture-in-picture clips get their `clip_transform` (scale / position / rotation / opacity), `border_radius` corners and `clip_mask` shape masks (ellipse / rounded rectangle / heart / diamond / star, feathered) composited locally, visually matching the client preview. ⚠️ MG particles that miss the cache are cloud-rendered and **billed** (estimate + confirmation first; `--no-particles` renders particle-free at zero cost) |
|
|
40
40
|
| 🔬 | `gtrk qc <cut>` | Final-cut QC: one decoding pass over the whole file for flash frames, black/frozen frames, clipping, silence and audio/video drift, each with a timecode; `--gtrk <project>` enables project-aware detection of **intra-clip cuts**, `--fail-on error\|warn\|never` gates pipelines via the exit code |
|
|
41
41
|
| 🔎 | `gtrk matrix` | B-roll retrieval + **candidate track laying**: consumes the FILM_BROLL dispatch → produces a candidate list + downloads preview proxies and lays N candidate tracks (`--lay N`, default 1; open it in opencut and toggle track visibility to compare; `--lay 0` produces the list only); `matrix search "<query>"` is a one-off ad-hoc search; `matrix fetch <clip_id...>` pulls raw footage during the fine cut (free re-signing + download for already-granted materials, drag straight into Jianying); **local-footage mode**: `matrix index --dirs <folders>` builds a slice-free index → `--local --dirs` retrieves and lays tracks (**your footage never leaves your machine**) → `matrix lay` consumes the (editable) plan; `matrix describe` understands candidates on demand |
|
|
42
|
-
| 🎨 | `gtrk mg` | MG motion-graphics particle laying: consumes the MG dispatch → lays html-particle assets (transparent overlay / full-screen bed, produced by your show's MG skill) into the `.gtrk` `beat_track`; `mg lint <particle.html>` runs the statically checkable subset of the house rules, `mg status --project <dir>` is an orchestration dashboard; `mg render <particle.html> --duration <sec>` renders a single particle in the cloud, independent of any project, into a Jianying-readable qtrle transparent MOV (the fine-cut supplement channel); aux overlay particles can be layered on the same span (one beat derives a main particle plus `-aux<n>`). The old name `gtrk rrv` remains as a deprecated alias |
|
|
42
|
+
| 🎨 | `gtrk mg` | MG motion-graphics particle laying: consumes the MG dispatch → lays html-particle assets (transparent overlay / full-screen bed, produced by your show's MG skill) into the `.gtrk` `beat_track`; `mg lint <particle.html>` runs the statically checkable subset of the house rules, `mg status --project <dir>` is an orchestration dashboard; `mg render <particle.html> --duration <sec>` renders a single particle in the cloud, independent of any project, into a Jianying-readable qtrle transparent MOV (the fine-cut supplement channel); aux overlay particles can be layered on the same span (one beat derives a main particle plus `-aux<n>`). The old name `gtrk rrv` remains as a deprecated alias; `gtrk mg fetch` pulls neutral block skeletons from the HyperFrames registry (offline snapshot candidates, three-source fetch with our mirror first, mechanical rewrite then lint) |
|
|
43
43
|
| 🎙️ | `gtrk project init` | Audio-first project bootstrap: build a `.gtrk` project from a voice-over — main path `--tts-task <task_id>` references a completed TTS task (fetches the audio plus sentence timecodes directly, zero ASR); fallback path `--audio`+`--transcript` takes your own voice-over as a pair. Once landed, `gtrk split --project` continues the production pipeline as usual |
|
|
44
44
|
| 🎼 | `gtrk audio lay` / `tighten` | Audio-track atoms: `lay` appends an audio track to a `.gtrk` project (BGM/score; idempotent same-source replacement, no track pile-up); `--beat-align` runs cloud beat analysis and snaps the in-point to the nearest downbeat (billed once; degrades gracefully without a key or on failure). `tighten` tightens the pauses between sentences in the voice-over (purely local, zero billing; only silence straddling a sentence boundary is compressed, within-sentence breaths untouched) |
|
|
45
45
|
| 🎯 | `gtrk audio align` | Audio-video alignment part (fully local, zero billing): cross-correlates an external audio recording (lav mic / recorder) against the video to measure offset + confidence; high confidence swaps the track directly (video stream untouched byte-for-byte), low confidence emits an alignment project for the client timeline, then `--resume` reads the confirmed offset back; `--offset` swaps at an explicit offset |
|
|
@@ -148,7 +148,7 @@ Chain names above: *口播链* = talking-head (you shot yourself: short-form mon
|
|
|
148
148
|
| ③ | "**lay the B-roll base**" (two legs, one stage) | `/gtrk-matrix` → `gtrk matrix` → film/local-footage candidate tracks laid; `/gtrk-ai-drama` (skill, no command) → four-part description docs (Chinese/English blocks) | **pick/adjust B-roll in opencut** (toggle track visibility to compare); generate AI clips on an external platform and **drop them back in by hand** |
|
|
149
149
|
| ④ | "B-roll is settled, **check the composition**" | samples frames from the **merged three-source base layer** (an agent discipline, no dedicated command) | **confirm the composition** (subject position / safe areas / facing / brightness) |
|
|
150
150
|
| ⑤ | "composition looks good, **lay the MG**" | `/gtrk-mg` → `gtrk mg` → MG (incl. ov) stacked on the settled base layer | fine-tune particles (by hand in opencut) |
|
|
151
|
-
| ⑥ | "**produce the final cut**" | the desktop client's production chain (multi-lane compositing + cloud particle rendering / export
|
|
151
|
+
| ⑥ | "**produce the final cut**" | either path works: the desktop client's production chain (multi-lane compositing + cloud particle rendering / **Jianying export**), or `gtrk render` (composites every visible overlay locally into mp4; billed when particles miss the cache); both share one particle cache | final polish inside the client |
|
|
152
152
|
|
|
153
153
|
> The order exists for a reason: **AI scene clips belong to the base-layer B-roll family, not to an overlay layer** — the only overlay layer in the pipeline is MG (incl. ov). MG placement shapes itself around the picture and **depends on the final composition of the base layer**, so all three sources (film / local / AI) must land and the composition must be checked before MG goes on. Skip lanes you do not need (an empty queue in `dispatch` simply lays nothing).
|
|
154
154
|
>
|
|
@@ -196,7 +196,11 @@ CLI 写 .gtrk ─▶ 客户端打开(自动感知外部改动、先存脏改再
|
|
|
196
196
|
| **Re-inserting AI re-enactment** | AI clips generated on external platforms are **dragged into the AI_DRAMA lane by hand** and aligned to their spans (`/gtrk-ai-drama` only emits description docs; the footage is produced externally — see SOP ③: it belongs to the base-layer stage, and MG waits until it has landed) |
|
|
197
197
|
| **Final production** | Multi-lane compositing (overlay / MG / cloud-rendered particles stacked) plus Jianying draft export both live in the client's production chain |
|
|
198
198
|
|
|
199
|
-
> **`gtrk render`
|
|
199
|
+
> **`gtrk render` now composites overlays (since 1.1.10).** It stacks **every visible** overlay layer in contract z-order (ascending `track_index`) — overlay video tracks (B-roll candidates, AI re-enactment) and MG particles alike. Tracks you hid in the client (`hidden`) stay out of the cut.
|
|
200
|
+
>
|
|
201
|
+
> **The particle half is billed**: the CLI has no HTML render engine, so particles are baked into transparent MOVs in the cloud and composited locally. Metering = **unique particles × cache misses** (by the minute); on a miss you get an estimate and a confirmation prompt first (`--yes` skips it; under `--json` an explicit `--yes` is required). **A second render hits the cache entirely ⇒ zero billing**; the cache shares the same key and location as the client's Jianying export (`<project dir>/.tonghe-cache/particles/`), so particles baked by either side are reused by the other. To avoid spending, `--no-particles` renders without particles (overlay video tracks are still composited — that part is local and free).
|
|
202
|
+
>
|
|
203
|
+
> **Jianying draft export still lives in the client's production chain** (`gtrk render` only emits mp4).
|
|
200
204
|
|
|
201
205
|
## Upgrading
|
|
202
206
|
|
|
@@ -231,7 +235,7 @@ Once installed, a single sentence in any agent invokes a gtrk skill:
|
|
|
231
235
|
|  |  |
|
|
232
236
|
|  |  |
|
|
233
237
|
|
|
234
|
-
`gtrk install` installs the
|
|
238
|
+
`gtrk install` installs the 18 bundled CLI skills (`gtrk-oralcut`·`gtrk-long2short`·`gtrk-splitter`·`gtrk-matrix`·`gtrk-mg`·`gtrk-ai-drama`·`gtrk-style-maker`·`gtrk-transcript`·`gtrk-tools`·`gtrk-music-visualizer`·`gtrk-cover`·`gtrk-travel-recap`·`gtrk-live-slicing`·`gtrk-talking-head`·`gtrk-narration`·`gtrk-voiceover`·`gtrk-food-recap`·`gtrk-vlog-docu`) into the agents detected on this machine. The mechanism matches lark-cli: gtrk hands its local skill sources to the generic `skills` CLI, which owns agent detection, directory mapping and update rules; gtrk no longer hardcodes per-vendor paths.
|
|
235
239
|
|
|
236
240
|
By default `~/.agents/skills` is the single source of truth, linked into each agent's compatible directory (junctions on Windows); where linking is unavailable the adapter falls back to copying. That way updates touch one canonical copy instead of letting duplicates drift apart. Common commands:
|
|
237
241
|
|
|
@@ -270,15 +274,23 @@ Then just say "**cut a version of this talking-head**", or explicitly pick `gtrk
|
|
|
270
274
|
| ④ | (no skill) | (no command) | **Global frame-sampling composition check**: sample frames from the merged three-source base layer and have the user confirm the composition — a hard agent-discipline gate feeding ⑤'s placement decisions |
|
|
271
275
|
| ⑤ | `/gtrk-mg` | `gtrk mg` | **MG (incl. ov) goes on last** (stacked on the settled, composition-checked base layer) |
|
|
272
276
|
| — | `/gtrk-style-maker` | (no command, builds a show) | A one-time interview that builds your show's style system (skill family + show config, see next section) |
|
|
273
|
-
|
|
|
277
|
+
| ③′ | "**screen-recording PiP**" | `gtrk pip lay` | Mirror the talking-head rough cut's cut points onto a screen recording / second camera recorded in sync: lays a full-frame companion track + a muted picture-in-picture copy of the talking head (ellipse / rounded rectangle / heart / diamond / star mask, optional corner radius); purely local, zero billing; when alignment confidence is low it writes an alignment project for the client to drag into place, then `--resume` |
|
|
278
|
+
| — | (wrap-up) | `gtrk render` | Render a gtrk project locally → finished mp4 (overlays and MG particles included; particles that miss the cache are cloud-rendered and billed, `--no-particles` skips them) |
|
|
274
279
|
| ✂️ | `/gtrk-long2short` | `gtrk long2short` | Long-to-short rough cut: semantic segment selection + jump cuts → per-clip client/Jianying/Premiere projects (the raw file is never uploaded); **not part of the production SOP**, usable standalone at any time |
|
|
275
280
|
| 📝 | `/gtrk-transcript` | `gtrk transcript` | Local video / voice-over audio → one Markdown file with an agent-written summary, timecoded record and plain text; **not part of the production SOP** |
|
|
276
281
|
| 🧰 | `/gtrk-tools` | `gtrk tool <name>` | The single-shot tool family (image-to-camera-move / image & video matting …) — single request, single result, **not part of the production SOP**, usable standalone at any time |
|
|
277
282
|
| 🎵 | `/gtrk-music-visualizer` | `gtrk music-visualizer` | One song → a spectrum-visualizer video (template + optional background/cover + colour styling), **not part of the production SOP**, used standalone for audience acquisition |
|
|
278
283
|
| 🖼️ | `/gtrk-cover` | (no command, pure authoring) | The two-stage cover workbench: design diagnosis + text-to-image prompts in three sizes and two languages → you generate images on an external platform → an HTML5 typesetting workbench (drag/scroll fine-tuning, one-click export to multiple PNG sizes). Show-specific cover aesthetics are injected through the show config's `style.skills` (`produces:"cover"`); **not part of the production SOP** (it is the "stage zero" companion to distribution) |
|
|
284
|
+
| 🧭 | `/gtrk-talking-head` | orchestrates `gtrk audio` → `oralcut` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **Talking-head chain blueprint**: one or more on-camera raw takes → external audio aligned and swapped in, multi-take stitching, rough cut, dispatch, B-roll / MG cards, BGM, subtitles → a client-ready project |
|
|
285
|
+
| 🧭 | `/gtrk-travel-recap` | orchestrates `gtrk tool audio_tts_clone` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **Travel-recap blueprint**: a folder of travel footage → the AI reads the footage, writes a three-act narration, you confirm once → voice-over / project / dispatch / B-roll / cards / BGM / subtitles run unattended → a client-ready project |
|
|
286
|
+
| 🧭 | `/gtrk-live-slicing` | orchestrates `gtrk long2short` (very long replays are segmented first) | **Live-stream slicing blueprint**: a multi-hour replay → segmentation (server-side 2 h hard limit) → topic list confirmed → a batch of per-clip rough-cut projects (gtrk + Jianying + Premiere), split-screen matched to the picture |
|
|
287
|
+
| 🧭 | `/gtrk-narration` | orchestrates `gtrk transcript` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **General narration blueprint (canonical for the narration chain)**: something long that carries its own timeline (a feature film, gameplay, a restaurant visit …) → distil the outline and highlights → retell it concisely as a narration project; travel recap and food recap are its vertical instances |
|
|
288
|
+
| 🧭 | `/gtrk-voiceover` | orchestrates `gtrk tool audio_tts_clone` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **Voice-over chain quick preset**: a finished script (or one the AI writes) → voice-over → automatic visuals → cards / BGM / subtitles → a client-ready project; for material with no timeline of its own (explainers, emotional radio, opinion pieces, product copy, round-ups) |
|
|
289
|
+
| 🧭 | `/gtrk-food-recap` | follows the `/gtrk-narration` chain | **Food-recap vertical blueprint (narration-chain example)**: a restaurant-visit / fly-on-the-wall long take or a cooking-process recording → distil the highlights and retell it as a Chinese food-narration project |
|
|
290
|
+
| 🧭 | `/gtrk-vlog-docu` | orchestrates `gtrk transcript` → `tool audio_tts_clone` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **Documentary-vlog blueprint**: a batch of on-location footage → footage understanding, register choice and script, one sign-off → live-sound skeleton + narration voice-over + B-roll + subtitle layer + BGM run unattended → a client-ready project; alternates on-location sound with post-production narration, unlike the pure talking-head or pure voice-over chains |
|
|
279
291
|
|
|
280
292
|
> **Skill vs command**: `/gtrk-mg` is the **brain** — it knows it belongs at SOP step ⑤ (MG only after all three B-roll sources have landed and the composition is checked), asks for your confirmation, and resolves which particle type to produce from the show config; `gtrk mg` is the **hands** — purely deterministic lint + track laying. You trigger the skill by talking, and the skill runs the command for you.
|
|
281
|
-
> The
|
|
293
|
+
> The 18 `/gtrk-X` skills above are **framework skills bundled with the CLI** (installed by `gtrk skills install`; the list is identical to the ones in "Using it with AI agents" and "Layout") — the 7 marked 🧭 are **composite blueprints** (one sentence runs a whole chain; they only orchestrate the single-command skills above and add no commands of their own); `/gtrk-long2short` independently drives long-to-short, `/gtrk-transcript` independently drives video/audio-to-transcript, `/gtrk-tools` covers only the single-shot tool family, `/gtrk-cover` handles covers, and none of the four belong to the production SOP; `/gtrk-ai-drama`·`/gtrk-style-maker`·`/gtrk-cover` are pure authoring skills (no command). Show-specific **visual style and content** come instead from your own show's production skills (created by `/gtrk-style-maker`, bound through the show config's `style.skills`) and are never hardcoded into these framework skills.
|
|
282
294
|
|
|
283
295
|
**How each lane's actual visuals/content get produced** — what the MG looks like, what tone the AI re-enactment has — is not hardcoded into the CLI. It comes from **your own show's production skills** (created interactively with `/gtrk-style-maker`, kept locally). They are bound through the show config's **`style.skills[].produces`** (the value is the lane name), and **general-purpose drivers** such as `gtrk mg` / `gtrk matrix` consume them accordingly. **The direction is: the CLI drives the show skills** — show skills only supply style/content and carry no "which command to run" orchestration; the framework only knows lanes and pipeline interfaces, and the look always belongs to your show. Without a show, the built-in defaults are used and everything still runs end to end.
|
|
284
296
|
|
|
@@ -334,6 +346,24 @@ Run `gtrk doctor` any time for a self-check:
|
|
|
334
346
|
✅ 剪映草稿目录:C:\Users\…\com.lveditor.draft
|
|
335
347
|
```
|
|
336
348
|
|
|
349
|
+
### Enum catalog (`--refresh-catalog`)
|
|
350
|
+
|
|
351
|
+
`gtrk doctor` shows an “enum catalog” row: the CLI fetches the **complete set of public enum values**
|
|
352
|
+
from the server (subtitle styles and colours, language codes, project formats, rhythm presets,
|
|
353
|
+
task availability, …), stores it at `~/.gitruck/catalog.json`, and refreshes it every 24 hours.
|
|
354
|
+
|
|
355
|
+
With it, a bad `--subtitle-type` is rejected **before the upload starts**, with the currently valid
|
|
356
|
+
values listed. When the server adds a new style, you get it without upgrading the CLI.
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
gtrk doctor --refresh-catalog # refetch now, ignoring the 24h freshness window
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Failing to fetch it never blocks you**: the CLI falls back to the last snapshot; with no snapshot at
|
|
363
|
+
all it **skips local validation and submits anyway**, letting the server decide — the server-side
|
|
364
|
+
whitelist is always the single source of truth. Set `GITRUCK_CATALOG_OFFLINE=1` to disable the fetch
|
|
365
|
+
entirely.
|
|
366
|
+
|
|
337
367
|
### Crash reports, and how to turn them off
|
|
338
368
|
|
|
339
369
|
When gtrk crashes (uncaught exception / unhandled promise rejection / a program defect reaching the top-level exit) it automatically sends one report so we can locate the defect. **On by default; you are told once, when you first configure the CLI.**
|
|
@@ -575,7 +605,8 @@ Consumes the `dispatch.mg` dispatch landed by `gtrk split`, laying html-particle
|
|
|
575
605
|
- **House rule ⑧, repeated-primitive merging** (`8-primitive-merge`, **always non-fatal, never blocks laying**): identifies mergeable batches of `line` / `rect` / `path` / `polyline` / `polygon` that are "created inside a loop, or by a named factory called in a loop; landing under the same parent node; and not driven by per-element animation". Only batches whose purely numeric loop trip counts sum to **≥ 8** under the same parent are reported; when bounds involve `.length` or named constants and cannot be computed it still reports "count unknown" without constant folding; elements with per-element `gsap.set` / tweens, or used as a tween's first argument, are excluded. This item only points out "there is a batch of repeated primitives here that can be merged **losslessly**, pixel-identical after merging" — it is **not a risk verdict**: a hit does not mean the particle will reproduce a defect, and a miss does not mean it is safe. The real criterion remains sampling frames from a real render.
|
|
576
606
|
- **Callback and seek semantics** (`x-callback-driven` / `x-engine-api-override` / `x-raf-interval`, **always non-fatal, never blocks laying**): aligned with the same-named section of the contract (added 2026-07-26). GSAP `seek(t)` suppresses callbacks by default → tweened properties still interpolate, but DOM writes inside `onUpdate` do not run, and the failure mode is **the picture freezing at its initial state rather than going black**. The contract places the guarantee on the **engine side** (fixing a frame MUST use `seek(t,false)` / `time(t)` / `progress(p)`), so a particle **driving its picture from callbacks is a compliant style**; these three lint items are merely **sentinels**: `x-callback-driven` = callbacks write the DOM with no seek fallback anywhere (it stays silent when a fallback exists, to avoid nagging); `x-engine-api-override` = the particle overrides `tl.seek` at runtime or replaces `__timelines[…]` with a wrapper object (which would override the engine's explicit `seek(t,true)` and stops working the moment the engine switches to `time()`/`progress()`; a transitional state); `x-raf-interval` = it contains `requestAnimationFrame(` / `setInterval(` (its own clock is not driven by seek, i.e. frozen). All three MUST NOT be fatal — "driving the picture from callbacks" is not a violation.
|
|
577
607
|
- **status** (`gtrk mg status --project <dir>`): summarizes the MG pipeline — total beats in `dispatch.mg` / how many source HTML files exist / how many are laid into `.gtrk`, annotating each beat (missing HTML / produced but not laid / laid).
|
|
578
|
-
- **render** (`gtrk mg render <particle.html> --duration <sec> [--out <dir>] [--yes]`): renders a single particle in the cloud, **independent of any project**, into a Jianying-readable qtrle transparent alpha MOV (the fine-cut supplement channel — when the rough cut is already exported to Jianying and one more motion graphic is needed, you can add it without going back to the client app). The chain = lint upfront (envelope = `--duration`; any fatal item is blocked locally, zero submission, zero billing) → **billing-estimate confirmation** (live price lookup; the CLI has no local HTML render engine, so the cloud billed task is the only path for standalone particles; `--yes` skips the prompt) → inline submission to the cloud → `<composition_id>.mov` landed with `task.json`/`result.json` breadcrumbs (recoverable by task_id after a crash). **Scope**: qtrle only for now (`--format webm` is explicitly refused — Jianying cannot read VP8-alpha), 1920×1080 particles only (the contract has no portrait/odd-canvas opening), and `--duration` is required. The output never enters `.gtrk` and never lands in the Jianying draft folder; qtrle is lossless and relatively large, suited to seconds-long particles. Note it shares a word with `gtrk render` (full-video rendering) but is a different thing.
|
|
608
|
+
- **render** (`gtrk mg render <particle.html> --duration <sec> [--out <dir>] [--yes]`): renders a single particle in the cloud, **independent of any project**, into a Jianying-readable qtrle transparent alpha MOV (the fine-cut supplement channel — when the rough cut is already exported to Jianying and one more motion graphic is needed, you can add it without going back to the client app). The chain = lint upfront (envelope = `--duration`; any fatal item is blocked locally, zero submission, zero billing) → **billing-estimate confirmation** (live price lookup; the CLI has no local HTML render engine, so the cloud billed task is the only path for standalone particles; `--yes` skips the prompt) → inline submission to the cloud → `<composition_id>.mov` landed with `task.json`/`result.json` breadcrumbs (recoverable by task_id after a crash). **Scope**: qtrle only for now (`--format webm` is explicitly refused — Jianying cannot read VP8-alpha), 1920×1080 particles only (the contract has no portrait/odd-canvas opening), and `--duration` is required. The output never enters `.gtrk` and never lands in the Jianying draft folder; qtrle is lossless and relatively large, suited to seconds-long particles. Note it shares a word with `gtrk render` (full-video rendering) but is a different thing.
|
|
609
|
+
- **fetch** (`gtrk mg fetch <query|block> [--top 3] [--all]` / `gtrk mg fetch --pick <block> --slot <beat> --project <dir>` / `--pick <block> --as <composition_id> --duration <sec> [--out <dir>]`): the **neutral particle source** from the HyperFrames registry — MG without a show skill. Candidate mode is **offline** (the snapshot ships with the package, pinned to a source commit) and lists 2–3 blocks per query with compat flags and poster links; pick mode fetches the block through three sources in order (our mirror first, then jsdelivr, then GitHub raw; 5 s each, **sha256-verified per source**, nothing is written if all three fail) → eight mechanical rewrites (`<template>` wrap / id rename / drop data-start and fit the slot / sink the solid backdrop into a child / swap GSAP to the contract CDN / swap fonts to a CJK font provable in our runtime mirror / fit duration to the slot / letterbox scaling, never stretch) → `gtrk mg lint` (fatal items block the write) → lands at `<project>/mg/<composition_id>.html`. **A skeleton is not a deliverable**: the returned `editable` (copy / number arrays / colors) MUST be rewritten for the beat and the show before laying. The contract currently accepts 1920×1080 particles only; `excluded` blocks are refused, `review` blocks (canvas / house-rule 8 shapes) can be fetched but need a real render check. `GITRUCK_MG_REGISTRY_BASE` overrides the fetch prefix.
|
|
579
610
|
|
|
580
611
|
`--json` output: `{ ok, mode:"lay"|"lint"|"status", … }` (each mode carries its own fields, e.g. `laid` / `skipped` when laying, per-beat status for `status`). Laying mode additionally carries **`track_total`** (how many laid particles currently exist on the track), **`kept`** / **`kept_ids`** (how many are **left over from the previous round** and not re-laid this time, plus their `composition_id` list) and **`removed`** (how many old self-produced particles were stripped this run) — `laid` (this run), `track_total` (total on the track) and `kept` (left over) **must be read together**, and `track_total = laid + kept` always holds. Reading `laid` alone makes "lay 1, strip 20" look identical to "patch in 1", and reading only the first two hides the cost that "a few particles on the track are not from this round" (`kept_ids` and `skipped` overlap: something that failed to land this round is still there from the previous one). When not fully green it also carries a machine-readable **`reason`**: `skipped` (some were not laid) / `empty_queue` (**write-back refused**, the project was not modified, with `refused:true` and `blocked[]`) / `no_project` (project missing, nothing laid). Runs that actually wrote back also carry **`integrity`** (the material-on-disk self-check, identical in name and shape to `gtrk matrix`; see the previous section).
|
|
581
612
|
|
|
@@ -693,6 +724,41 @@ The seven shared video tools — black-border removal, aspect adaptation, stabil
|
|
|
693
724
|
|
|
694
725
|
The companion skill is `/gtrk-tools` (one skill covering the whole tool family).
|
|
695
726
|
|
|
727
|
+
### `gtrk render <project.gtrk>` — render the finished video locally
|
|
728
|
+
|
|
729
|
+
```
|
|
730
|
+
gtrk render <gtrk> [-o <out.mp4>] [--crf <n>] [--codec <c>] [--ffmpeg-path <dir>]
|
|
731
|
+
[--no-qc] [--no-particles] [--particle-concurrency <n>] [-y|--yes]
|
|
732
|
+
[--no-open] [--json]
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
Treats the `.gtrk` as an EDL and renders it with local ffmpeg. **Footage always comes from the local originals** (`materials[].path`); the cloud never produces the finished file.
|
|
736
|
+
|
|
737
|
+
**What gets composited**: the base track (the lowest `track_index` that is not the black bed) plus every audio source, then **every visible overlay layer** stacked in contract z-order (ascending `track_index`, larger = closer to the front) — overlay video tracks (B-roll candidates, AI re-enactment) and the MG particles on `beat_track`.
|
|
738
|
+
|
|
739
|
+
- **Visibility reads the `hidden` field only** (the client's "eye" toggle): a hidden track stays out of the cut entirely and is reported. The renderer never guesses which track belongs in the picture.
|
|
740
|
+
- **When several candidate tracks are visible, the topmost one wins** (exactly what the client preview shows). To pick a different one, hide or delete tracks in the client.
|
|
741
|
+
- Missing overlay footage (e.g. B-roll proxies not fully downloaded) **degrades instead of blocking**: that clip is not composited, a warning is printed, and the render still completes.
|
|
742
|
+
|
|
743
|
+
**The particle half is billed** (the only cloud egress of this command):
|
|
744
|
+
|
|
745
|
+
| Topic | How it works |
|
|
746
|
+
|---|---|
|
|
747
|
+
| Why the cloud | The CLI has no HTML render engine; particle pixels are authoritative in Gitruck Cloud's Hyperframes. Only the **particle HTML text** is uploaded — never the footage itself |
|
|
748
|
+
| Metering | **unique particles × cache misses** (`html_render_simple`, per minute). A particle used N times on the timeline is baked once |
|
|
749
|
+
| Cache | `<project dir>/.tonghe-cache/particles/<sha256>.mov`, sharing **the same key and location** as the client's Jianying export chain ⇒ whatever either side bakes, the other reuses |
|
|
750
|
+
| Confirmation | Any miss triggers an estimate (total / unique / misses / billed minutes) and a prompt; `--yes` skips it. **A full cache hit never prompts** (a free operation should not add friction) |
|
|
751
|
+
| `--json` | With misses and no `--yes`, the command **refuses** (machine mode has no stdin; it will not silently submit a billed task) |
|
|
752
|
+
| Escape hatch | `--no-particles` renders particle-free at zero cost; overlay video tracks are **still composited** (that part is purely local) |
|
|
753
|
+
| Declining | Exits with zero cloud calls and zero file writes |
|
|
754
|
+
|
|
755
|
+
`--particle-concurrency <n>` (1–8, default 6) tunes particle render concurrency.
|
|
756
|
+
|
|
757
|
+
The `--json` result carries `particles: {total,unique,cached,rendered,billedMinutes,skipped[]}` and
|
|
758
|
+
`overlay: {layers,particles,hiddenSkipped,missingMaterialSkipped,particleUnavailable}` — **everything skipped has a machine-readable path**, so "65 particles laid, none in the cut, exit code 0" cannot happen quietly.
|
|
759
|
+
|
|
760
|
+
A QC pass runs automatically afterwards and writes `.qc.json` (`--no-qc` skips it); QC findings are reported but never change the render's exit semantics (use `gtrk qc --fail-on` for a hard gate).
|
|
761
|
+
|
|
696
762
|
### Other
|
|
697
763
|
|
|
698
764
|
- `gtrk install [--api-key … -y --skill-agents codex,cursor --all-agents --copy-skills --skills-dir …]` — install everything in one command (skills + config + health check), modelled on Feishu's `lark-cli install`.
|
|
@@ -706,7 +772,9 @@ The companion skill is `/gtrk-tools` (one skill covering the whole tool family).
|
|
|
706
772
|
- Fonts land in `~/.gitruck/fonts` and are supplied to burn-in through the ffmpeg `ass` filter's `fontsdir` — **never installed into the system font table, never written to the registry, never requiring administrator rights**.
|
|
707
773
|
- The distributed ffmpeg is a GPLv3 build, and the corresponding source is provided alongside the binaries (see `SOURCE.md` at the distribution point); **downloads carry no additional usage restrictions**.
|
|
708
774
|
- `gtrk upgrade [--check]` — upgrade the CLI to the latest version + refresh skills (config preserved); `--check` only reports.
|
|
709
|
-
- `gtrk skills install [--agents codex,workbuddy,comate,…] [--all] [--copy] [--dir <skills dir>]` — install/refresh agent skills on their own; by default the generic adapter and the gtrk supplement layer detect hosts automatically.
|
|
775
|
+
- `gtrk skills install [--agents codex,workbuddy,comate,…] [--all] [--copy] [--dir <skills dir>]` — install/refresh agent skills on their own; by default the generic adapter and the gtrk supplement layer detect hosts automatically.
|
|
776
|
+
- `gtrk skills recommend [--scene <id>] [--json]` — third-party skill catalog: without `--scene` lists the nine scenes (hook / mg-explainer / kinetic-text / data-viz / map / ai-drama / collage / caption / principles); with a scene prints entries by tier (purpose / install command / license and dependencies / register command). **Recommend, never bundle**: the catalog ships with the package with a snapshot date, no network, no state; stars and licenses are as of the snapshot, installing is your call. GPL / AGPL / non-commercial / unlicensed / MCP-SaaS-only skills are excluded.
|
|
777
|
+
- `gtrk skills add <owner/repo> [--skill <name>]... [--produces MG|AI_DRAMA|FILM_BROLL|script|none] [--column <id>] [--agents ...] [--all] [--copy]` — installs a third-party skill through the generic `skills` adapter and, on success, **appends** `{id, ref: "<owner/repo>#<skill>", produces, status: "third-party"}` to the show config `style.skills` (idempotent per ref, nothing is registered on failure; `--produces` defaults to the catalog value, repos outside the catalog register with `routing:"none"`), after which `gtrk mg` / `/gtrk-ai-drama` resolve it by `produces`.
|
|
710
778
|
|
|
711
779
|
---
|
|
712
780
|
|
|
@@ -738,7 +806,7 @@ gtrk-cli/
|
|
|
738
806
|
├── src/index.ts # commander 入口
|
|
739
807
|
├── src/commands/ # subcommands: install / init / oralcut / long2short / transcript / split / matrix / mg / project / audio / tool / render / doctor / upgrade / skills / …
|
|
740
808
|
├── src/lib/ # cloud / column-config / splitdoc / projection / user-config / jianying / …
|
|
741
|
-
├── skills/ #
|
|
809
|
+
├── skills/ # bundled framework skills (18; the list = SKILL_NAMES in src/commands/skills.ts): oralcut / long2short / splitter / matrix / mg / ai-drama / style-maker / transcript / tools / music-visualizer / cover / travel-recap / live-slicing / talking-head / narration / voiceover / food-recap / vlog-docu
|
|
742
810
|
├── contracts/ # 框架契约库正本(gsap-emit v1 + handoff→契约映射表)
|
|
743
811
|
├── assets/ # README 配图(介绍图 / Agent 调用示例 / 剪映草稿目录指引图)
|
|
744
812
|
└── AGENT.md # 可移植 agent playbook(skill 底座)
|
package/README.md
CHANGED
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
| ⚙️ | `gtrk init` | 引导式一次性配置(API Key + 剪映草稿目录),之后免管 |
|
|
35
35
|
| 🩺 | `gtrk doctor` | 体检:配置 / 云端连通 / 剪映目录 / 运行时一键自检 |
|
|
36
36
|
| 📦 | `gtrk deps` | 运行时资产:`status` 查 ffmpeg/字体的来源与授权,`install` 从同合云镜像装(**须显式触发,绝不静默自动下载**) |
|
|
37
|
-
| 🤖 | `gtrk skills install` | 通过通用 `skills` 适配器和 gtrk 补充层,把
|
|
37
|
+
| 🤖 | `gtrk skills install` | 通过通用 `skills` 适配器和 gtrk 补充层,把 18 个 CLI 自带 skill 装进本机检测到的主流 Agent;`--all` 可覆盖全部已登记宿主;`gtrk skills recommend --scene <id>` 查第三方 skill 推荐目录(随包快照、不联网、只推荐不打包),`gtrk skills add <owner/repo>` 透传安装并登记进栏目配置 `style.skills` |
|
|
38
38
|
| ⬆️ | `gtrk upgrade` | 升级 CLI 到最新版 + 刷新 skill(配置保留);`--check` 只查不装 |
|
|
39
|
-
| 🎞️ | `gtrk render` | 本地渲染 gtrk 工程(EDL)→ 成片 mp4(需 ffmpeg
|
|
39
|
+
| 🎞️ | `gtrk render` | 本地渲染 gtrk 工程(EDL)→ 成片 mp4(需 ffmpeg);按契约 z 序合成**全部可见叠加层**(B-roll 等 overlay 视频轨 + MG 颗粒,`hidden` 的轨不进片);输出帧按时间线**累计对齐**(逐段取整误差不累加,画面不会对配音渐进失步);渲完自动质检并落 `.qc.json`(`--no-qc` 跳过);画中画 clip 的 `clip_transform`(缩放 / 落位 / 旋转 / 透明)、`border_radius` 圆角与 `clip_mask` 形状蒙版(圆 / 圆角方 / 爱心 / 菱形 / 星形,带羽化)随工程本地合成,与客户端预览观感等价。⚠️ 未命中缓存的 MG 颗粒要云渲**有计费**(先预估要确认;`--no-particles` 零计费出无颗粒版) |
|
|
40
40
|
| 🔬 | `gtrk qc <成片>` | 成片质检:单趟扫全片查闪帧/黑帧/冻结/爆音/静音/音画不同步,带时码定位;`--gtrk <工程>` 开工程感知识别**段内跳切**,`--fail-on error\|warn\|never` 供管线门控 |
|
|
41
41
|
| 🔎 | `gtrk matrix` | B-roll 检索+**候选铺轨**:消费 FILM_BROLL 派单 → 产候选清单 + 下载 preview 代理铺 N 条候选轨(`--lay N` 默认 1,opencut 打开即可用轨道小眼睛对比;`--lay 0` 只出清单);`matrix search "<词>"` 单条 ad-hoc;`matrix fetch <clip_id...>` 精剪期拉原片(已授予素材免费重签+下载落盘,直接拖进剪映);**本地素材模式**:`matrix index --dirs <素材夹>` 免切片建索引 → `--local --dirs` 检索铺轨(**素材本体不上云**)→ `matrix lay` 消费(可编辑的)plan;`matrix describe` 按需理解候选 |
|
|
42
|
-
| 🎨 | `gtrk mg` | MG 动态图颗粒铺轨:消费 MG 派单 → 把 html-particle 颗粒(透明叠加 / 满屏底层,由你栏目的 MG 生产 skill 所产)铺进 `.gtrk` 的 beat_track;`mg lint <颗粒.html>` 铁律静态子集校验、`mg status --project <dir>` 编排看板(缺 HTML / 已产未铺 / 已铺);`mg render <颗粒.html> --duration <sec>` 脱离工程独立云渲单颗颗粒为剪映可读 qtrle 透明 MOV(精剪补给口);aux 叠层颗粒同段多铺(一 beat 派生主 + `-aux<n>`)。旧名 `gtrk rrv`
|
|
42
|
+
| 🎨 | `gtrk mg` | MG 动态图颗粒铺轨:消费 MG 派单 → 把 html-particle 颗粒(透明叠加 / 满屏底层,由你栏目的 MG 生产 skill 所产)铺进 `.gtrk` 的 beat_track;`mg lint <颗粒.html>` 铁律静态子集校验、`mg status --project <dir>` 编排看板(缺 HTML / 已产未铺 / 已铺);`mg render <颗粒.html> --duration <sec>` 脱离工程独立云渲单颗颗粒为剪映可读 qtrle 透明 MOV(精剪补给口);aux 叠层颗粒同段多铺(一 beat 派生主 + `-aux<n>`)。旧名 `gtrk rrv` 保留为弃用别名;`gtrk mg fetch` 从 Hyperframes registry 取中性块骨架(快照随包离线候选、三源取块我方镜像优先、机械改写后过 lint) |
|
|
43
43
|
| 🎙️ | `gtrk project init` | 音频驱动工程起盘:从一条配音建 `.gtrk` 工程——主路 `--tts-task <task_id>` 引用已完成的 TTS 配音任务(直取产物音频+句级时码,零 ASR);兜底 `--audio`+`--transcript` 自备配音成对给。落好即可 `gtrk split --project` 接成片流水线 |
|
|
44
44
|
| 🎼 | `gtrk audio lay` / `tighten` | 音频轨零件:`lay` 往 `.gtrk` 工程追加一条音频轨(BGM/配乐上轨,同源幂等替换不堆轨);`--beat-align` 云端节拍分析把入点吸附最近 downbeat(计费一次,无 Key/失败自动降级不失败)。`tighten` 收紧配音的句间停顿(纯本地零计费,只压跨句界的静音、句内换气不动) |
|
|
45
45
|
| 🎯 | `gtrk audio align` | 音画对轨零件(纯本地零计费):外录音轨(领夹麦/录音笔)与视频互相关测偏移+置信度;高置信直接换轨(视频流零像素改动),低置信产对齐工程交客户端拖齐后 `--resume` 读回;`--offset` 显式偏移直换 |
|
|
@@ -145,7 +145,7 @@ gtrk transcript "D:/素材/采访视频.mp4"
|
|
|
145
145
|
| ③ | 「**铺 B-roll 底轨**」(两条腿同一阶段) | `/gtrk-matrix` → `gtrk matrix` → 影视/本地素材候选轨铺入;`/gtrk-ai-drama`(skill,无命令)→ 四段描述稿(中英分块) | **opencut 里挑选/调整 B-roll**(小眼睛切换对比);AI 片段去外部平台出片、**手动回铺** |
|
|
146
146
|
| ④ | 「B-roll 齐了,**抽帧看看构图**」 | 对**三源合并后的最终底轨**抽帧(agent 纪律,无专属命令) | **确认构图**(主体位置 / 安全区 / 朝向 / 明暗) |
|
|
147
147
|
| ⑤ | 「构图没问题,**铺 MG**」 | `/gtrk-mg` → `gtrk mg` → MG(含 ov)叠在已定稿的底轨之上 | 精修颗粒(opencut 手调) |
|
|
148
|
-
| ⑥ | 「**出成片**」 |
|
|
148
|
+
| ⑥ | 「**出成片**」 | 两条路都行:客户端出片链(多车道合成 + 颗粒云渲 / **导剪映**),或 `gtrk render`(本地叠全部可见叠加层出 mp4,颗粒未命中缓存时计费);两端共用同一份颗粒缓存 | 客户端里精修定稿 |
|
|
149
149
|
|
|
150
150
|
> **次序有理由**:**AI 情景片段属于底轨 B-roll 画面家族,不是叠加层**——整条管线里唯一的叠加层是 MG(含 ov)。MG 的排版是「因势象形避主体」、**依赖底轨的最终画面构图**,所以三源(影视 / 本地 / AI)必须全落齐、构图核过,才轮到 MG。用不到的车道跳过(`dispatch` 里该队列为空就不铺)。
|
|
151
151
|
>
|
|
@@ -193,7 +193,11 @@ CLI 写 .gtrk ─▶ 客户端打开(自动感知外部改动、先存脏改再
|
|
|
193
193
|
| **AI 再现回铺** | 外部平台出的 AI 片段**手动拖进 AI_DRAMA 车道**对齐区间(`/gtrk-ai-drama` 只吐描述稿,片在外部平台出,见 SOP ③——它属底轨阶段,MG 要等它落位后才铺) |
|
|
194
194
|
| **最终出片** | 多车道合成(overlay / MG / particle 云渲叠起来)+ 剪映草稿导出,都在客户端出片链 |
|
|
195
195
|
|
|
196
|
-
> **`gtrk render`
|
|
196
|
+
> **`gtrk render` 现在会合成叠加层了(1.1.10 起)。** 它按契约 z 序(`track_index` 升序)把**全部可见**的叠加层叠进成片——overlay 视频轨(B-roll 候选 / AI 再现回铺)与 MG 颗粒都在内;在客户端关了「小眼睛」(`hidden`)的轨不进片。
|
|
197
|
+
>
|
|
198
|
+
> **颗粒那一段有计费**:CLI 没有 HTML 渲染引擎,颗粒要送同合云烤成透明 MOV 再本地叠。计量 = **唯一颗粒数 × 未命中缓存数**(按分钟),未命中时会先出预估并要你确认(`--yes` 跳过;`--json` 下必须显式 `--yes`)。**第二次渲染全命中缓存 ⇒ 零计费**;缓存与客户端导出剪映时那份**同键同落点**(`<工程目录>/.tonghe-cache/particles/`),所以客户端烤过的颗粒 CLI 直接命中、反之亦然。不想花钱用 `--no-particles` 出无颗粒版(overlay 视频轨照常合成,那部分零计费、纯本地)。
|
|
199
|
+
>
|
|
200
|
+
> **剪映草稿导出仍在客户端出片链**(`gtrk render` 只出 mp4)。
|
|
197
201
|
|
|
198
202
|
## 升级
|
|
199
203
|
|
|
@@ -226,7 +230,7 @@ irm https://api.ai-mcn.tv:9000/broadcast/exe/install.ps1 | iex
|
|
|
226
230
|
|  |  |
|
|
227
231
|
|  |  |
|
|
228
232
|
|
|
229
|
-
`gtrk install` 会把
|
|
233
|
+
`gtrk install` 会把 18 个 CLI 自带 skill(`gtrk-oralcut`·`gtrk-long2short`·`gtrk-splitter`·`gtrk-matrix`·`gtrk-mg`·`gtrk-ai-drama`·`gtrk-style-maker`·`gtrk-transcript`·`gtrk-tools`·`gtrk-music-visualizer`·`gtrk-cover`·`gtrk-travel-recap`·`gtrk-live-slicing`·`gtrk-talking-head`·`gtrk-narration`·`gtrk-voiceover`·`gtrk-food-recap`·`gtrk-vlog-docu`)装进本机检测到的 Agent。实现方式与 lark-cli 一致:gtrk 把本地 skill 源交给通用 `skills` CLI,由它维护 Agent 探测、目录映射及更新规则;gtrk 不再硬编码各家路径。
|
|
230
234
|
|
|
231
235
|
默认使用 `~/.agents/skills` 作为统一正本,再链接到各 Agent 的兼容目录(Windows 使用 junction);链接不可用时适配器会回退复制。这样更新只有一份正本,不会让多份副本逐渐漂移。常用命令:
|
|
232
236
|
|
|
@@ -265,15 +269,23 @@ gtrk skills install --copy
|
|
|
265
269
|
| ④ | (无 skill) | (无命令) | **全局抽帧检查画面构图**:对三源合并后的最终底轨抽帧,用户确认构图——这是 agent 纪律硬门,供 ⑤ 的排版避让决策使用 |
|
|
266
270
|
| ⑤ | `/gtrk-mg` | `gtrk mg` | **MG(含 ov)最后叠上**(叠在已定稿、构图已核的底轨之上) |
|
|
267
271
|
| — | `/gtrk-style-maker` | (无命令,建栏目) | 一次性访谈式建你栏目的风格体系(skill 家族 + 栏目配置,见下节) |
|
|
268
|
-
|
|
|
272
|
+
| ③′ | 「**屏录画中画**」 | `gtrk pip lay` | 把口播粗剪的切点镜像到同步录的屏录 / 第二机位,铺屏录满幅轨 + 人像画中画副本轨(圆 / 圆角方 / 爱心 / 菱形 / 星形蒙版,可圆角);纯本地零计费;低置信时产对齐工程让客户端拖齐后 `--resume` |
|
|
273
|
+
| — | (收口) | `gtrk render` | 本地渲染 gtrk 工程 → 成片 mp4(含 overlay 与 MG 颗粒;颗粒未命中缓存时云渲计费,`--no-particles` 可跳过) |
|
|
269
274
|
| ✂️ | `/gtrk-long2short` | `gtrk long2short` | 长剪短·粗剪:长视频语义选段+跳剪 → 逐 clip 出客户端/剪映/PR 三方工程(毛片不上传),**不在成片 SOP 序列内**、随时可独立用 |
|
|
270
275
|
| 📝 | `/gtrk-transcript` | `gtrk transcript` | 本地视频/配音音频 → 一个含 Agent 总结、时码记录和纯文本的 Markdown,**不在成片 SOP 序列内** |
|
|
271
276
|
| 🧰 | `/gtrk-tools` | `gtrk tool <name>` | 单点工具族(图转运镜 / 图片·视频抠像…)——单发单收,**不在成片 SOP 序列内**、随时可独立用 |
|
|
272
277
|
| 🎵 | `/gtrk-music-visualizer` | `gtrk music-visualizer` | 一首歌 → 频谱可视化成片(模板 + 可选背景/封面 + 配色样式),**不在成片 SOP 序列内**、独立引流用 |
|
|
273
278
|
| 🖼️ | `/gtrk-cover` | (无命令,纯创作) | 封面工作台两阶段:设计诊断 + 三尺寸中英双版文生图 Prompt → 用户外部平台抽图 → H5 排字工作台(拖拽/滚轮微调、一键导出多尺寸 PNG)。栏目封面审美经栏目配置 `style.skills`(`produces:"cover"`)注入;**不在成片 SOP 序列内**(投放配套的「第 0 阶段」) |
|
|
279
|
+
| 🧭 | `/gtrk-talking-head` | 编排 `gtrk audio` → `oralcut` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **口播链图纸**:一条或一组真人出镜毛片 → 外录音轨对齐换轨、多段拼接、粗剪、拆分派单、B-roll/MG 字卡、BGM、字幕 → 客户端可出片工程 |
|
|
280
|
+
| 🧭 | `/gtrk-travel-recap` | 编排 `gtrk tool audio_tts_clone` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **旅拍解说图纸**:旅拍素材夹 → AI 理解素材、写三段式解说稿、一次确认 → 配音/建工程/拆分/B-roll/字卡/BGM/字幕全自动跑完 → 客户端可出片工程 |
|
|
281
|
+
| 🧭 | `/gtrk-live-slicing` | 编排 `gtrk long2short`(超长回放先分段) | **直播切片图纸**:数小时直播回放 → 分段(服务端 2h 硬闸)→ 选题清单确认 → 一批逐 clip 粗剪工程(gtrk + 剪映 + PR),按画面形态配分屏 |
|
|
282
|
+
| 🧭 | `/gtrk-narration` | 编排 `gtrk transcript` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **通用解说图纸(解说链正本)**:素材自带时序的长东西(影视长片/游戏实况/探店记录…)→ 提炼梗概与看点 → 精简叙述重讲成解说成片工程;旅拍解说与美食解说是它的垂类实例 |
|
|
283
|
+
| 🧭 | `/gtrk-voiceover` | 编排 `gtrk tool audio_tts_clone` → `project init` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **配音链快速成片预设**:写好的稿(或 AI 代写)→ 配音 → 自动配画面 → 字卡/BGM/字幕 → 客户端可出片工程;适用科普/情感电台/观点/带货/盘点等无自带时序的题材 |
|
|
284
|
+
| 🧭 | `/gtrk-food-recap` | 沿 `/gtrk-narration` 链路 | **美食解说垂类图纸(解说链示例)**:探店/密着纪实长片或做饭流程记录 → 提炼看点重述成中文美食解说成片工程 |
|
|
285
|
+
| 🧭 | `/gtrk-vlog-docu` | 编排 `gtrk transcript` → `tool audio_tts_clone` → `split` → `matrix` → `mg` → `audio lay` → `subtitle lay` | **Vlog 纪实图纸**:一批现场素材 → 素材理解、选档写稿、一次拍板 → 同期声骨架 + 旁白配音 + B-roll + 字幕层 + BGM 全自动 → 客户端可出片工程;「现场同期声 × 后期旁白」双声道交替,区别于纯口播链与纯配音链 |
|
|
274
286
|
|
|
275
287
|
> **skill 与命令的区别**:`/gtrk-mg` 是**脑**——懂它在 SOP 第 ⑤ 步(B-roll 三源全齐、构图核过才铺 MG)、带用户确认、按栏目配置解析该产哪种颗粒;`gtrk mg` 是**手**——纯确定性 lint + 铺轨。你对话触发 skill,skill 替你跑命令。
|
|
276
|
-
> 上面
|
|
288
|
+
> 上面 18 个 `/gtrk-X` 都是 **CLI 自带框架 skill**(`gtrk skills install` 装;名单与「给 AI Agent 用」一节、「结构」一节完全一致)——其中 🧭 标记的 7 张是**组合图纸**(一句话跑全链,只编排上面的单命令 skill、本身不新增命令);`/gtrk-long2short` 独立驱动长剪短,`/gtrk-transcript` 独立驱动视频/音频转文字稿,`/gtrk-tools` 只负责单点工具族,`/gtrk-cover` 管封面,四者都不属成片 SOP 序列;`/gtrk-ai-drama`·`/gtrk-style-maker`·`/gtrk-cover` 是纯创作 skill(无命令)。栏目专属的**视觉风格/生产内容**另由你栏目的生产 skill(`/gtrk-style-maker` 产、经栏目配置 `style.skills` 绑定)供,不写死在这些框架 skill 里。
|
|
277
289
|
|
|
278
290
|
**各车道的具体视觉/内容怎么产**——MG 动态图长什么样、AI 再现什么调性——不写死在 CLI 里,而由**你自己栏目的生产 skill** 提供(用 `/gtrk-style-maker` 访谈式产出、留本地)。它们经**栏目配置 `style.skills[].produces`**(值 = 车道名)绑定,`gtrk mg` / `gtrk matrix` 等**通用驱动器**据此消费。**驱动方向 = CLI 驱动栏目 skill**:栏目 skill 只供风格/内容、不含任何「跑哪条命令」的编排职责;框架只认车道与管线接口,画面风格永远归你的栏目。不建栏目就用内置默认,端到端照常跑。
|
|
279
291
|
|
|
@@ -329,6 +341,21 @@ gtrk init --api-key <KEY> --jianying-draft-dir auto -y
|
|
|
329
341
|
✅ 剪映草稿目录:C:\Users\…\com.lveditor.draft
|
|
330
342
|
```
|
|
331
343
|
|
|
344
|
+
### 枚举清单(`--refresh-catalog`)
|
|
345
|
+
|
|
346
|
+
`gtrk doctor` 里有一行「枚举清单」:CLI 从服务端拉一份**对外枚举的全集**(字幕样式与颜色、语种码、
|
|
347
|
+
工程文件格式、节奏预设、任务可用性等),落在 `~/.gitruck/catalog.json`,24 小时自动刷新。
|
|
348
|
+
|
|
349
|
+
有了它,`--subtitle-type` 这类参数传错时**在上传之前**就告诉你,并列出当前可用值;
|
|
350
|
+
服务端新增一种样式,你不必升级 CLI 就能用上。
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
gtrk doctor --refresh-catalog # 立刻重拉(无视 24 小时新鲜期)
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**拉不到清单不影响使用**:CLI 会沿用上一次的快照;完全没有快照时**跳过本地校验、直接提交**,
|
|
357
|
+
由服务端裁决——服务端白名单永远是唯一真相源。要彻底关掉这次拉取,设 `GITRUCK_CATALOG_OFFLINE=1`。
|
|
358
|
+
|
|
332
359
|
### 崩溃报告与关闭方式
|
|
333
360
|
|
|
334
361
|
gtrk 崩溃时(未捕获异常 / 未处理的 Promise 拒绝 / 顶层出口的程序缺陷)会自动上报一条报告,帮我们定位缺陷。**默认开启,首次配置时会告知一次。**
|
|
@@ -594,7 +621,8 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
|
|
|
594
621
|
- **铁律⑧重复图元合并**(`8-primitive-merge`,**恒非致命、不拦铺轨**):识别「循环体内创建,或由循环调用具名工厂创建;落到同一父节点;且没有逐元素动画驱动」的可合并 `line` / `rect` / `path` / `polyline` / `polygon` 批次。同一父节点的纯数字循环 trip count 累加后 **≥ 8** 才报数;边界含 `.length` / 具名常量而算不出时仍报「条数未知」,不做常量折叠;逐元素 `gsap.set` / tween 或被 tween 首实参使用的元素数组会被排除。本项只提示「这里有一批可**无损**合并的重复图元,合并后画面逐像素不变」,**不是风险判定**:命中不代表该颗粒会复现缺陷,未命中也不代表安全,真判据仍是真渲染出片抽帧。
|
|
595
622
|
- **回调与 seek 语义**(`x-callback-driven` / `x-engine-api-override` / `x-raf-interval`,**恒非致命、不拦铺轨**):对齐契约同名一节(2026-07-26 增补)。GSAP `seek(t)` 默认抑制回调 → 补间属性照常插值、但 `onUpdate` 里的 DOM 写入不执行,翻车形态是**画面定在初始态而非黑屏**。契约把保证压在**引擎侧**(定帧 MUST 用 `seek(t,false)` / `time(t)` / `progress(p)`),故颗粒**用回调驱动画面是合规写法**;lint 这三项只是**哨兵**:`x-callback-driven` = 回调写 DOM 且无任何 seek 兜底(有兜底则沉默,避免重复提醒);`x-engine-api-override` = 颗粒运行时覆写 `tl.seek` 或把 `__timelines[…]` 换成包装对象(会推翻引擎显式传的 `seek(t,true)`,且引擎改走 `time()`/`progress()` 即失效,属过渡态);`x-raf-interval` = 含 `requestAnimationFrame(` / `setInterval(`(自有时钟不被 seek,等于冻结)。三项 MUST NOT 致命——「用回调驱动画面」不是违规。
|
|
596
623
|
- **status**(`gtrk mg status --project <dir>`):汇总 MG 流水线——`dispatch.mg` beat 总数 / 已产源 HTML 数 / 已铺进 `.gtrk` 数,并逐 beat 标注(缺 HTML / 已产未铺 / 已铺)。
|
|
597
|
-
- **render**(`gtrk mg render <颗粒.html> --duration <sec> [--out <dir>] [--yes]`):**脱离工程**把单颗颗粒云渲成剪映可读的 qtrle 透明 alpha MOV(精剪补给口——粗剪导剪映后缺一颗动态图,不回客户端就能补)。链路 = lint 前置(包络 = `--duration`,任一致命项本地拦截、零提交零计费)→ **计费预估确认**(实时查价;CLI 无本地 HTML 渲染引擎,独立颗粒唯一路 = 云渲计费任务,`--yes` 跳过确认)→ 内联提交云端 → `<composition_id>.mov` 落盘 + `task.json`/`result.json` 面包屑(崩溃可凭 task_id 恢复)。**射程**:首发只出 qtrle(`--format webm` 明确拒绝,剪映不吃 VP8-alpha)、只收 1920×1080 颗粒(契约未开竖屏/异形口)、`--duration` 必填。产物不进 `.gtrk`、不写剪映草稿目录;qtrle 无损体积偏大,适合秒级颗粒。注意与 `gtrk render`(整片成片渲染)同词不同物。
|
|
624
|
+
- **render**(`gtrk mg render <颗粒.html> --duration <sec> [--out <dir>] [--yes]`):**脱离工程**把单颗颗粒云渲成剪映可读的 qtrle 透明 alpha MOV(精剪补给口——粗剪导剪映后缺一颗动态图,不回客户端就能补)。链路 = lint 前置(包络 = `--duration`,任一致命项本地拦截、零提交零计费)→ **计费预估确认**(实时查价;CLI 无本地 HTML 渲染引擎,独立颗粒唯一路 = 云渲计费任务,`--yes` 跳过确认)→ 内联提交云端 → `<composition_id>.mov` 落盘 + `task.json`/`result.json` 面包屑(崩溃可凭 task_id 恢复)。**射程**:首发只出 qtrle(`--format webm` 明确拒绝,剪映不吃 VP8-alpha)、只收 1920×1080 颗粒(契约未开竖屏/异形口)、`--duration` 必填。产物不进 `.gtrk`、不写剪映草稿目录;qtrle 无损体积偏大,适合秒级颗粒。注意与 `gtrk render`(整片成片渲染)同词不同物。
|
|
625
|
+
- **fetch**(`gtrk mg fetch <检索词|块名> [--top 3] [--all]` / `gtrk mg fetch --pick <块名> --slot <beat> --project <dir>` / `--pick <块名> --as <composition_id> --duration <sec> [--out <dir>]`):**registry 中性颗粒源**——没建栏目也能出 MG。候选态**离线**(快照随包、钉死来源 commit)按检索词列 2–3 件(含 compat 标记与海报链接);取块态按三源顺序取块(我方镜像优先、jsdelivr、GitHub raw,每源 5 s,**逐源 sha256 强校验**,三源皆败零落盘)→ 机械改写八条(`<template>` 包裹 / 改 id / 去 data-start 贴坑位 / 实心底下沉子层 / GSAP 源换契约 CDN / 字体换运行时镜像可证的 CJK 字体 / 时长贴坑位 / 信箱缩放不拉伸)→ `gtrk mg lint` 致命项不过不落盘 → 落 `<project>/mg/<composition_id>.html`。**骨架不是成品**:返回的 `editable`(文案 / 数值数组 / 色值)MUST 按 beat 与栏目改写后再铺。契约当前只收 1920×1080 颗粒,其它画布拒绝;`excluded` 件拒取,`review` 件(canvas / 铁律 8 高危形态)可取但须真渲验收。`GITRUCK_MG_REGISTRY_BASE` 可整体覆盖取块前缀。
|
|
598
626
|
|
|
599
627
|
`--json` 输出:`{ ok, mode:"lay"|"lint"|"status", … }`(各模式带对应字段,如铺轨的 `laid` / `skipped`、status 的逐 beat 状态)。铺轨模式另带 **`track_total`**(轨上现存已铺数)、**`kept`** / **`kept_ids`**(其中**上轮遗留**、本次没重铺的颗数与 `composition_id` 清单)与 **`removed`**(本次被剥的旧自产颗粒数)——`laid`(本次)、`track_total`(轨上共)与 `kept`(上轮遗留)**要一起读**,恒有 `track_total = laid + kept`;只看 `laid` 会让「铺 1 颗、剥 20 颗」跟「补铺 1 颗」长得一模一样,只看前两个又会漏掉「轨上那几颗不是这一轮的版本」这条代价(`kept_ids` 与 `skipped` 会重叠:这轮没铺成、上一轮那条还在轨上)。非全绿时另带机读 **`reason`**:`skipped`(部分没铺上)/ `empty_queue`(**拒写回**,工程未被改动,另带 `refused:true` 与 `blocked[]`)/ `no_project`(工程缺失未铺轨)。真写回过的运行另带 **`integrity`**(素材落盘自检,与 `gtrk matrix` 同名同形,口径见上节)。
|
|
600
628
|
|
|
@@ -712,6 +740,42 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
|
|
|
712
740
|
|
|
713
741
|
配套 skill `/gtrk-tools`(一个 skill 覆盖整个工具族)。
|
|
714
742
|
|
|
743
|
+
### `gtrk render <工程.gtrk>` — 本地渲染成片
|
|
744
|
+
|
|
745
|
+
```
|
|
746
|
+
gtrk render <gtrk> [-o <out.mp4>] [--crf <n>] [--codec <c>] [--ffmpeg-path <dir>]
|
|
747
|
+
[--no-qc] [--no-particles] [--particle-concurrency <n>] [-y|--yes]
|
|
748
|
+
[--no-open] [--json]
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
把 `.gtrk` 当 EDL 用本地 ffmpeg 出成片。**素材一律取本地原片**(`materials[].path`),云端不产成片。
|
|
752
|
+
|
|
753
|
+
**合成什么**:底轨(`track_index` 最小的非黑底垫轨)+ 全部音源,再按契约 z 序(`track_index` **升序**,越大越靠前)叠**全部可见叠加层**——overlay 视频轨(B-roll 候选 / AI 再现回铺)与 `beat_track` 的 MG 颗粒。
|
|
754
|
+
|
|
755
|
+
- **可见性只读 `hidden` 字段**(客户端的「小眼睛」):关掉的轨整条不进片,如实计数告知。渲染器**不猜**哪条该叠。
|
|
756
|
+
- **多条候选轨都可见时成片取最上层**(= 客户端预览所见)。要换,在客户端关小眼睛或删轨。
|
|
757
|
+
- overlay 素材本地缺失(如 B-roll 代理没下全)**只降级不阻断**:该 clip 不叠 + 告警,片子照出。
|
|
758
|
+
|
|
759
|
+
**颗粒那一段有计费**(本命令唯一的云端出口):
|
|
760
|
+
|
|
761
|
+
| 事 | 口径 |
|
|
762
|
+
|---|---|
|
|
763
|
+
| 为什么要上云 | CLI 无 HTML 渲染引擎,颗粒像素权威在同合云 Hyperframes;上行的只有**颗粒 HTML 文本**,素材本体不上行 |
|
|
764
|
+
| 计量 | **唯一颗粒数 × 未命中缓存数**(`html_render_simple`,按分钟)。同一颗粒在轨上出现 N 次只烤一次 |
|
|
765
|
+
| 缓存 | `<工程目录>/.tonghe-cache/particles/<sha256>.mov`,与**客户端导出剪映**那条链**同键同落点** ⇒ 任一端烤过,另一端直接命中 |
|
|
766
|
+
| 确认 | 有未命中即先出预估(总数 / 唯一 / 未命中 / 计费分钟)并要确认;`--yes` 跳过。**全命中不弹确认**(零计费不该有摩擦) |
|
|
767
|
+
| `--json` | 有未命中且未给 `--yes` ⇒ **硬拒**(机读模式没有 stdin,不静默提交计费任务) |
|
|
768
|
+
| 逃生舱 | `--no-particles` 零计费出无颗粒版;overlay 视频轨**照常合成**(那部分纯本地) |
|
|
769
|
+
| 拒绝确认 | 零云端调用、零文件写入退出 |
|
|
770
|
+
|
|
771
|
+
`--particle-concurrency <n>`(1–8,默认 6)调颗粒云渲并发。
|
|
772
|
+
|
|
773
|
+
`--json` 结果含 `particles: {total,unique,cached,rendered,billedMinutes,skipped[]}` 与
|
|
774
|
+
`overlay: {layers,particles,hiddenSkipped,missingMaterialSkipped,particleUnavailable}`——
|
|
775
|
+
**跳过了什么都有机读通路**,不会出现「铺了 65 颗、成片一颗没有、退出码 0」。
|
|
776
|
+
|
|
777
|
+
渲完自动质检并落 `.qc.json`(`--no-qc` 跳过);质检结论只呈现、不改渲染退出语义(硬门控走 `gtrk qc --fail-on`)。
|
|
778
|
+
|
|
715
779
|
### 其它
|
|
716
780
|
|
|
717
781
|
- `gtrk install [--api-key … -y --skill-agents codex,cursor --all-agents --copy-skills --skills-dir …]` — 一条命令装全(skill + 配置 + 体检),对标飞书 `lark-cli install`。
|
|
@@ -725,7 +789,9 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
|
|
|
725
789
|
- 字体落 `~/.gitruck/fonts`,烧录时经 ffmpeg `ass` 滤镜的 `fontsdir` 供给——**不装进系统字体表、不写注册表、不要管理员权限**。
|
|
726
790
|
- 分发的 ffmpeg 为 GPLv3 构建,对应源码与二进制同处提供(见分发点 `SOURCE.md`);**下载不附加任何使用限制**。
|
|
727
791
|
- `gtrk upgrade [--check]` — 升级 CLI 到最新版 + 刷新 skill(配置保留);`--check` 只查不装。
|
|
728
|
-
- `gtrk skills install [--agents codex,workbuddy,comate,…] [--all] [--copy] [--dir <skills 目录>]` — 单独安装/刷新 Agent Skills;缺省由通用适配器与 gtrk 补充层自动检测。
|
|
792
|
+
- `gtrk skills install [--agents codex,workbuddy,comate,…] [--all] [--copy] [--dir <skills 目录>]` — 单独安装/刷新 Agent Skills;缺省由通用适配器与 gtrk 补充层自动检测。
|
|
793
|
+
- `gtrk skills recommend [--scene <id>] [--json]` — 第三方 skill 推荐目录:不带 `--scene` 列九个场景(hook / mg-explainer / kinetic-text / data-viz / map / ai-drama / collage / caption / principles),带场景按 tier 给条目(用途 / 安装命令 / 许可与依赖 / 登记命令)。**只推荐不打包**:目录随包分发、带快照日期、不联网不留痕;star 与许可以仓库页为准,装不装是你的选择。GPL / AGPL / 非商用 / 无许可证 / 只能经 MCP-SaaS 运行的不入目录。
|
|
794
|
+
- `gtrk skills add <owner/repo> [--skill <name>]... [--produces MG|AI_DRAMA|FILM_BROLL|script|none] [--column <id>] [--agents ...] [--all] [--copy]` — 透传通用 `skills` 适配器安装第三方 skill,成功后把 `{id, ref: "<owner/repo>#<skill>", produces, status: "third-party"}` **追加**进栏目配置 `style.skills`(同 ref 幂等、失败不登记;`--produces` 缺省取目录值,目录外仓登记为 `routing:"none"`),之后 `gtrk mg` / `/gtrk-ai-drama` 按 `produces` 即可解析到它。
|
|
729
795
|
|
|
730
796
|
---
|
|
731
797
|
|
|
@@ -757,7 +823,7 @@ gtrk-cli/
|
|
|
757
823
|
├── src/index.ts # commander 入口
|
|
758
824
|
├── src/commands/ # 子命令:install / init / oralcut / long2short / transcript / split / matrix / mg / project / audio / tool / render / doctor / upgrade / skills / …
|
|
759
825
|
├── src/lib/ # cloud / column-config / splitdoc / projection / user-config / jianying / …
|
|
760
|
-
├── skills/ # 打包的框架 skills
|
|
826
|
+
├── skills/ # 打包的框架 skills(18 个,名单 = src/commands/skills.ts 的 SKILL_NAMES):oralcut / long2short / splitter / matrix / mg / ai-drama / style-maker / transcript / tools / music-visualizer / cover / travel-recap / live-slicing / talking-head / narration / voiceover / food-recap / vlog-docu
|
|
761
827
|
├── contracts/ # 框架契约库正本(gsap-emit v1 + handoff→契约映射表)
|
|
762
828
|
├── assets/ # README 配图(介绍图 / Agent 调用示例 / 剪映草稿目录指引图)
|
|
763
829
|
└── AGENT.md # 可移植 agent playbook(skill 底座)
|