ni
Detects a project's package manager from its lockfile and translates ni, nr, nlx, nup, nun, nci commands for npm, yarn, pnpm, bun, deno, nub and aube.
ni is a set of short commands that wrap JavaScript package managers. Before running, it inspects the project for lock files and workspace files (yarn.lock, pnpm-lock.yaml, package-lock.json, bun.lock, bun.lockb, deno.json, nub.lock, aube-lock.yaml, and others) or the packageManager field in package.json. It then runs the equivalent command for npm, yarn (1 and Berry), pnpm, bun, deno, nub or aube. Detection and command mapping use the package-manager-detector library.
The commands cover the usual dependency tasks: ni installs (ni vite, ni -D, -P for production only, --frozen, -g for global, -i for interactive selection), nr runs scripts (nr dev --port=3000, nr - to rerun the last script, nr -p to pick a package and script), nlx downloads and executes packages (--local prefers a local binary), nup upgrades (-i for interactive), nun uninstalls, nci does a clean install, nd dedupes, and na is a bare alias for the detected agent. Appending ? to a command prints the resolved command instead of running it, and -C <dir> changes directory first.
In pnpm workspaces with catalogs, Yarn Berry workspaces with catalogs, or Bun workspaces with catalogs, ni switches to catalog mode. It writes catalog: references into package.json and updates the workspace catalog, prompting for a catalog when the package isn't in one. Configuration lives in ~/.nirc or NI_* environment variables. Options include defaultAgent, globalAgent, runAgent=node (uses node --run, needs Node.js 22+), useSfw, and catalog. Setting NI_AUTO_INSTALL=true installs a missing package manager globally before running the command. Shell completions are available for bash, zsh and fish.
It is aimed at JavaScript and TypeScript developers who move between projects that use different package managers. On Windows PowerShell, the built-in ni alias for New-Item must be removed for the tool to work.
Installation
# via Homebrew
brew install ni
Alternatives & related tools
concurrently
Node.js CLI that runs multiple shell commands in parallel with prefixed, colored output and options to kill or restart processes. Works on Windows.
serve
Node.js CLI that serves a static site, single page application, or single file over HTTP, with a browsable directory listing UI.
npm-check-updates
CLI that upgrades package.json dependencies to their latest versions, preserving semver range operators. Works with npm, yarn, pnpm, deno, and bun.
clasp
Command-line tool for developing Google Apps Script projects locally: push/pull code, manage versions and deployments, tail logs, and run functions.
Prism
Command-line HTTP server that mocks APIs from OpenAPI v2/v3.x and Postman Collections, and proxies traffic to validate it against the spec.
add a badge to your README
Maintain ni? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/ni?utm_source=badge)<a href="https://www.trmn.sh/tools/ni?utm_source=badge"><img src="https://www.trmn.sh/badge/ni.svg" alt="Featured on trmn" height="20"></a>