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

# The bach command: every command at a glance

> Overview of the bach command line: init, check, preview, watch, build, test, diff, verify, feed, sign, winget, choco, intune, version and workflow, with flags.

`bach` is the command developers run. It reads a `bach.toml`, checks it, previews the window and writes the setup file. It runs on Windows, macOS and Linux, so installers can come out of any CI.

Run `bach` on its own (or `bach --help`) to see every command grouped by what you are doing. `bach COMMAND --help` lists the options of one command.

```console theme={"theme":{"light":"github-light","dark":"github-dark"}}
$ bach
Bach 0.10.0  modern, clean Windows installers from one bach.toml

Start
  init      Write a starter bach.toml
  import    Turn an Inno Setup or NSIS script into a bach.toml
  check     Read bach.toml and list what would be installed
  build     Build the setup file

Try it
  preview   Open the installer window without installing anything
  watch     Keep the preview open and reload it when bach.toml changes
  test      Install, start and remove the setup file on a clean Windows

Look and layout
  styles    List the built-in styles of the window
  layouts   List the built-in layouts of the window
  profiles  List the other builds of this bach.toml

Inspect a setup file
  inspect   Show what it installs
  verify    Check it for damage without installing it
  diff      Show what changed between two versions

Release
  version   Show or raise the version in every file that has one
  workflow  Add the one-click GitHub release workflow
  sign      Sign a setup file
  feed-key  Make the key pair that signs update feeds
  feed      Write the update feed (latest.json)
  key       Make access keys for a protected app

Publish and deploy
  winget    Write the winget manifests
  choco     Write the Chocolatey package
  page      Write a download page
  intune    Write the Intune settings and detection script

Bach itself
  doctor    Check that everything a build needs is in place
  update    Update bach to the newest release
```

The names are coloured in a terminal that shows colour, and plain when the output is piped or `NO_COLOR` is set. The update notice (below) follows the list, so `bach` alone is also where you learn that a new release is out.

