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

# Sign in

> Record an app behind a login, with a demo account or a session of your own.

<ol />

An app behind a login needs Demoman signed in before a run. There are two
ways, and only the first can be kept in a repo and recorded again by CI.

| | A demo account | Your own sign-in |
| - | - | - |
| For | An app you run locally, on a development database | A real account, single sign-on, two-factor |
| Who signs in | Demoman, from `.demoman/accounts.json` | You, once, with `npx demoman signin` |
| In the repo and CI | Yes | No |

## Demo accounts

For an app you run locally, the agent creates a demo account and its data,
writes the sign-in steps to `.demoman/accounts.json` and the
password to `.demoman/secrets.env` (git-ignored) with the one site it may
be typed on. Demoman then signs in by itself, whenever a session is missing
or has lapsed. The agent commits nothing for the account until you
[add a flow to your repo](https://demoman.io/docs/get-started/add-to-repo.md); then it commits
`accounts.json` and the script that creates the account with the flow, so
CI can sign in the same way.

> [!WARNING]
>
> Only demo accounts: the agent never asks for your own password.

> [!NOTE]
>
> On your own machine, keep secrets in `.demoman/secrets.env`, not your
> shell: an agent may pass Demoman only part of its environment, as
> Codex does, so a variable exported in your shell may never reach it.

The file's fields are on [accounts.json](https://demoman.io/docs/reference/accounts-json.md).

## Your own sign-in

For a real account, sign in once yourself:

```bash theme={null}
npx demoman signin https://app.example.com
```

A window opens; sign in as you normally would. Demoman's browser keeps the
session. It is a fresh profile, signed in only where you ran `signin`.

Demoman then opens the page signed in and signed out, and keeps the
headings, links and buttons only the signed-in page shows. A run that
starts on that page and finds none of them stops as signed out, so a sign-in
wall at the app's own address is never recorded; on another page of the app
it records, and its report says so. Give `signin` a page that differs once
signed in, such as the app's home. A session saved before Demoman did this
has none of this: its runs say so, and running `signin` again adds it.

A flow recorded this way cannot be added to the repo: CI has no way to sign
in as you. Record it again with a demo account first.

## In CI

Set each `DEMOMAN_SECRET_<NAME>` from the provider's secrets, with
`DEMOMAN_SECRET_<NAME>_ORIGIN` naming the one site it may be typed on.
[Keep videos current](https://demoman.io/docs/get-started/ci.md) sets them for GitHub Actions. Check an
account with:

```bash theme={null}
DEMOMAN_SECRET_SELLER_PASSWORD_ORIGIN=https://staging.example.com \
  npx demoman signin --account seller
```

`--account` takes the account's name from `.demoman/accounts.json`. Every
flag is on [signin](https://demoman.io/docs/reference/signin.md).

> [card] [Next · 05](https://demoman.io/docs/get-started/add-to-repo.md)
>
> Add to your repo


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