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

# Install Bach

> Install the bach command with npm, a PowerShell or shell script, Scoop, a zip file, Cargo or the GitHub Action, then check that it works.

This page puts the `bach` command on your computer. This is the tool you use to make installers. Your users never need it; they only get the setup file you build.

Pick one method. None of them needs Rust, and none asks for administrator rights unless you choose a system-wide install.

## Install

> [tab] npm
>
> Works on Windows, macOS and Linux. You need Node.js 18 or newer.
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> npm install --global @usebach/cli
> ```
>
> Don't use `sudo` or an administrator terminal. If npm says it can't write to its global folder, give npm a folder of your own and try again:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> npm config set prefix ~/.npm-global
> ```
>
> Then add `~/.npm-global/bin` to your `PATH`.
>
> You can also add Bach to a single project, which keeps everyone on your team on the same version:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> npm install --save-dev @usebach/cli
> npx bach build
> ```
>
> > [accordion] npm says the platform package isn't installed
> >
> > `@usebach/cli` holds no program itself. npm installs a second package that matches your system, such as `@usebach/cli-win32-x64`. If npm ran with `--omit=optional`, that second package is missing. Install again without the flag.

> [tab] Windows (PowerShell)
>
> ```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
> irm https://raw.githubusercontent.com/usebach/bach-installer/main/install.ps1 | iex
> ```
>
> The script downloads the latest release, checks it against its published checksum, puts `bach.exe` and `bach-setup.exe` into `%LOCALAPPDATA%\Programs\bach-cli`, and adds that folder to your `PATH`. Open a new terminal afterwards.
>
> If that folder already holds other files, the script stops instead of writing into it. Set `BACH_INSTALL_DIR` to another folder in that case.
>
> To install for every user of the computer, set `BACH_SCOPE` first. Windows asks for permission once. If you say no, Bach is installed only for you.
>
> ```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
> $env:BACH_SCOPE = 'system'
> irm https://raw.githubusercontent.com/usebach/bach-installer/main/install.ps1 | iex
> ```

> [tab] macOS and Linux
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl -fsSL https://raw.githubusercontent.com/usebach/bach-installer/main/install.sh | sh
> ```
>
> This puts `bach` into `~/.local/bin`. If that folder isn't on your `PATH`, the script prints the line to add.
>
> On these systems you can build Windows installers, for example on a Linux CI server. The first `bach build` downloads the Windows program that every setup file is made from, and checks it before using it.
>
> To install for every user, run:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl -fsSL https://raw.githubusercontent.com/usebach/bach-installer/main/install.sh | sh -s -- --system
> ```
>
> That installs into `/usr/local/bin` and only uses `sudo` for that copy.

> [tab] Scoop
>
> ```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
> scoop install https://raw.githubusercontent.com/usebach/bach-installer/main/scoop/bach.json
> ```

> [tab] Zip file
>
> Download `bach-<version>-windows-x64.zip` from the [releases page](https://github.com/usebach/bach-installer/releases) and unzip it into a folder you'll keep. Keep `bach.exe` and `bach-setup.exe` together. Add the folder to your `PATH`, or run `bach.exe` with its full path.

> [tab] Cargo
>
> If you already have Rust:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> cargo install --git https://github.com/usebach/bach-installer bach-cli
> ```
>
> This builds only the `bach` command. It downloads the setup program the first time it needs it.

To get a specific version with the PowerShell or shell script, set `BACH_VERSION`, for example `0.11.1`, or `0.11` for the newest 0.11 release.

For CI, see [Build in GitHub Actions](/docs/guides/ci.md); you don't need to install anything yourself there.

## Check that it works

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach --version
```

This prints `bach` and a version number. Then run:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach doctor
```

`bach doctor` says whether Bach has what it needs to build. In a folder without a `bach.toml`, it tells you so and suggests `bach init`. That's expected at this point.

Running `bach` on its own lists every command, grouped by what you'd use it for.

## What gets installed

Bach is two programs:

* `bach` is the command you type.
* `bach-setup` is the install window. Every setup file you build is a copy of it with your app attached.

On Windows both are installed side by side. Where `bach` only has the command (macOS, Linux, Cargo), it downloads the setup program when a build needs it and keeps it in `%LOCALAPPDATA%\bach\runtime\<version>` on Windows or `~/.cache/bach/runtime/<version>` elsewhere. [Environment variables](/docs/reference/setup/environment-variables.md) lists settings that change this, such as building on a computer without internet access.

## Update Bach

When a newer release exists, `bach` mentions it after a command you run in a terminal. How you update depends on how you installed it:

| Installed with | Update with |
| - | - |
| PowerShell script, shell script or zip file | `bach update` |
| npm | `npm update --global @usebach/cli` |
| Scoop | `scoop update bach` |
| Cargo | the `cargo install` command above, with `--force` |

If you run `bach update` on a copy that npm, Scoop or Cargo manages, it tells you which command to use instead. Set `BACH_NO_UPDATE_CHECK=1` to stop the notices.

Updating Bach doesn't change installers you already built, and it doesn't update your users' apps.

## Remove Bach

With npm, run `npm uninstall --global @usebach/cli`. With Scoop, `scoop uninstall bach`. For the PowerShell script, delete `%LOCALAPPDATA%\Programs\bach-cli` and remove it from your `PATH`; for the shell script, delete `~/.local/bin/bach`.

## Next step

[Make your first installer](/docs/quickstart.md).


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