Skip to main content
Bach is two files that live side by side: bach.exe, the command you run, and bach-setup.exe, the installer window every setup file is built from. Pick the install method that fits your machine. None of them needs Rust, and none asks for administrator rights unless you ask for a system-wide install.
With Node.js 18 or newer, on Windows, macOS and Linux:
The package holds no program of its own. npm installs the matching @usebach/cli-<platform> package next to it, and bach starts that. No install script runs and nothing is downloaded afterwards, so it works with --ignore-scripts. On Windows the platform package also carries bach-setup.exe.
  • In one project: npm install --save-dev @usebach/cli, then npx bach build.
  • Update: npm update --global @usebach/cli.
  • Remove: npm uninstall --global @usebach/cli.
Do not use sudo or an elevated shell. If npm’s global folder is not writable, point npm at your own with npm config set prefix ~/.npm-global. If bach reports that its platform package isn’t installed, npm ran with --omit=optional: install again without that flag.

Keep bach up to date

When a newer release exists, bach says so at the end of a command run in a terminal. Run bach update to install it. That works for the PowerShell and shell scripts and for the zip download; a bach installed with npm, Scoop, winget or cargo is updated with that tool, and bach update names the command. See bach update.

Check the install

bach doctor says whether the runtime, the config and the optional tools are in place, and exactly what to fix if not. See bach doctor.

Where Bach finds its runtime

Every installer is built on bach-setup.exe. When you run bach build or bach preview, bach looks for it in this order:
  1. The path given with --runtime, or in the BACH_RUNTIME environment variable.
  2. The file next to bach itself.
  3. In a checkout of the Bach repository, the copy a cargo build left in target\release or target\debug.
  4. A copy downloaded earlier. The cache is %LOCALAPPDATA%\bach\runtime\<version> on Windows, and $XDG_CACHE_HOME/bach/runtime/<version> (or ~/.cache/...) elsewhere.
  5. The one published with this version of Bach on GitHub, downloaded once and checked against its SHA-256 before use.
Set BACH_NO_DOWNLOAD to forbid the last step. All environment variables are listed in Environment variables.

Build from source

With Rust (stable) and the Visual Studio C++ build tools:
That gives target\release\bach.exe and target\release\bach-setup.exe.

Next step

Quickstart

Write your first bach.toml and build a Setup.exe.