> ## Documentation Index
> Fetch the complete documentation index at: https://demoman.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# refresh

> Record the repo's flows again and replace the exports whose picture changed.

```bash theme={null}
npx demoman refresh [<flow>…] [--base-url <origin>] [--hand-off <folder>] [--out-dir <folder>] [--previous <folder>] [--failures <folder>]
```

Records every flow in `.demoman/flows/` again, or only those named, with no
agent. Each export whose picture changed is replaced; one that looks the same
is left as it is, so an unchanged app makes no commit. A video whose run was
not clean (a step stopped or did not match, a frame was lost, the logo could
not be drawn) keeps its committed files and prints why, and the command exits

1. It records into a library it then deletes, so a refresh adds nothing to
   your own. How it judges a change, and what each line means, is on
   [Refresh](https://demoman.io/docs/concepts/refresh.md).

It compares the page as each step settled. A screen whose page never settled
is skipped and named on the flow's line, where it is and why, such as
`before step 3: the DOM never went quiet` or `1 request(s) in flight`; the
others are still compared. When no screen settled in both videos, the flow
fails and its files stay. A receipt from Demoman 0.9.4 or earlier is
recorded again and replaced once, and its line says so.

It starts the app from [`.demoman/app.json`](https://demoman.io/docs/reference/app-json): off CI it
uses an app already answering at `url`, otherwise it runs `start`.

| Flag | |
| - | - |
| `--base-url <origin>` | Record the app at this origin instead of the one each video was recorded at, such as a preview deployment. Ignores `app.json`. A Vercel deployment behind Deployment Protection needs its Protection Bypass for Automation secret in `VERCEL_AUTOMATION_BYPASS_SECRET` (the workflow passes the repository secret of that name to refresh, not to deliver): it is sent to this origin only. Without it the run stops on Vercel's page and says so |
| `--hand-off <folder>` | After refreshing, leave the files that changed and the result in this new folder, for [`deliver`](https://demoman.io/docs/reference/deliver) to commit. Refresh itself commits and pushes nothing, and makes no GitHub call. A failed flow still exits 1 after the folder is written. Not with `--check` |
| `--out-dir <folder>` | Write the flows added with `--deliver files` into this folder, with their receipts and `demoman-refresh.json`, which lists what each flow made. Nothing is committed. A `files` flow fails without it, and the others still refresh |
| `--previous <folder>` | A copy of everything earlier `--out-dir` runs delivered, kept whole (such as your bucket synced back down), to compare `files` flows against. It may be the `--out-dir` itself |
| `--failures <folder>` | Keep each failed flow's run report (`report.json`) and the last frame it recorded (`final-still.png`) in a folder of its own here, named after its file in `.demoman/flows/`. The flow's line names the folder, and says why when there is no still, such as a run that recorded no frame. A run refused before it started has neither, and its line says why |
| `--check` | Record nothing; print each flow's state and exit 3 when every flow is current, else 0. A flow with no receipt, recorded from uncommitted changes, or that git cannot compare counts as changed. Accepts only `--previous` and `--since <sha>`, the commit the last successful refresh ran at. The daily workflow uses it |

## Delivering

Refresh does not commit. `demoman deliver <pr|main> <folder>` reads the
folder `--hand-off` wrote and commits it, in a job of its own with write
access that never runs your app. It checks the folder against the repo's flows
first and refuses, committing nothing, when it holds a path no flow declares.
See [deliver](https://demoman.io/docs/reference/deliver.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.