Skip to content

CLI commands

Every command supports --help for its full flags and examples. Commands that act on an environment accept --global / -g to target the global ~/.nem/nem.ver instead of the nearest project nem.ver.

Environment

CommandDescription
nem use <package>[@<version>] ...Install and record package(s) in the current environment
nem unuse <package> ...Remove package(s) from the current environment
nem upgradeUpgrade active package(s) to their latest versions
nem refreshSync the current environment with global and project nem.ver
nem tidyClean up and format nem.ver
nem set-env KEY=VALUE ...Set environment variable(s) in nem.ver
nem unset-env KEY ...Remove environment variable(s) from nem.ver

Inspection

CommandDescription
nem statusShow active packages and environment variables
nem search <query>Search for packages across all catalogs
nem package info <package>Show information about a package
nem package versions <package>List versions of a package available in catalogs
nem doctorDiagnose common nem misconfiguration
nem versionPrint the nem version

Shell integration

CommandDescription
nem activate [bash|zsh|fish]Install nem shell integration
nem deactivate [bash|zsh|fish]Remove nem shell integration from your shell rc file
nem shell-envOutput PATH and env exports for packages in nem.ver
nem completion <shell>Output a shell completion script

Catalogs

CommandDescription
nem catalog add git <name> <url>Add or update a remote git repository as a catalog
nem catalog add local-dir <name> <path>Add or update a local directory as a catalog
nem catalog add oci <name> <ref>Add or update an OCI registry as a catalog
nem catalog listList configured catalogs
nem catalog info <name>Show detailed information about a catalog
nem catalog reorder <name> [name...]Set the lookup order of explicit catalogs
nem catalog update [name]Update one or all catalogs from their source
nem catalog remove <name>Remove a catalog by name

The name official is reserved for the official catalog. nem catalog add rejects it with an error; nem catalog reorder and nem catalog remove cannot act on it either — disable the official catalog with use-official-catalog: false or NEM_USE_OFFICIAL_CATALOG=0 instead.

Packages & maintenance

CommandDescription
nem package listList installed packages (alias ls)
nem package install <package>@<version> ...Install package(s) and their dependencies
nem package uninstall <package>@<version> ...Uninstall package(s)
nem package reinstall <package>@<version> ...Reinstall package(s)
nem cleanUninstall package(s) not used recently

Authoring

CommandDescription
nem author lint [path]Validate pkg.yaml manifests before publishing
nem author publish <registry-base> [catalog-dir]Publish a catalog directory to an OCI registry
nem author mirror <registry-base> [catalog-dir]Mirror package archives/sources into an OCI registry