> ## 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 feed-key: make the key that signs update feeds

> bach feed-key writes a private key file and prints the public_key line for bach.toml, so installed apps accept only update feeds you signed.

`bach feed-key` makes the key pair that signs your [update feeds](/docs/guides/updates.md#signed-feeds). The private key goes into a file on your computer. The public key is what you put in `bach.toml`, so an installed app takes an update only when its feed entry carries your signature.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach feed-key
bach feed-key --out secrets/feed-key.private
```

```console theme={"theme":{"light":"github-light","dark":"github-dark"}}
$ bach feed-key
Wrote the private key to feed-key.private. Keep it secret and out of Git; it signs your update feeds.
Put this in bach.toml:

[updates]
public_key = "<public key>"

Sign with it by setting BACH_FEED_KEY to the file's content (or BACH_FEED_KEY_FILE to its path) when you run `bach build` or `bach feed`.
```

| Flag | Default | Meaning |
| - | - | - |
| `--out PATH`, `-o PATH` | `feed-key.private` | Where to write the private key. The file must not exist yet, so a key is never overwritten by accident. |

## Using the key

**1. Add the public key**

Copy the `public_key` line the command prints into the `[updates]` section of `bach.toml`. See [`[updates]`](/docs/reference/config/updates).

**2. Keep the private key secret**

Keep the file out of Git. On macOS and Linux it is readable by you only. On Windows it gets the rights of its folder, so keep it somewhere only you can read.

**3. Sign when you build**

Set `BACH_FEED_KEY` to the file's content, or `BACH_FEED_KEY_FILE` to its path, before [`bach build`](/docs/reference/cli/build) or [`bach feed`](/docs/reference/cli/feed). In CI, store the key as a secret. See [Environment variables](/docs/reference/setup/environment-variables.md).

To change the key later without stranding installed copies, hand over in two releases with `next_public_key`. See [Changing the key](/docs/guides/updates.md#changing-the-key).

The command needs no `bach.toml` and works on Windows, macOS and Linux.


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