Installation

Get primer running in under two minutes

Install the binary

The installer detects your OS and architecture, downloads the correct binary, and places it at ~/.primer/bin/primer.

curl --proto '=https' --tlsv1.2 -fsSL https://github.com/barestripehq/primer/releases/latest/download/primer-installer.sh | sh

Run primer init

This is the only setup step. It generates shims for every detected package manager and prepends ~/.primer/bin to your PATH.

primer init

What primer init does:

  1. Detects installed package managers (npm, pip, cargo, go, etc.).
  2. Generates lightweight shim scripts in ~/.primer/bin/.
  3. Prepends ~/.primer/bin to your shell config — .zshenv for zsh, .bashrc for bash, fish function wrappers for fish.

Non-interactive / Docker: use primer init --no-shell to install shims without modifying any shell config files. Set ENV PATH="/root/.primer/bin:$PATH" in your Dockerfile instead.

Verify

which pip          # → /Users/you/.primer/bin/pip
primer doctor      # checks PATH order, shim health, cache, model state

primer doctor (alias: primer info) reports PATH precedence, the resolved path of each shim, cache size, and active AI model.

Windows

Download and run the MSI installer from the latest release. It places primer.exe in %USERPROFILE%\.primer\bin and registers it in your user PATH automatically.

Then run once in a new terminal to set up shims:

primer init

What primer init does on Windows:

  1. Detects installed package managers (npm, pip, cargo, go, etc.).
  2. Creates .cmd wrappers in %USERPROFILE%\.primer\bin\ (e.g. npm.cmd, pip.cmd).
  3. Updates user PATH via SETX so wrappers take precedence.
  4. Injects $env:PATH update into your PowerShell 7 profile.

To verify:

where npm          # → C:\Users\you\.primer\bin\npm.cmd
primer doctor      # checks PATH order and shim health

Git hooks on Windows: the pre-commit hook script requires Git Bash or a POSIX-compatible shell. It works out of the box for developers using Git for Windows.

Supported platforms

PlatformArchitectureInstaller
macOSApple Silicon (aarch64)Shell installer / .tar.xz
macOSIntel (x86_64)Shell installer / .tar.xz
Linuxx86_64Shell installer / .tar.xz
LinuxARM64 (aarch64)Shell installer / .tar.xz
Windowsx86_64MSI installer / PowerShell installer

Teardown

primer uninit reverses every change made by primer init:

primer uninit            # remove shims + PATH entry
primer uninit --purge    # also delete ~/.primer/cache and ~/.primer/models

Shell PATH ordering

primer must appear before version managers in $PATH. If nvm, pyenv, asdf, or volta are detected ahead of ~/.primer/bin, primer doctor will warn and show the exact reorder instruction.

Build from source

git clone https://github.com/barestripehq/primer
cd primer
cargo build --release                    # core only
cargo build --release --features ai     # with local AI summaries