# Install ni with Homebrew, Nix, apt

Selects the right Node package manager based on lockfiles. Version 30.3.0 via Homebrew; verified 2026-07-23. Also installable with nix: nix profile install nixpkgs#ni.

## Install

```sh
sudo av install brew:ni
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ni
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ni
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ni/ni/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- Debian apt (92%):

```sh
sudo apt install nd
```

  Evidence: Debian stable package indexes: nd from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## Package facts

- **Package key:** brew:ni
- **Package manager:** Homebrew
- **Version:** 30.3.0
- **Source summary:** Selects the right Node package manager based on lockfiles
- **Homepage:** <https://github.com/antfu-collective/ni>
- **Last updated:** 2026-07-23T06:02:53Z
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- na (alias)
- nci (alias)
- nd (alias)
- ni (alias)
- nlx (alias)
- nr (alias)
- nun (alias)
- nup (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 30.3.0
## Project history and usage

`ni` is Anthony Fu's JavaScript package-manager dispatcher: one set of short commands that detects whether a project uses npm, Yarn, pnpm, Bun, or Deno and runs the matching package-manager command.

### Project history

The npm registry metadata for `@antfu/ni` shows the package created on November 5, 2020. The project later moved under the `antfu-collective` GitHub organization while keeping the author ecosystem around Anthony Fu's JavaScript tooling.

The README documents the core idea as lockfile and package metadata detection. It maps `ni`, `nr`, `nlx`, `nup`, `nun`, `nci`, `nd`, and `na` onto equivalent npm, Yarn, pnpm, Bun, and Deno operations, and uses the separate `package-manager-detector` package for detection.

### Adoption history

The tool became a small package-nerd convenience in the Node ecosystem because frontend and monorepo developers often switch between repositories with different lockfiles. Homebrew analytics on July 1, 2026 reported 1,661 install-on-request events over 365 days, and the npm package was modified as version 30.2.0 on June 25, 2026.

The ecosystem signal is not that `ni` owns dependency installation, but that it standardizes muscle memory. Its README includes Homebrew and asdf installation paths, auto-install support for missing package managers, and configuration through `~/.nirc` or environment variables.

### How it is used

Practical usage is intentionally tiny: run `ni` to install dependencies, `nr` to run scripts, `nlx` to download and execute a package, `nup` to upgrade, `nun` to uninstall, `nci` for clean/frozen installs, and `na` to invoke the detected package manager itself. The tool detects `yarn.lock`, `pnpm-lock.yaml`, `package-lock.json`, `bun.lock`, `bun.lockb`, `deno.json`, `deno.jsonc`, or the `packageManager` field.

### Timeline

- {'date': '2020-11-05', 'event': '`@antfu/ni` npm package created.'}
- {'date': '2026-06-25', 'event': 'npm metadata listed version 30.2.0 as the latest package version.'}

### Related projects

- npm
- Yarn
- pnpm
- Bun
- Deno
- package-manager-detector

### Sources

- <https://formulae.brew.sh/api/formula/ni.json>
- <https://github.com/antfu-collective/ni>
- <https://github.com/antfu-collective/package-manager-detector>
- <https://registry.npmjs.org/@antfu%2Fni>


## Security Notes

infrastructure mutation or orchestration signal.

- **Geiger risk:** orange / medium
- infrastructure mutation or orchestration signal

## Other Package-Manager Records

- Nix - ni: normalized package name match | nixpkgs package indexes: pkgs/by-name/ni/ni/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Debian apt - nd - 0.8.2-8.1: installed executable or alias match | Debian stable package indexes: nd from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | small command line interface to WebDAV servers | http://gohome.org/nd/
- Ubuntu apt - nd - 0.8.2-8.1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: nd from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | small command line interface to WebDAV servers | http://gohome.org/nd/


## Combined YAML source

View the package source record on GitHub. [combined/ni.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ni.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
