snpmv2026.5.16

CLI Reference

Terse flag, env-var, and exit-code matrix

A condensed reference card. For prose, examples, and discussion see Commands.

Global flags

FlagDescription
-v, --verboseEnable verbose logging (also SNPM_VERBOSE=1)
--frozen-lockfileFail if lockfile is missing/out of date (propagates to install-like subcommands)
--no-frozen-lockfileIgnore lockfile, re-resolve
--prefer-frozen-lockfileUse lockfile when valid, otherwise re-resolve

Commands

install

snpm install [packages...]

--production, --frozen-lockfile/--immutable, --no-frozen-lockfile, --prefer-frozen-lockfile, --fix-lockfile, -f/--force, -w/--workspace <name>.

add

snpm add <packages...>

-D/--dev, -g/--global, -f/--force, -w/--workspace <name>, -r/--recursive, --filter <selector>, --filter-prod <selector>.

remove

snpm remove <packages...>

-g/--global, -r/--recursive, --filter <selector>, --filter-prod <selector>.

run

snpm run <script> [-- args...]

-r/--recursive, --filter <selector>, --filter-prod <selector>, --skip-install. Unknown subcommands fall through to run.

exec

snpm exec <command> [args...]

-c/--shell-mode, -r/--recursive, --filter <selector>, --filter-prod <selector>, --skip-install.

dlx

snpm dlx <package> [args...]

--offline, --prefer-offline. Aliases when invoked as spx, snpx, pnpx.

upgrade

snpm upgrade [packages...]

--production, -f/--force, -r/--recursive, --filter <selector>, --filter-prod <selector>. With no packages, deletes the lockfile and re-resolves.

outdated

snpm outdated

--production, -r/--recursive, --filter <selector>, --filter-prod <selector>.

licenses

snpm licenses

--json.

why

snpm why <package>

--depth <N>, --json, -r/--recursive, --filter <selector>, --filter-prod <selector>. Supports glob patterns.

list

snpm list

-g/--global, -r/--recursive, --filter <selector>, --filter-prod <selector>.

snpm link [package] · snpm unlink [package]

No flags. Without a package name, operates on the current project against the global link store.

pack

snpm pack

--dry-run, --list, --json.

publish

snpm publish

--tag <tag> (default latest), --access <public|restricted>, --otp <code>, --dry-run, --allow-risk <code>, -r/--recursive, --filter <selector>, --filter-prod <selector>.

rebuild

snpm rebuild

No flags.

audit

snpm audit [packages...]

--audit-level <level>, -P/--prod, -D/--dev, --format <table|json|sarif>, --fix, --ignore-cve <id> (repeatable), --ignore-ghsa <id> (repeatable), --ignore-unfixable, --ignore-registry-errors.

patch

snpm patch edit <pkg[@version]> (alias patch start) · snpm patch commit <path> · snpm patch remove <pkg> · snpm patch list.

clean

snpm clean

-y/--yes, --dry-run, --packages, --metadata, --global, --all.

store

snpm store status · snpm store path · snpm store prune [--dry-run].

login

snpm login

--registry <url>, --scope <scope>. Default flow is web-based; the resulting Bearer token is saved to ~/.snpmrc.

logout

snpm logout

--registry <url>, --scope <scope>.

init

snpm init

No flags. Generates package.json with packageManager pinned to the running snpm version.

config

snpm config

No flags. Prints resolved configuration.

node

snpm node <subcommand> — full nvm-style version manager.

Subcommands: install [version] [--lts] [--default], uninstall <version>, use [version] [--lts] [--default] [--install] [--silent], list (alias ls), ls-remote (aliases list-remote, remote), current, which <version>, alias <name> [version], unalias <name>, default <version>, exec <version> -- <cmd>, run <version> <script>, env [--shell <name>].

completions

snpm completions <shell>

Hidden helper. Supported shells: bash, zsh, fish, powershell, elvish.

Multicall aliases

snpm rewrites argv0 when invoked as a known alias:

argv0Behaves as
spx, snpx, pnpxsnpm dlx
snprsnpm run

Workspace selectors (--filter / --filter-prod)

--filter selects projects against the workspace dependency graph. The same grammar is used by every workspace-aware command (add, remove, run, exec, upgrade, outdated, list, why, publish).

