> ## 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.

# setup

> Install Demoman's browser and connect your agents, or set up CI with --ci.

```bash theme={null}
npx demoman setup [--yes] [--agents claude,codex,cursor,opencode] [--quality share|high|full] [--pull-requests off|ask|attach] [--no-ask attach]
npx demoman setup --browser-only
```

Downloads Chromium (about 190 MB) and connects Demoman to Claude Code, Codex,
Cursor and OpenCode ([Connect your agent](https://demoman.io/docs/get-started/connect.md)). In a
terminal it first asks which agents to connect, the export quality and the
pull-request setting; run it again to change them. A flag answers its
question, so it is not asked; without a terminal (a script, CI) nothing is
asked.

| Flag | |
| - | - |
| `--yes` | Asks nothing and keeps the current settings, as without a terminal; agents run setup this way. Without `--agents`, it updates only the agents Demoman is already connected to, and connects every agent it finds only when it is connected to none |
| `--browser-only` | Installs Chromium and connects no agent, asking nothing; for CI. On Linux it exits 1, naming the one `sudo` command, when Chromium's libraries are missing |
| `--agents <list>` | The agents to connect, comma-separated: `claude`, `codex`, `cursor`, `opencode` |
| `--quality <quality>` | Export quality: `share`, `high` or `full` |
| `--no-ask attach` | Lets `attach` post to GitHub without your agent asking you first, for runs with no one to answer. `ci` always asks. A later run without the flag puts the prompt back |
| `--pull-requests <value>` | Pull-request videos: `off`, `ask` or `attach` ([Pull requests](https://demoman.io/docs/guides/pull-requests.md)) |

## setup --ci

```bash theme={null}
npx demoman setup --ci [--trigger release|daily|push|manual|<environment>] [--route pr|main] [--artifact]
  [--yes] [--env-file <path>] [--replace-secret <NAME>]...
```

Checks CI's refresh of the repo's flows from a clean checkout, shows one plan,
and on one confirmation turns on the Actions setting, sets the secrets, opens
the "Set up Demoman" pull request from `demoman/setup` and watches its first
run. A trigger or route not given is asked. The walkthrough is
[Keep videos current](https://demoman.io/docs/get-started/ci.md).

Run again where the workflow is already on the default branch, setup updates
it to this release's in one pull request, "Update Demoman's workflow". The
plan keeps the trigger, route and artifact the workflow has: `--trigger` and
`--route` replace theirs, and `--artifact` turns the artifact on (an update
never turns it off). The whole file is replaced, so anything added to it by
hand is dropped; the plan says so. A workflow that is already this release's
stops with `alreadySetUp`. One setup cannot read is asked about in a
terminal, and needs `--trigger` without one. The Studio does not update a
workflow: run setup in a terminal, or ask your agent.

Nothing is written to your checkout, branch or default branch before the
confirmation, except a drafted `.demoman/app.json` when the app step fails, so
you can fix it and run setup again.

| Flag | |
| - | - |
| `--trigger <environment>` | After each successful deployment to that environment; records the deployed app (`deployment:<name>` for an environment named `release`, `daily`, `push` or `manual`) |
| `--trigger release` | When a release is published, at its tag |
| `--trigger daily` | Once a day, or by hand from the Actions tab (Demoman → Run workflow). A day with nothing new stops before Chromium and the app |
| `--trigger push` | On each push to the default branch, or by hand; records every repo flow each time |
| `--trigger manual` | Only by hand from the Actions tab (Demoman → Run workflow); records every repo flow each time. A run started on another branch fails and names the branch to use |
| `--route pr\|main` | Open a pull request with the changed files (the default), or commit them to the branch. Deployment and release cannot use `main` |
| `--artifact` | Keep every `files` flow's video and receipt in the `demoman-videos` artifact, compared against the last run's. On without the flag when a repo flow delivers `files`: CI writes those videos only there, and the plan says so |
| `--yes` | Confirm the plan with its defaults. With no terminal and no `--yes`, nothing is written and the missing flags are named |
| `--env-file <path>` | Read secret values from this file |
| `--replace-secret <NAME>` | Replace a secret GitHub already has; kept otherwise |

The default trigger is a deployment if the repo has a successful one that
names a URL (a production environment first, never a preview), else release
if it publishes releases, else daily. Push and manual are never the default;
the plan shows push's measured cost per merge.

The plan's files: `.github/workflows/demoman.yml`, `.demoman/app.json`,
`.demoman/accounts.json` unless committed as is, a `.demoman/secrets.env` line
in `.gitignore` when it lacks one, and each repo flow not yet on the default
branch. A secret's value goes to GitHub on stdin, never in a command line, a
log or an answer.

The watch ends passed, failed, cancelled or unknown. Unknown means GitHub
could not be read, or the run was still going after 30 minutes. After three
failed runs on `demoman/setup` it hands back.

Your agent does the same with the MCP `ci` tool, which returns the plan first
and acts only after you agree. It never asks for a secret: it gives you the
command to run instead.

When setup stops, see [Refusals](https://demoman.io/docs/reference/refusals.md#setting-up-ci).

> [!NOTE]
>
> A release published with `GITHUB_TOKEN` starts no workflow, so a release
> trigger fires only for one published by a person or another token. GitHub
> turns a scheduled workflow off after 60 days without activity on a public
> repo; enable it again under Actions.


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