The same commands, with their usage:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach init              write a starter bach.toml
bach import SCRIPT     write a first bach.toml from an Inno Setup or NSIS script
bach check             read bach.toml and list what would be installed
bach build             write the setup file (and, with --online, the online installer)
bach key               make random access keys for a protected app
bach preview           open the installer window without installing anything
bach watch             keep the preview open and reopen it when bach.toml changes
bach styles            list the built-in styles of the installer window
bach layouts           list the built-in layouts of the installer window
bach inspect FILE      show what a setup file installs
bach verify FILE       check a setup file for damage without installing it
bach diff OLD NEW      show what changed between two setup files of an app
bach test [FILE]       install, start and remove a setup file in Windows Sandbox (or --here)
bach profiles          list the other builds (portable ZIP, company version) of this bach.toml
bach doctor            check that everything a build needs is in place
bach feed-key          make the key pair that signs your update feeds
bach feed FILE --url   write the update feed for a (signed) setup file
bach sign FILE         sign a setup file the way [signing] in bach.toml says
bach winget FILE --url write winget manifests for a setup file
bach choco FILE --url  write the Chocolatey package for a setup file
bach intune FILE       write the Intune settings and detection script for a setup file
bach page FILE --url   write a download page for a setup file
bach version [TARGET]  show or raise the version in every file that has one
bach workflow          add the one-click release workflow to a GitHub repository
bach update [VERSION]  update bach itself to the newest release (or VERSION)
```

## Commands

| Command | What it does | Reference |
| - | - | - |
| `bach init` | Writes a starter `bach.toml`. Fills it in for Rust, Tauri, Electron, .NET, Godot, Unity and other projects. | [init](/docs/reference/cli/init.md) |
| `bach import SCRIPT` | Writes a first `bach.toml` from an Inno Setup (`.iss`) or NSIS (`.nsi`) script and lists what it couldn't convert. | [import](/docs/reference/cli/import.md) |
| `bach check` | Validates the config and lists every file and option, with warnings. `--strict` makes a warning an error. | [check](/docs/reference/cli/check.md) |
| `bach preview` | Opens the window without installing. Flags: `--uninstall`, `--theme`, `--lang`, `--style`, `--layout`. | [preview](/docs/reference/cli/preview.md) |
| `bach watch` | Like `bach preview`, and opens the window again every time you save `bach.toml` or a file it names. | [watch](/docs/reference/cli/watch.md) |
| `bach styles` | Lists the 14 built-in styles of the window, what each looks like and what kind of app it suits. | [styles](/docs/reference/cli/styles.md) |
| `bach layouts` | Lists the 10 built-in layouts of the window and what each suits. | [layouts](/docs/reference/cli/layouts.md) |
| `bach build` | Writes the setup file. Flags: `--fast`, `--out`, `--runtime`, `--online`, `--key-file`, `--sign`, `--patch-from`, `--strict`, `--profile`, `--all-profiles`, `--runtime-arm64`, `--x64-only`, `--msi`. See [`[profiles]`](/docs/reference/config/profiles), [`[arch.arm64]`](/docs/reference/config/arch) and [MSI packages](/docs/guides/msi.md). | [build](/docs/reference/cli/build.md) |
| `bach diff OLD NEW` | Shows what changed between two setup files: files added, removed and changed, new registry values, and what made the app bigger. | [diff](/docs/reference/cli/diff.md) |
| `bach test [FILE]` | Installs a setup file on a clean Windows in Windows Sandbox (or, with `--here`, on a CI runner), starts the app, removes it and reports failures and leftovers. | [test](/docs/reference/cli/test.md) |
| `bach profiles` | Lists the profiles of `bach.toml`: a portable ZIP, a company version. | [profiles](/docs/reference/cli/profiles.md) |
| `bach key` | Prints random access keys for an app with `[access]`. | [key](/docs/reference/cli/key.md) |
| `bach inspect FILE` | Shows what a setup file or an installed `uninstall.exe` carries. | [inspect](/docs/reference/cli/inspect.md) |
| `bach verify FILE` | Checks a setup file for damage without installing it, and says whether it carries a signature. | [verify](/docs/reference/cli/verify.md) |
| `bach doctor` | Says whether everything a build needs is in place. | [doctor](/docs/reference/cli/doctor.md) |
| `bach feed-key` | Makes the key pair that signs update feeds and prints the `public_key` line for `bach.toml`. | [feed-key](/docs/reference/cli/feed-key.md) |
| `bach feed FILE --url URL` | Writes the update feed for a (signed) setup file. Flags include `--rollout` and `--patch`. | [feed](/docs/reference/cli/feed.md) |
| `bach sign FILE` | Signs a setup file with the program `[signing]` names. Optional. | [sign](/docs/reference/cli/sign.md) |
| `bach winget FILE --url URL` | Writes the manifests that list a setup file in winget. | [winget](/docs/reference/cli/winget.md) |
| `bach choco FILE --url URL` | Writes the Chocolatey package that installs a setup file. | [choco](/docs/reference/cli/choco.md) |
| `bach intune FILE` | Writes what Microsoft Intune needs to deploy a setup file: the install and uninstall commands, the detection rule and a detection script. | [intune](/docs/reference/cli/intune.md) |
| `bach page FILE --url URL` | Writes a one-file download page for a setup file, with the size, a download button and the SHA-256. | [page](/docs/reference/cli/page.md) |
| `bach version [TARGET]` | Lists the version in every file that has one, or raises it in all of them at once. | [version](/docs/reference/cli/version.md) |
| `bach workflow` | Adds the one-click release workflow to a GitHub repository. | [workflow](/docs/reference/cli/workflow.md) |
| `bach update [VERSION]` | Updates `bach` itself to the newest release, or to `VERSION`. Flags: `--check`, `--force`. | [update](/docs/reference/cli/update.md) |

## Global flags

| Flag | Meaning |
| - | - |
| `--help`, `-h` | Show the grouped command list for `bach`, or the options of one command (`bach build --help`) |
| `--version`, `-V` | Print the version |
| `--json` | For `check`, `build`, `inspect`, `feed`, `doctor`, `version` and `update`: print one JSON object on stdout instead of text lines. It holds `ok`, what the command made (`setup`, `online_setup`, `patch`, `feed`, `version`, `sha256`, `size`) and `warnings`. After an error it is `{"ok": false, "error": "…"}` and the exit code is non-zero. The fields are in `schema/bach-output.schema.json`. |

## Exit codes

Every command exits with `0` on success. On any problem it prints a readable sentence, never raw debug output, and exits with a non-zero code. That makes the commands safe to use in scripts and CI.

## Config path

`check`, `build`, `preview` and `doctor` take an optional path to a config file. It defaults to `bach.toml` in the current folder. Paths inside the config are relative to the config file.

## Platform notes

| Command | Windows | macOS and Linux |
| - | - | - |
| `init`, `import`, `check`, `build`, `styles`, `layouts`, `profiles`, `key`, `feed-key`, `inspect`, `doctor`, `feed`, `sign`, `winget`, `choco`, `intune`, `verify`, `diff`, `page`, `version`, `workflow`, `update` | Yes | Yes |
| `preview`, `watch`, `test` | Yes | No. Use `bach check`. |
| Applying `app.icon` to the setup file | Yes | No. The setup file keeps Bach's icon. |

## Update notice

When a newer release exists, a command run in a terminal, and plain `bach`, ends with a line that says so and names the command that updates `bach`. It is silent in CI, with `--json` and when output is piped, and `BACH_NO_UPDATE_CHECK` turns it off. See [`bach update`](/docs/reference/cli/update).

## The setup runtime

Every installer is built on `bach-setup.exe`. `bach` finds it next to itself, in a repository checkout, in a download cache or downloads it once. See [Install Bach](/docs/installation.md).


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