> ## 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 watch: reopen the preview on every save

> bach watch [CONFIG]: keeps the installer preview open and reopens it whenever bach.toml, or a logo, license or text file it names, changes. Needs Windows.

`bach watch` is [`bach preview`](/docs/reference/cli/preview) with the loop closed. It opens the installer window, then opens it again every time you save `bach.toml`, or a file the config names: the logo, the license, a text file for the window, a font or picture of [`[style]`](/docs/reference/config/style), the panel picture of [`[layout]`](/docs/reference/config/layout). Nothing is installed or removed.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach watch
bach watch --theme dark --lang de
bach watch --uninstall
bach watch --layout showcase
```

The arguments are the ones of `bach preview`:

| Argument or flag | Default | Meaning |
| - | - | - |
| `CONFIG` | `bach.toml` | The config file |
| `--uninstall` | off | Watch the removal window instead |
| `--theme THEME` | from the config | Override the theme: `system`, `light` or `dark` |
| `--style NAME` | from the config | Try another built-in style. [`bach styles`](/docs/reference/cli/styles) lists them. |
| `--layout NAME` | from the config | Try another built-in layout. [`bach layouts`](/docs/reference/cli/layouts) lists them. |
| `--lang CODE` | Windows' own | Show it in this language |
| `--profile NAME` | main build | Watch this [profile](/docs/reference/config/profiles.md) of the config |
| `--runtime PATH` | `bach-setup.exe` next to `bach` | The setup runtime to build on. Also read from `BACH_RUNTIME`. |

## What happens

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Watching bach.toml and the files it names. Save a change and the preview opens again; press Ctrl+C to stop.
Opened the installer preview. Nothing is installed or removed.
```

* A save is picked up when the file has been still for a moment, so an editor that writes in two steps causes one reload.
* The new window opens first and the old one closes after it, so the window is gone for as short a time as possible.
* A mistake in the config is printed as a sentence, and the window stays as it was. The next save that fixes it reopens the window.
* Files named in the config that don't exist yet are picked up when you create them. Paths that leave the config's folder are never watched.

## Notes

* `bach watch` runs until you stop it with Ctrl+C. Stopping it leaves the last window open; close it yourself. It has no `--json` result, so scripts and coding agents should use [`bach check`](/docs/reference/cli/check).
* Like preview, it needs Windows.


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