docs(cli): pin npx in unattended runs and verify the render (#7467)

In a job with no TTY nothing prompts: the CLI exits 2 and names `--yes`,
and `npx` skips its own "Ok to proceed?" whenever stdin is not a
terminal or CI is detected. What an unversioned `npx hyperframes` still
does is fetch the latest release on every cold cache, so two jobs that
start together can collide in npm's cache (`_cacache` for the fetch,
`_npx` for the install: EEXIST / ENOTEMPTY, a retry succeeds), and a
new release silently changes what the same command renders.

The hyperframes-cli skill now routes no-TTY jobs to the project's
scaffolded `npm run` scripts (each already `npx --yes hyperframes@X.Y.Z`)
or a pinned `npx --yes`, never bare `npx hyperframes`, and the loop's
render step checks `data-width`/`data-height` as well as `data-duration`.
The new references/unattended.md holds the detail and says why
interactive flows (`update`, reverse-any-video) float to `@latest` while
unattended jobs pin. The CLI reference page gets the matching paragraph.
The SKILL.md budget goes up 256 B per the file's +N-comment pattern, and
skills-manifest.json is regenerated.
This commit is contained in:
Ice cola
2026-11-20 19:48:29 +00:00
committed by GitHub
parent 925a64db39
commit d8d45f481b
5 changed files with 43 additions and 5 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ description: HyperFrames CLI - scaffold, check frames, edit timelines, preview,
# HyperFrames CLI
Run `npx hyperframes <command>` as above, never a project's own scripts or wrapper unless the person names that command. It needs Node.js 22+ and FFmpeg. Every command has `--help`; most take `--json`, and a failure prints `✗ …`, a `Fix:` line and exits non-zero.
Run `npx hyperframes <command>` as above, never a project's own scripts or wrapper unless the person names that command. A job with no TTY pins the release (`--cli-version <exact-version>`, or the project's pinned `npm run` scripts), never a floating install (`references/unattended.md`). It needs Node.js 22+ and FFmpeg. Every command has `--help`; most take `--json`, and a failure prints `✗ …`, a `Fix:` line and exits non-zero.
A `--json` result may carry `_meta.updateNotice`: a newer HyperFrames release is out. Pass it to the person once per conversation, in your own words, at a natural pause; updating is theirs to decide.
@@ -38,7 +38,7 @@ A `--json` result may carry `_meta.updateNotice`: a newer HyperFrames release is
2. `npx hyperframes check --json` and fix every error. While a lint error remains the layout and contrast audits don't run; "0 samples" means nothing was checked. Contrast failures carry a `suggestedColor`. A finding at a single sample (an entrance in flight) is info; a 3 s+ video with no visible change fails `sweep_static`.
3. `npx hyperframes snapshot` and read the PNGs (under `.hyperframes/artifacts/snapshots/`): that is how you see the video. With sub-compositions, snapshot a midpoint of every scene; tiny unstyled content or a missing hero is a mount defect (`../hyperframes/references/format.md`).
4. `npx hyperframes preview --background`, check the URL answers 200, give the person the project URL and wait, unless they asked for the file or for no stops. Passing checks alone is not a reason to render.
5. Time to render (step 4): `npx hyperframes render --quality looks -o out.mp4` (`draft` while iterating, `delivery` for the final; paid plan: `cloud render --fps <data-fps> --quality high -o out.mp4`). Confirm the file is non-empty and its `ffprobe` duration matches the root `data-duration`, then look at decoded frames.
5. Time to render (step 4): `npx hyperframes render --quality looks -o out.mp4` (`draft` while iterating, `delivery` for the final; paid plan: `cloud render --fps <data-fps> --quality high -o out.mp4`). Confirm the file is non-empty and `ffprobe` reports the root `data-duration` and the project's `data-width`/`data-height`, then look at decoded frames.
"This element" or the current selection: `npx hyperframes preview --context --json --context-fields selection`; `no-selection` means ask them to click it.
@@ -0,0 +1,21 @@
# Unattended runs
Scripts, CI and scheduled jobs call the CLI with no TTY. Nothing prompts there: the CLI exits 2 and names the flag (`--yes`) instead of asking, and `npx` skips its own `Ok to proceed?` prompt whenever stdin is not a terminal or CI is detected — it prints a warning and installs. What can still fail is the install itself.
## Bare `npx hyperframes` installs on every cold cache
With no version, `npx` asks the registry for the latest release on every run and installs it under `~/.npm/_npx/<hash>/` when it is not there yet. Two consequences for a job nobody is watching:
- Two runs that start together race in npm's cache (`_cacache` for the fetch, `_npx` for the install). One can fail with `EEXIST` or `ENOTEMPTY` while the other is still writing; a retry succeeds, because by then the install is in place.
- A new release changes what the same command renders, silently.
## Pin the release
- From a skill, run the CLI through the launcher with an exact release: `node "<SKILLS>/hyperframes/scripts/plugin-cli.mjs" --cli-version <exact-version> <command>` ([rules](../../hyperframes/references/plugin-installation.md)). Take the version from the person or from `--cli-version latest --version`, never from the project's own files.
- A scaffolded project (`hyperframes init`) ships `npm run dev|check|render|publish`, each pinned (`npx …hyperframes@<version>…`) to the release that created the project. A job the person owns runs those, or installs once — `npm i hyperframes@<version>` then `node_modules/.bin/hyperframes <command>`, or `npm i -g hyperframes@<version>` then `hyperframes <command>` — and skips the fetch and the cache race altogether.
Interactive sessions float on purpose: `update` moves an `npx` user to the latest release, and the reverse-any-video skill moves to `--cli-version latest` when the installed CLI is behind. That is a person's call at a terminal. An unattended job pins.
## Verify the output before anything consumes it
Nobody watches an unattended render, so check it the way the loop's step 5 does before it ships downstream: `ffprobe` the file and confirm the dimensions match the project's `data-width`/`data-height` and the duration matches the root `data-duration`.