browser-clipdocs
Reference

Command line

Every command and option, as browser-clip --help prints them.

$ browser-clip --help
browser-clip 0.1.0 — scripted demo videos of web apps from a YAML script

Usage: browser-clip <command> [script] [options]

  examples              list the bundled example scripts
  init [file]           write a commented starter script (--url, --platform, --format), or copy
                        an example (--from <name>); either points editors at the JSON Schema
  validate <script>     check the script; --json for machine-readable diagnostics, --strict
                        to fail on warnings, --quiet to hide hints (alias: check)
  capture <script>      run the script in headless Chrome and cache the take in .browser-clip/
                        next to the script; --force captures again
  prune <script>        remove older takes from .browser-clip/ next to the script: each script
                        there keeps its 3 newest (--keep <n>) and the one it needs now. Every
                        capture prunes after a new take. A folder works too
  info <script>         duration, steps, camera shots, speed, overlays, sound (video seconds);
                        --json adds every marker
  targets <script>      the elements on screen after each step and the targets that find them,
                        best first (--after <step or id>, --json)
  render <script>       MP4 from the take (captured first if there is none), with the sound
                        track. --preview (half size, 30 fps), --fps <n>, --range a..b,
                        --codec h264|vp9|av1, --bitrate 2M, --deterministic (software VP9:
                        identical files)
  gif <script>          animated GIF (--fps 15, at most 50; --width 960, --range a..b)
  frames <script> -o <dir>   PNG sequence (frame-00001.png…) and the sound track (audio.wav) for
                        compositing in a video editor: --transparent (no backdrop), --fps <n>,
                        --range a..b, --scale <k>
  still <script> --at <t>    PNG at seconds or markers (--at 2.5,save.act,end), with
                        --transparent, --scale, --director, --no-camera; without --at, the
                        contact sheet
  sheet <script>        contact sheet PNG of key moments (--max 12, --sheet-cols <n>, --width <px>)
  schema                the JSON Schema of scripts, for editors; -o writes it (it is shipped as
                        references/schema.json)
  studio <script>       open the studio: a local page bound to the file, with the live preview and
                        the YAML editor; it captures a new take on request (--port, --no-open,
                        --camera for the preview only). Ctrl+C stops it
  ctl <script> <cmd>    drive an open studio: state, seek <t>, still <t> (-o), play, pause,
                        reload, capture (the take the page needs), camera [mode] (preview only)
  login <url> -o <name>.storage.json   open a browser window to sign in by hand; Enter saves the
                        session's cookies and local storage for capture.login (--save-after <s>
                        saves without waiting; --headless). Keep the file out of git

Options for every command:
  -o, --out <path>      output file (default: next to the script)
  --recapture           capture again before render or sheet
  --camera <mode>       auto | static | follow | push-in | pull-out | drift | handheld | manual
  --platform generic|windows|macos|linux    terminal-clip's frame, backdrop and cursor
  --format wide|short|square|portrait|WxH   --url <base URL>   --viewport WxH   --seed <n>
  --sound wav|mechanical|soft|none    the keyboard sound (typing.sound)
  --<section>.<key> <value>   override any setting, e.g. --video.fps 30 --browser.scale 1.5
  --set <path>=<value>        same, e.g. --set browser.colorScheme=dark

browser-clip runs the script for real: it loads the pages and clicks the buttons. Point it at local
servers, fixtures or staging, and never at real accounts without meaning to.
Script "-" reads standard input. A Markdown file's first ```browser-clip block is the script.
Env: CHROME_PATH=<the browser's program file>, used instead of searching for one;
BROWSER_CLIP_NO_SANDBOX=1 runs the browser without its sandbox (a container that cannot provide one).
Exit codes: 0 ok · 1 invalid script or failure · 2 usage · 3 warnings with --strict · 4 environment
(no browser, or it would not start) · 130 Ctrl+C, 143 SIGTERM (browsers and temporary folders go too).

The script reference describes each command in more detail, and the exit codes: 0 ok, 1 an invalid script or a failure, 2 a usage error, 3 warnings with --strict, 4 an environment problem (no browser, no studio open for the file).

Source: docs-src/pages/reference/cli.md · browser-clip 0.1.0