> ## 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 init: write a starter bach.toml

> bach init [DIR]: writes a commented bach.toml, filled in from your Rust, Tauri, Electron, .NET, Godot, Unity or other project. It never overwrites a file.

`bach init` writes a starter `bach.toml` that explains itself. In a Rust, Tauri, Wails, Electron, .NET, Flutter, PyInstaller, Qt, Godot or Unity project, it fills in the app's name, version, publisher, program and build folder from the project's own files.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach init
bach init path/to/project
```

| Argument | Default | Meaning |
| - | - | - |
| `DIR` | `.` | The folder to write `bach.toml` into. It is created if it does not exist. |
| `--no-workflow` | off | Don't add the GitHub release workflow, even in a GitHub checkout. |

## Behaviour

* It never overwrites. If `bach.toml` already exists in the folder, the command stops with a sentence saying so.
* It prints which stack it found: `Wrote bach.toml for this Rust project. Check [app] and [files], then run bach check.` In an unrecognised folder it writes placeholders based on the folder's name.
* The file starts with the `#:schema` line for editor completion, and every optional setting is present as a comment.
* In a git checkout whose `origin` is on GitHub, it also turns on [`[updates]`](/docs/reference/config/updates) with `github = "owner/repo"` for that repository. Elsewhere that section is a comment.
* In the same GitHub checkout it also writes `.github/workflows/bach-release.yml`, a one-click release: see [`bach workflow`](/docs/reference/cli/workflow) and [One-click releases](/docs/guides/releasing.md). It never fails the command: if the workflow can't be written, `init` says why. Without a GitHub `origin` it only prints a hint to run `bach workflow` later.

## What is detected

| Stack | Read from | Filled in |
| - | - | - |
| Tauri | `src-tauri/tauri.conf.json` | Product name, version, publisher from the identifier, `<name>.exe`, `src-tauri/target/release`, leftovers to exclude, a WebView2 requirement |
| Electron | `package.json` with `electron` as a dependency | Product name, version, author, `<name>.exe`, `dist/win-unpacked` or `out/<name>-win32-x64` for Electron Forge |
| .NET | A `*.csproj` file | Product or assembly name, version, company or authors, `<assembly>.exe`, `bin/Release/<framework>/win-x64/publish`, a `dotnet` requirement |
| Wails | `wails.json` | Product name, version and company from `info` (else the name and author), `<outputfilename>.exe`, `build/bin`, leftovers to exclude, a WebView2 requirement |
| Flutter | `pubspec.yaml` with a `flutter:` section | Title-cased name, version (without the `+build` part), `<name>.exe`, `build/windows/x64/runner/Release`, leftovers to exclude, a Visual C++ runtime requirement |
| PyInstaller | A `*.spec` file with an `EXE(` in it, and `pyproject.toml` for the version | The name from the spec, `<name>.exe`, `dist/<name>` (an `--onedir` build), `__pycache__` and logs left out |
| Qt | `CMakeLists.txt` that finds Qt, or a qmake `*.pro` file | The project's name and version, `<name>.exe`, `build/Release` (with the DLLs `windeployqt` copied), leftovers to exclude, a Visual C++ runtime requirement |
| Rust | `Cargo.toml` | Title-cased package name, version, first author, `<binary>.exe`, `target/release`, leftovers to exclude |
| Godot | `project.godot`, and `export_presets.cfg` when it has a Windows Desktop preset | Game name and version, the program and folder of the Windows export (else `build/<name>.exe`) |
| Unity | `ProjectSettings/ProjectVersion.txt` and `ProjectSettings.asset` | Product name, company, version, `Build/<product>.exe`, and the folders Unity marks as not to ship left out |

Detection is tried in this order: Godot, Unity, Tauri, Wails, Electron, .NET, Flutter, PyInstaller, Qt, Rust.

## The window's style

`init` never picks a style. Whatever the project, the window starts in Bach's own style, `bach`, and the starter file only shows the line as a comment:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
# style = "bach"             # the default for every app; `bach styles` lists the others
```

To use another look, set [`installer.style`](/docs/reference/config/style) yourself; [`bach styles`](/docs/reference/cli/styles) lists them all. The starter file also shows a commented [`[style]`](/docs/reference/config/style) section for your own fonts, colours and background.

> [!WARNING]
>
> Bach fills in what the project says about itself. Check `[app]` and `[files]` before building.

See [Write your bach.toml](/docs/guides/write-bach-toml.md).


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