Skip to main content

๐Ÿ“ฆ Installation

Dependenciesโ€‹

ZUnit requires:

  • Zsh (any reasonably recent version)
  • Revolver โ€” a progress spinner, must be available in $PATH

Manual installโ€‹

git clone https://github.com/z-shell/zunit.git
cd zunit
./build.zsh
chmod u+x ./zunit
cp ./zunit /usr/local/bin

Install Revolver alongside it:

curl -fsSL https://raw.githubusercontent.com/zdharma/revolver/master/revolver \
> /usr/local/bin/revolver
chmod u+x /usr/local/bin/revolver

Local bin install (no root)โ€‹

If you prefer to keep dependencies local to a project (useful for CI):

mkdir -p .bin
curl -fsSL "https://github.com/z-shell/zunit/releases/latest/download/zunit" > .bin/zunit
curl -fsSL "https://raw.githubusercontent.com/zdharma/revolver/master/revolver" > .bin/revolver
curl -fsSL "https://raw.githubusercontent.com/zdharma/color/master/color.zsh" > .bin/color
chmod u+x .bin/{color,revolver,zunit}
export PATH="$PWD/.bin:$PATH"

Install with Ziโ€‹

~/.zshrc
zi ice from"github" as"program" pick"zunit"
zi load z-shell/zunit

Project scaffoldingโ€‹

Once ZUnit is installed, zunit init sets up a new project in one command:

cd my-project
zunit init

This creates:

.zunit.yml โ€” project config
tests/
example.zunit โ€” example test file
_support/
bootstrap โ€” bootstrap script (sourced before each test file)
_output/ โ€” report output directory

To also generate a GitHub Actions workflow:

zunit init --github-actions

See Configuration for the .zunit.yml key reference and CI Integration for the generated workflow details.

:::note Legacy package-manager recipes

Older recipes may reference historical coordinates such as zunit-zsh/zunit or zdharma/zunit. These are not the canonical source. Prefer the manual install or the z-shell/zunit Zi snippet shown above.

:::