> ## 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 version: show or raise the version everywhere

> bach version [TARGET]: lists the version in bach.toml, package.json, lock files, Cargo and Tauri files, or raises it in all of them at once.

`bach version` keeps the version of your app in one place. It lists what every version file says, or raises the version in all of them at once. The [release workflow](/docs/guides/releasing.md) runs it, and you can run it by hand.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach version              # list every file's version
bach version patch        # 1.4.2 → 1.4.3
bach version minor
bach version 2.0.0-rc.1   # an exact version
bach version current      # keep the version, write it everywhere
bach version minor --dry-run
```

```console theme={"theme":{"light":"github-light","dark":"github-dark"}}
$ bach version minor
bach.toml: 1.4.2 → 1.5.0
package.json: 1.4.2 → 1.5.0
package-lock.json: 1.4.2 → 1.5.0
1.5.0
```

| Argument or flag | Meaning |
| - | - |
| `TARGET` | `patch`, `minor`, `major`, `current`, or an exact version such as `2.0.0` or `2.0.0-rc.1` (a leading `v` is dropped). Leave it out to list the versions instead. |
| `--config FILE` | The config file. Default `bach.toml`. The version files are the ones next to it. |
| `--dry-run` | Say what would change and write nothing. |

## Behaviour

* The new version is the only thing written to standard output. The changed files go to standard error, so a script can capture the version.
* The base is the version in `bach.toml`; without a `bach.toml`, the first file found. Files that disagree are all set to the new version.
* An exact version can't be lower than the current one. `patch` on a pre-release such as `1.5.0-rc.1` gives `1.5.0`.
* Without a target, it exits with code `1` if the files disagree, and names the two that do.
* Only the version text is replaced, so line endings, key order and formatting stay as they were.

## Machine-readable output

With `--json`, standard output is one JSON object and nothing else. Listing gives `ok`, `version` (the one everything says) and `files` (the files that carry it). Raising gives `ok`, `version` (the new one), `dry_run` and `changed` (the files changed, or that would be with `--dry-run`).

```console theme={"theme":{"light":"github-light","dark":"github-dark"}}
$ bach version minor --dry-run --json
{"changed":["bach.toml"],"dry_run":true,"ok":true,"version":"1.5.0","warnings":[]}
```

## Files that are kept in step

These are used when they exist next to `bach.toml`:

| File | Where |
| - | - |
| `bach.toml` | `[app] version` |
| `package.json` | `version` |
| `package-lock.json`, `npm-shrinkwrap.json` | `version` and `packages[""].version`. Dependencies are not touched. |
| `Cargo.toml`, `src-tauri/Cargo.toml` | `[package]` or `[workspace.package]` `version`, when it is written out (not `version.workspace = true`) |
| `Cargo.lock`, `src-tauri/Cargo.lock` | The crates built from this checkout (those without a `source`). Dependencies are not touched. |
| `src-tauri/tauri.conf.json` | `version` (or `package.version` in Tauri 1) |
| `*.csproj` | `<Version>`, unless it is a property like `$(…)` |


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