# Mac: the CLI

> One install command, and local builds and every worktree read what CI compiled.

Source: https://warmbuild.dev/docs/mac/

**What you do**

1. In the repository, run the installer. It needs macOS; the CLI is one binary, no Node.js.

   ``` title="Terminal"
   curl -fsSL https://warmbuild.dev/install.sh | sh
   ```
2. Open the GitHub link it prints and enter the code. It then starts the cache, also after every reboot.
3. Build in Xcode as before, then check the hits. `warmbuild doctor` explains a miss.

   ``` title="Terminal"
   warmbuild status
   ```

**What you get**

Local builds and every worktree of the repository read what CI compiled on the default branch. Laptops only read.

## Details

- Needs macOS, nothing else: the CLI is one binary for Apple silicon or Intel. The installer checks it against its published SHA-256, installs it to `~/.warmbuild/bin` without sudo and links `warmbuild` into `~/.local/bin`. Then it signs you in and starts the cache for this repository. Run it again to update.
- Sign-in opens GitHub in the browser and asks for a code. When you can use several accounts (your own and an organisation's), it then asks which one.
- The cache keeps running after a reboot. The Xcode app gets `XCODE_XCCONFIG_FILE` from launchd; if Xcode was already open, reopen it once. For `xcodebuild` in a shell, `start` asks to add one `export XCODE_XCCONFIG_FILE=…` line to `~/.zshrc`.
- `warmbuild start` also says whether CI has filled the cache for this repository and this Mac's Xcode version. If not, a push to the default branch with the Action fills it.
- Each `warmbuild run -- xcodebuild …` ends with a line such as `1,840 of 1,871 compile tasks from the cache, about −4 min (estimate)`. `warmbuild status` shows the same for the last build.
- Swift files hit what CI compiled only on Xcode 27. Xcode 26 puts the checkout and DerivedData paths into Swift's keys, so on a Mac only its C and Objective-C modules hit. `start` can also add `#include? "warmbuild.local.xcconfig"` to the project's xcconfig. That covers the project's own targets, not its Swift packages, and Macs without Warmbuild build as before.
- `warmbuild doctor` explains a low hit rate and prints the fix. The CLI updates itself daily; `warmbuild update` does it now.
- The Mac's own store in `~/.warmbuild/store` is capped at 10 GiB and drops the least recently used files first. On APFS, worktrees share the disk blocks of large outputs.
- `warmbuild stop` turns it off. Every command and its flags: [CLI commands](https://warmbuild.dev/docs/cli/).

``` title="Terminal"
cd your-app
curl -fsSL https://warmbuild.dev/install.sh | sh
```
