Installation

Nish comes as one prebuilt compiler, the nish command. On its own it checks a program and writes LLVM IR. Building a native binary also needs LLVM, which is clang and the lld linker; LLVM 18 is the recommended version. This page installs both and checks that they work. INSTALL.md covers everything else: release tarballs, WebAssembly, building the compiler from source, and platforms with no prebuilt binary.

What runs where

A prebuilt compiler exists for four platforms: Linux (glibc) on x86_64 and on ARM64, and macOS on Intel and on Apple Silicon.

Windows is not supported natively. Install WSL with Ubuntu and follow the Linux steps inside it. musl-based Linux (Alpine), FreeBSD and 32-bit systems have no prebuilt compiler either; INSTALL.md describes what you can do on them.

Install it in three steps

Install LLVM, then the compiler, then check that both run.

Install LLVM

nish calls clang from your PATH, or the compiler named by the CC environment variable when that is set.

sudo apt-get update
sudo apt-get install -y clang-18 lld-18 llvm-18
export CC=clang-18        # add this line to your shell profile

These packages install only versioned commands (clang-18, ld.lld-18), not a plain clang, which is why CC points at the versioned one.

sudo dnf install clang lld llvm
xcode-select --install

Xcode's command-line tools are enough to build native binaries. For the WebAssembly targets, install Homebrew's LLVM instead, as INSTALL.md describes.

Install the compiler

Either way below installs the same prebuilt compiler; nothing is compiled during the install.

This needs neither Node nor npm, only sh, curl and tar:

curl -fsSL https://raw.githubusercontent.com/amritk/nish/main/install.sh | sh

The script installs into ~/.nish and puts ~/.nish/bin on your PATH in your shell's startup file: ~/.zshrc for zsh, ~/.bashrc for bash (~/.bash_profile on macOS), ~/.config/fish/conf.d/nish.fish for fish, and ~/.profile for any other shell. It names the file it changed. That takes effect in a new terminal; to use nish in the terminal you installed from, run the source line the script prints:

source ~/.zshrc

To keep your startup files untouched, end the command with | sh -s -- --no-modify-path instead of | sh. The script then prints the export PATH=… line to add yourself. To upgrade later, run nish upgrade (Staying up to date).

Ending the command with | sh -s -- --help instead of | sh lists the script's other options: another directory, leaving PATH alone, and uninstalling, which also takes out the PATH line the script added.

This needs Node.js 22.18 or newer. The package and the command it installs are both nish:

npm install -g nish

Install it without -g (npm install --save-dev nish) to pin the version per project in package.json, and run it as npx nish. A project install links no agent skill. Run npx nish-skills to review the writing-nish skill and link it into .claude/skills/ for coding agents; Agent skills says what it asks and what it touches.

If you have the old @amritk/nish package installed, uninstall it (npm uninstall -g @amritk/nish) and install nish instead.

nish upgrade does not replace a compiler npm installed: it prints the npm install -g nish@<version> line to run instead.

Nish is pre-alpha and changes between minor releases, so you may want to pin an exact version: end the install script's command with | sh -s <version>, or run npm install -g nish@<version>, with the version number in place of <version>. Read the changelog before you upgrade.

Checking where the download came from

Every release lists a SHA-256 for each of its files in SHA256SUMS, and the install script refuses a download that does not match. Releases after 0.21.0 also carry a signed build provenance attestation: a record, signed through GitHub, that the files were built by Nish's release workflow from the tagged source on GitHub's own runners. A matching checksum shows that the file is the one the release lists; the attestation shows where that release came from.

When the GitHub CLI (gh) is installed and signed in, the install script checks the attestation too, and refuses to install if it does not verify. Without gh it skips that check and says so, unless you set NISH_REQUIRE_ATTESTATION=1, which makes it refuse to install anything it cannot check:

curl -fsSL https://raw.githubusercontent.com/amritk/nish/main/install.sh | NISH_REQUIRE_ATTESTATION=1 sh

To check a tarball you downloaded yourself, fill in its version and platform as they appear in the file name (x86_64-linux, for example):

gh attestation verify nish-<version>-<platform>.tar.gz \
  --repo amritk/nish \
  --signer-workflow amritk/nish/.github/workflows/release.yml \
  --source-ref refs/tags/v<version>

Each release also attaches a software bill of materials, nish-<version>.spdx.json, in the SPDX format. It lists every file of the release with its checksum, the LLVM, linker and Node.js versions that built each compiler, and the third-party code compiled into it.

Check that it worked
nish --version
"${CC:-clang}" --version
  • The first command prints nish followed by its version number. If nish is not found, the directory it was installed into is not on your PATH yet: open a new terminal, or run the source line the install script printed.
  • The second runs the C compiler nish will use, $CC if you set it and clang otherwise, and prints its LLVM version. If it is not found, nish cannot build a binary either.

The real test is building a program: see Your first program. If nish cannot find a C compiler when it builds a binary, it prints no usable C compiler found and the install command for your platform, and exits with code 3.