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

> ## Agent Instructions
> Bach builds Windows installers from one bach.toml with the bach command: bach init, bach check, bach preview, bach build. Installs are per user and need no administrator rights by default. installer.scope = "machine" installs for every user after one Windows prompt. On Windows, run setup files with Start-Process -Wait -PassThru in PowerShell, and give signtool arguments that start with the word sign.

# bach key

> bach key makes random access keys for apps with [access], printed or written to a new file, and shows how to pass them to a build in each shell.

`bach key` makes random keys for apps protected with [`[access]`](/docs/reference/config/access). It needs no config and changes nothing.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach key
bach key --count 50 --out keys.txt
```

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
TH6C-PLW3-M6SM-KYYW-K86H
```

| Flag | Default | Meaning |
| - | - | - |
| `-c`, `--count N` | 1 | 1 to 10000 keys |
| `-o`, `--out FILE` | print them | Write to a new file (UTF-8, one per line). Never overwrites. |

Keys are random (100 bits), grouped in fours, without characters that look alike (`0`, `O`, `1`, `I`). They're case sensitive.

## Build with them

The same in every shell:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach build --key-file keys.txt
```

Every line of the file opens the setup file (up to 1000). Or put a single key in the environment variable:

```powershell PowerShell theme={"theme":{"light":"github-light","dark":"github-dark"}}
$env:BACH_ACCESS_KEY = "TH6C-PLW3-M6SM-KYYW-K86H"; bach build
```

```bat cmd theme={"theme":{"light":"github-light","dark":"github-dark"}}
set BACH_ACCESS_KEY=TH6C-PLW3-M6SM-KYYW-K86H && bach build
```

```bash bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
BACH_ACCESS_KEY=TH6C-PLW3-M6SM-KYYW-K86H bach build
```

You can use your own keys: 8 to 128 characters of letters, digits and `- _ . ~ + / = :`.


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