# CLI recipes

> Subtitles for an editor, a folder of recordings, chapters, a pipe into an LLM, screen recordings and CI.

Page: https://scribiz.com/docs/cli/recipes

Working commands for common jobs. Each one assumes you have signed in with `scribiz login`, saved your own key with `scribiz setup`, or set `GEMINI_API_KEY` or `SCRIBIZ_API_KEY`. Install steps are in [Install the CLI](https://scribiz.com/docs/cli.md).

## Subtitles for an editor

Make an SRT that lines up with a timeline that starts at one hour, the way most editors start a sequence:

```bash
scribiz ./interview.mov --offset 01:00:00 -o ./interview.srt
```

Add `--speakers` to start each cue with the speaker. Use `--format vtt` for web video.

## A folder of recordings

```bash
scribiz ./recordings -o ./transcripts
```

In a terminal you get a picker. To process everything without asking, which is what a script needs, add `--no-input`:

```console
$ scribiz ./recordings -o ./transcripts --no-input
...
/Users/you/transcripts/speech.srt
/Users/you/transcripts/talking.srt
Done: 2 succeeded, 0 failed
```

Each input becomes one file in `./transcripts`. The paths are printed on standard output, and the progress and the `Done:` line go to standard error. A failure on one file does not stop the rest, and the exit code is the first failure's. A credential or minutes problem stops the rest, because the next file would fail the same way. Add `--json` and read one `result` per file, each with the path of its `<name>.json`, then a `summary`. Without `-o`, those `.json` files are written next to your media.

## Chapters for a video description

Save the Context once, then print the chapters as timecodes:

```bash
scribiz context https://youtu.be/VIDEO_ID --format json -o video.json

jq -r '.synthesis.chapters[] | (.start | floor) as $s
  | (if $s >= 3600 then "\($s / 3600 | floor):" else "" end) as $h
  | (($s % 3600 / 60) | floor | tostring | if length < 2 then "0" + . else . end) as $m
  | (($s % 60) | tostring | if length < 2 then "0" + . else . end) as $x
  | "\($h)\($m):\($x) \(.title)"' video.json
```

Each line is `MM:SS Title`, or `H:MM:SS Title` past an hour. The chapter times come from real transcript segments, not from the model's own seconds. A video that is too short or has too little to split gets no chapters, and then the list is empty. YouTube only accepts a list that starts at `00:00`, has at least three chapters and keeps each at least ten seconds long, and this command does not enforce that. Check the list before you paste it.

For the same chapters as a bullet list, ask for the `context` format and read its `Chapters` section:

```bash
scribiz format video.json --format context | awk '/^## Chapters/{f=1;next} /^## /{f=0} f&&NF'
```

```text title="Output for a Context with three chapters"
- 00:00 Intro
- 00:04 The fox
- 00:10 The number
```

## Pipe a video into an LLM

The `context` format is made for this. It is plain Markdown with the summary, chapters, key moments and transcript, and `ON SCREEN` notes in between.

```bash
scribiz context https://youtu.be/VIDEO_ID | claude -p "List the action items and who owns them."
```

Progress goes to standard error, so the pipe gets only the Markdown. For a long video, give the model the overview first and ask it to say what it needs. The [MCP server](https://scribiz.com/docs/mcp.md) does this for you.

## A silent screen recording

A QuickTime or Screen Studio recording often has no narration. Listen finds nothing, so use Watch:

```bash
scribiz context ./screen-recording.mov --mode watch
```

Watch builds a small copy of the video on your machine, uploads that, and returns what was on screen with the text that appeared. Auto does the same when it sees there is no audio.

```console
$ scribiz context silent.mp4
...
## On screen

The video displays three consecutive illustrated scenes featuring different objects and text titles, representing a red apple, a green forest, and a blue ocean.

[00:00] ON SCREEN: A cream-colored background shows a red circle resembling an apple in the center, with text at the bottom. Text: "SCENE ONE - RED APPLE"
[00:03] ON SCREEN: A dark green background shows three light green triangular mountain shapes, with text at the bottom. Text: "SCENE TWO - GREEN FOREST"
[00:05] ON SCREEN: A blue sky over a lighter blue ocean with a yellow sun in the upper right, and text at the bottom. Text: "SCENE THREE - BLUE OCEAN"
```

A plain `scribiz silent.mp4` stops with `NO_AUDIO_STREAM`, because SRT, VTT and TXT need speech. A Screen Studio bundle (`.screenstudio`) can be passed as it is. Its microphone track is transcribed.

## Ask a saved result

Run the video once, keep the file, and ask as many questions as you like without reading the video again:

```bash
scribiz context ./talk.mp4 --format json -o talk.json
scribiz ask talk.json "What was decided about the launch date?"
```

## Use it in CI

Put a credential in your CI's secret store and expose it as `SCRIBIZ_API_KEY` (a key from the dashboard, counted in your account's minutes) or `GEMINI_API_KEY` (your own Gemini key, billed by Google). Nobody is there to confirm a sign-in code in CI, so the browser sign-in does not fit: use the environment variable. Make the run non-interactive. `--max-cost` stops a run whose estimate is over a limit, before it spends anything. Only macOS has been tested, so try it on your CI image first.

```bash
scribiz ./release-demo.mp4 --format vtt --no-input --max-cost 0.50
```

Check the exit code. 3 is a credential or quota problem, 4 is a problem with the file or link, 5 is the service. See [Commands](https://scribiz.com/docs/cli/commands.md#exit-codes).

## Keep a Context and render it later

```bash
scribiz context ./talk.mp4 --visual --format json -o talk.json
scribiz format talk.json --format md -o talk.md
scribiz format talk.json --format srt -o talk.srt
```

One run pays for all three files.

---

Checked against the Scribiz build on 2026-10-05.
