💡 Use the right package manager
8.3k
Stars
274
Forks
27
Open issues
30
Contributors
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.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
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.
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 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.
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.
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.
not documented in README
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.
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
- 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.
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.
Explore similar
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- TypeScript
- License
- MIT
- Last updated
- 2w ago
- Created
- 69mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
`--agent` prompts to install missing package managers instead of returning the detected agent
Expose execute-local (pnpm exec / yarn exec) as a separate command or flag
Add support for aube
nr strips "-p" from command args
ni uses node_modules/.bin/yarn (classic 1.22.22) instead of system yarn (corepack) due to tinyexec PATH prepending
Top contributors
Similar repos
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
8.3k | +8 | TypeScript | 8/10 | 2w ago |
|
|
35.7k | — | Rust | 9/10 | 13h ago |
|
|
9.9k | — | JavaScript | 9/10 | 12h ago |
|
|
3.7k | — | TypeScript | 8/10 | 13h ago |
|
|
2.1k | — | JavaScript | 7/10 | 1d ago |
|
|
19.5k | — | Shell | 8/10 | 3mo ago |
ni wraps npm, not competes with it. npm is the runtime; ni is the abstraction layer. No conflict.
pnpm is a package manager ni supports. Many pnpm users adopt ni precisely to avoid memorizing pnpm-specific syntax differences.
fnm manages Node.js versions; ni manages package manager command routing. Complementary tools, not competitors — many developers use both.
np handles npm publishing workflows; ni handles install/run/upgrade commands. Different scopes with minimal overlap.
n is a Node version manager like fnm. Entirely different problem space from ni.