antfu-collective

antfu-collective/ni

TypeScript MIT Dev Tools

💡 Use the right package manager

8.3k stars
274 forks
recent
GitHub +8 / week

8.3k

Stars

274

Forks

27

Open issues

30

Contributors

v30.2.0 25 Jun 2026

AI Analysis

ni is a CLI tool that detects the package manager used in a project (npm, yarn, pnpm, bun, or deno) and runs the appropriate commands with normalized syntax, eliminating friction when switching between projects with different package managers. It is purpose-built for developers working across multiple projects with heterogeneous tooling, and is most valuable for monorepo maintainers, open-source contributors, and teams using mixed package manager ecosystems.

Dev Tools CLI Tool Discovery value: 3/10
Documentation 9/10
Activity 9/10
Community 9/10
Code quality 6/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

package-manager-abstraction cli-automation developer-ergonomics typescript cross-ecosystem-tool
Actively maintained Well documented MIT licensed Popular Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
3w ago

ni unifies npm, yarn, pnpm, bun, and deno CLI commands behind a single set of aliases

ni detects which package manager a project uses (via lockfile) and routes commands through the correct one. Developers who work across multiple JS projects no longer need to remember whether to type 'npm install', 'pnpm add', or 'yarn add'. Targets individual developers and teams managing polyglot monorepos or open-source contributors who hop between projects. Particularly useful as the JS ecosystem has fragmented across npm, pnpm, yarn Berry, bun, and deno. Built by Anthony Fu, a prolific OSS contributor with strong community trust.

Origin

Created in November 2020 when pnpm was gaining traction and yarn Berry was diverging from npm syntax, creating real daily friction for developers switching between projects. Has evolved to support bun (2023) and deno, and added pnpm catalog support as of v29.

Growth

Growth was primarily driven by Anthony Fu's OSS influence and the broader fragmentation of the JavaScript package manager ecosystem. As pnpm adoption rose sharply (2021–2024), ni's value proposition strengthened. Stars grew steadily to 8,252, reflecting sustained community interest rather than a single viral moment. Recent star velocity (4/week) is modest, suggesting the tool has reached a stable, satisfied audience rather than explosive new growth.

In production

Widely referenced in community tutorials and dotfiles across GitHub. Anthony Fu's own projects and Vite ecosystem contributors are documented users. npm download stats for @antfu/ni are not cited in the README, but the package is frequently mentioned in JS developer tooling discussions. Adoption appears strong among developers using pnpm or working in multi-package-manager environments. Exact production-scale deployment evidence is not formally documented in the README.

Code analysis
Architecture

Appears to be a CLI tool written in TypeScript that detects the active package manager by inspecting lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb, deno.lock) in the current or parent directories, then translates and proxies commands. Likely uses a mapping table of command equivalents per agent. Appears modular given the distinct subcommands (ni, nr, nlx, nup, nun, nci, nd, na). Config resolution via ~/.nirc and environment variables is documented.

Tests

not documented in README

Maintenance

Last push was 2026-04-22, approximately 2 months before the evaluation date. This indicates active maintenance. The addition of pnpm catalog support in v29 and shell completion scripts suggests ongoing feature development aligned with ecosystem changes, not just bug fixes.

Honest verdict

ADOPT IF: you frequently switch between JS projects using different package managers (npm, pnpm, yarn, bun, deno) and want a single muscle-memory command set. AVOID IF: your team standardizes on exactly one package manager and lockfile discipline is enforced — the abstraction adds no value there. MONITOR IF: you care about deno or bun parity — support for newer runtimes may lag behind their own CLI evolution.

Independent dimensions

Mainstream potential

4/10

Technical importance

5/10

Adoption evidence

6/10

Risks
  • Package manager CLIs (especially bun and deno) evolve rapidly; command mappings may briefly lag behind upstream changes.
  • Lockfile detection heuristic can fail in unusual monorepo setups or when multiple lockfiles coexist, potentially routing to the wrong agent.
  • Project is maintained by a single prominent individual; long-term maintenance depends on Anthony Fu's continued involvement.
  • As package managers converge on similar syntax (bun increasingly mirrors npm), the tool's differentiating value may gradually diminish.
  • Shell alias conflicts (particularly 'ni' conflicting with other tools on some Linux distributions) are a known friction point documented in community discussions.
Prediction

ni will likely remain a stable, niche-but-popular developer convenience tool for the foreseeable future. Its relevance is tied directly to package manager fragmentation in the JS ecosystem — if that fragmentation persists or deepens, ni remains valuable. Mainstream potential is limited because its use case is optional ergonomics, not critical infrastructure.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

TypeScript
99.4%
JavaScript
0.6%

Information

Language
TypeScript
License
MIT
Last updated
2w ago
Created
69mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

pnpm

pnpm/pnpm

pnpm is a fast, disk-space-efficient package manager for Node.js that uses...

35.7k Rust Dev Tools
npm

npm/cli

npm is the official package manager for JavaScript and Node.js, responsible for...

9.9k JavaScript Dev Tools
nodejs

nodejs/corepack

Corepack is a zero-dependency Node.js tool that manages package manager...

3.7k TypeScript Dev Tools
cnpm

cnpm/cnpm

cnpm is an npm client optimized for users accessing npm packages through...

2.1k JavaScript Dev Tools
tj

tj/n

n is a straightforward Node.js version manager written in BASH that lets users...

19.5k Shell Dev Tools
vs. alternatives
npm/cli

ni wraps npm, not competes with it. npm is the runtime; ni is the abstraction layer. No conflict.

pnpm/pnpm

pnpm is a package manager ni supports. Many pnpm users adopt ni precisely to avoid memorizing pnpm-specific syntax differences.

Schniz/fnm

fnm manages Node.js versions; ni manages package manager command routing. Complementary tools, not competitors — many developers use both.

sindresorhus/np

np handles npm publishing workflows; ni handles install/run/upgrade commands. Different scopes with minimal overlap.

tj/n

n is a Node version manager like fnm. Entirely different problem space from ni.