# Installation

> Install the patchula binary, and what the runner needs at run time.

The Count is one binary, `patchula`. Releases have static builds for Linux (x86_64 and arm64) and macOS (Apple silicon). Intel Macs are not supported.

## Install

- **mise**

  ```sh
  mise use -g --minimum-release-age 0 packslip:sweepies/count-patchula
  ```

  Each release carries a [packslip](https://packslip.dev) manifest signed by the release workflow, so mise checks every download against it. `--minimum-release-age 0` skips mise’s 24-hour wait for new releases, so a release installs as soon as it is published. Pin a version with `packslip:sweepies/count-patchula@0.9.0`.

  The manifest also ships a `patchula` skill for coding agents, from [`skills/patchula`](https://github.com/sweepies/count-patchula/tree/main/skills/patchula): how to configure, validate and run the Count, with links back to these docs.

- **Release**

  Download the archive for your platform from the [releases page](https://github.com/sweepies/count-patchula/releases). It holds `bin/patchula`, the man page under `share/man`, and bash, zsh and fish completions under `share/`.

- **Container**

  ```sh
  docker pull ghcr.io/sweepies/count-patchula:X.Y.Z
  ```

  The image runs `patchula serve` with `git` included, for linux/amd64 and linux/arm64, and installs mise into its volume on the first start. Each release has a tag with its version, and `latest`. The [server guide](https://count-patchula.sweepy.dev/guide/server/#container-image) covers the volume, health check, settings and credentials.

- **Cargo**

  ```sh
  cargo install --git https://github.com/sweepies/count-patchula --locked patchula-cli
  ```

  This needs Rust 1.100 or newer and a C linker (`cc`). The repository’s own build setup, which supplies a Zig linker through mise, is not used by `cargo install`.

- **From a checkout**

  ```sh
  git clone https://github.com/sweepies/count-patchula
  cd count-patchula
  mise trust && mise install
  mise run build
  ./target/debug/patchula --version
  ```

  Every tool version is pinned in `mise.toml`, including Rust and the Zig linker, so a minimal image without system development packages can build it.

## What the runner needs

- `mise` on the `PATH`, or [packslip](https://packslip.dev), with which `patchula serve` and `patchula tools install` install the Count’s own pinned mise; with only packslip, run `patchula tools install` before other commands. Without mise, mise tools and lockfiles fail and everything else works. Tools go into the [tool store](https://count-patchula.sweepy.dev/guide/lockfiles/#the-tool-store); keep it on a persistent volume.
- `git`, for the partial clones a lockfile tool works in.
- A writable cache directory. By default it is `patchula/` in your user cache directory: `$XDG_CACHE_HOME/patchula` or `~/.cache/patchula` on Linux, and `~/Library/Caches/patchula` on macOS. Every checkout shares it, so lookups from one are reused in the next, and nothing is written into the repository. Pass `--cache DIR` to use another directory. It holds `cache.sqlite` (HTTP validators, catalogs and write receipts), the partial clones in `worktrees/` and the tool store in `tools/`. A warm cache is most of the speed, so keep it between runs. With neither `HOME` nor `XDG_CACHE_HOME` set, local commands stop and ask for `--cache`.

Some tools download slowly, so prewarm the store when you build an image:

```sh
patchula tools install --cache /var/lib/patchula
patchula tools prune --days 30 --cache /var/lib/patchula
```

## Shell completions and man page

`mise run docs:cli` in a checkout generates `generated/patchula.1` and bash, zsh and fish completions under `generated/completions`, along with the [CLI reference](https://count-patchula.sweepy.dev/reference/cli/).
