> For the complete documentation index, see [llms.txt](https://getsquish.gitbook.io/squish/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://getsquish.gitbook.io/squish/getting-started/quickstart-cli.md).

# Quickstart: CLI

**Give AI random access to video.** The Squish CLI turns a video into timestamped contact sheets — a grid of frames, each cell stamped with its absolute timecode — entirely on your machine. Nothing is uploaded, ever, and every density is free.

## Requirements

* **Node ≥ 20**
* **`ffmpeg` + `ffprobe` on PATH**
  * macOS: `brew install ffmpeg`
  * Ubuntu: `sudo apt-get install ffmpeg`

## First sheet

No install step needed — run it straight from npm:

```bash
npx -y @getsquish/squish clip.mov
```

Or install globally:

```bash
npm install -g @getsquish/squish
squish clip.mov
```

## What lands on disk

Sheets land beside the input as `clip.sheet-1.jpg` (pattern: `<basename>.sheet-N.jpg`) — a timecoded frame grid. Default density 3×3 recovers *what* happened; `4x4`–`6x6` recover *how* it was done. `--out <dir>` picks the destination.

Hand the sheet to any vision model: cells run in time order, left→right, top→bottom, and every cell carries the absolute timecode of the frame it shows.

## Machine-readable output: `--json`

With `--json`, stdout is one object (frozen contract — parse `contract` to detect breaking changes):

```json
{
  "input": "/abs/path/clip.mov",
  "duration": 20.275,
  "frames": 9,
  "sheets": 1,
  "files": ["/abs/path/clip.sheet-1.jpg"],
  "warnings": [],
  "contract": "squish-cli-v0"
}
```

Exit `0` success · `1` failure (message on stderr). Temp frames are always cleaned up.

## Zoom into a range

`--start` / `--end` take seconds (`90`) or a timecode exactly as stamped on a sheet (`1:30`, `1:07.3`) and window the run to that range:

```bash
squish clip.mov --start 1:00 --end 1:30 --density 5x5
```

**Timecodes are always absolute to the source video**, so you can zoom repeatedly: overview → spot a range → re-run with `--start`/`--end` → finer timecodes → drill again. Short windows stamp sub-second timecodes (`1:07.3`) so adjacent cells stay distinguishable. A windowed run additionally echoes `"window": { "start": …, "end": … }` (resolved bounds, seconds) in the `--json` output — the key is absent when no window was requested.

## Next

* [The navigation loop](/squish/the-primitive/the-navigation-loop.md) — how an agent chains overview → zoom → zoom to answer with evidence instead of replaying the clip.
* [CLI reference](/squish/reference/cli.md) — every flag, exit codes, and the full JSON contract.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://getsquish.gitbook.io/squish/getting-started/quickstart-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