PatternEffect
pkg-nameExact project name
@scope/*, foo-?Glob over project names
./packages/api, ../lib, /abs/pathPath-based match (project rooted at this path)
pkg...The package and everything it depends on
...pkgThe package and everything that depends on it
^pkg... / pkg^...Same as above, but exclude the seed (graph operators only)
[<git-ref>]Projects with files changed since <git-ref> (uses git diff)
!pkgExclude (combine with positive selectors)

--filter-prod accepts the same grammar but restricts dependency/dependent walks to production dependencies only.

Environment variables

Directories

VariablePurpose
SNPM_HOMESets cache=$SNPM_HOME/cache, data=$SNPM_HOME/data

Without SNPM_HOME, platform defaults are used:

  • macOS: cache ~/Library/Caches/snpm, data ~/Library/Application Support/io.snpm.snpm
  • Linux: cache ~/.cache/snpm, data ~/.local/share/snpm
  • Windows: cache %LOCALAPPDATA%\snpm\snpm\cache, data %LOCALAPPDATA%\snpm\snpm\data

Install behavior

VariableDefaultValues
SNPM_HOISTsingle-versionnone, single-version, all
SNPM_LINK_BACKENDautoauto, hardlink, symlink, copy
SNPM_STRICT_PEERSfalsetruthy
SNPM_FROZEN_LOCKFILEfalsetruthy
SNPM_REGISTRY_CONCURRENCY128integer > 0
SNPM_DISABLE_GLOBAL_VIRTUAL_STORE_FOR_PACKAGESnext,nuxt,vite,vitepress,parcelComma-separated names; [] disables the list

Truthy values: 1, true, yes, y, on.

Registry & auth

VariableDescription
NPM_CONFIG_REGISTRY / npm_config_registryDefault registry URL
PNPM_CONFIG_REGISTRY / pnpm_config_registrySame, pnpm prefix
SNPM_CONFIG_REGISTRY / snpm_config_registrySame, snpm prefix (highest precedence)
SNPM_AUTH_TOKEN, NODE_AUTH_TOKEN, NPM_TOKENBearer token for default registry
NPM_CONFIG__AUTH / PNPM_CONFIG__AUTH / SNPM_CONFIG__AUTHBase64 Basic credentials for default registry
NPM_CONFIG_ALWAYS_AUTH / SNPM_ALWAYS_AUTHForce auth on every request (truthy)

snpm prefers SNPM_*, then PNPM_*, then NPM_* for the registry/auth variables that have all three forms.

Security

VariableDefaultDescription
SNPM_ALLOW_SCRIPTS(empty)Comma-separated packages allowed to run install scripts
SNPM_MIN_PACKAGE_AGE_DAYS(none)Ignore versions published within N days
SNPM_MIN_PACKAGE_CACHE_AGE_DAYS7Re-fetch metadata older than N days

Logging

VariableDefaultDescription
SNPM_VERBOSEfalseEnable verbose output (also -v/--verbose)
SNPM_LOG_FILE(unset)Custom log file path (defaults to .snpm.log in cwd when verbose)

Exit codes

CodeMeaning
0Success
1Any error: install failure, lockfile drift in frozen mode, audit found vulnerabilities, publish refused, etc.

snpm audit exits 1 when vulnerabilities are present unless --ignore-registry-errors was set and the registry itself failed.

Comparison with npm

npmsnpm
npm installsnpm install
npm install <pkg>snpm add <pkg>
npm install <pkg> --save-devsnpm add -D <pkg>
npm install -g <pkg>snpm add -g <pkg>
npm uninstall <pkg>snpm remove <pkg>
npm updatesnpm upgrade
npm outdatedsnpm outdated
npm run <script>snpm run <script> (or snpm <script>)
npx <pkg>snpm dlx <pkg> (or spx <pkg>)
npm initsnpm init
npm login / npm logoutsnpm login / snpm logout
npm pack / npm publishsnpm pack / snpm publish
npm audit / npm audit fixsnpm audit / snpm audit --fix
npm explain <pkg>snpm why <pkg>
npm ls -gsnpm list -g
npm link / npm unlinksnpm link / snpm unlink
npm rebuildsnpm rebuild
npm cache clean --forcesnpm clean (interactive) or snpm clean -y

On this page