Reference

CLI

Commands, name and regex selection, and global runtime options.
nix-pins [OPTIONS] [COMMAND]
nix-pins update [PIN ...] [--version VERSION] [--dry-run [--json]] [--filter REGEX] [--tag TAG] [--failed] [--all-systems] [--report-json PATH] [--report-markdown PATH] [--refresh-dependencies] [--refresh-sources]
nix-pins status [PIN ...] [--filter REGEX] [--tag TAG] [--failed] [--all-systems] [--json]
nix-pins check [PIN ...] [--filter REGEX] [--tag TAG] [--failed] [--all-systems] [--json] [--exit-code]
nix-pins merge <FILE ...> [--output PATH] [--prefer-ours | --prefer-theirs] [--json]
nix-pins init [--template basic|cross-platform] [--with-toml] [--force]
nix-pins diff [REF_OR_FILE] [--format text|markdown|json]
nix-pins cache <status|clean> [--json]
nix-pins doctor [--json]
nix-pins graph [--format text|mermaid|dot]
nix-pins completions <bash|zsh|fish|nushell>

Commands

CommandBehavior
updateCheck versions, compute source and dependency hashes for selected Pins, and write the Pins File (--version VERSION overrides a single explicit Pin; --dry-run previews planned changes without modifying pins.json)
statusReport existing results and failures for selected Pins without modifying them (--json outputs schema v1 JSON)
checkRun Checkers concurrently against upstream without downloading sources or writing the Pins File (--json outputs schema v1 JSON; --exit-code exits 2 when updates are available)
merge <FILE ...>Deterministically merge multiple pins.json files across platforms, combining multi-system fingerprints and detecting or resolving conflicts
initScaffold a starter pins-config.nix (and optional nix-pins.toml) without overwriting existing files unless --force is set
diff [REF_OR_FILE]Compare current pins.json against a Git ref (default HEAD) or another pins.json in text, markdown, or json
cache status / cache cleanInspect entry count and disk usage of the local hash cache, or remove cached entries (--json supported)
doctorDiagnose nix, git, nixpkgs, configuration, pins.json, cache, and token readiness (--json supported)
graphExport cross-Pin dependencies as text, mermaid, or Graphviz dot
completions <SHELL>Print shell completion script for bash, zsh, fish, or nushell
No commandSame as status, selecting all Pins
help, --helpShow help
--versionShow the CLI version

Global options

OptionDefaultMeaning
--config PATH./pins-config.nixNix Pin declaration file
--pins PATH./pins.jsonPins File to read and write
--nixpkgs PATH_OR_FLAKE<nixpkgs>Nixpkgs path or flake reference to evaluate instead of <nixpkgs>
--system SYSTEMHost systemTarget Nix system for evaluation and Pin systems filtering (e.g. aarch64-linux)
--checker-jobs NHalf the CPU count, at least 1Concurrent version checks
--download-jobs N2Concurrent downloads
--hash-jobs NHalf the CPU count, at least 1Concurrent Nix evaluations and builds
--refresh-dependenciesfalseInclude transitive prerequisites when updating selected Pins
--refresh-sourcesfalseRecompute all Source hashes in the update selection, bypassing locked results and the hash cache
--github-api-base URLhttps://api.github.comGitHub API base URL
--gitlab-api-base URLhttps://gitlab.com/api/v4GitLab API v4 base URL
--gitea-api-base URLUnsetOptional Gitea/Forgejo API v1 base URL override for gitea Checkers
--oci-registry-base URLUnsetOptional OCI registry base URL override for oci Checkers
--http-timeout SECONDS30HTTP request timeout in seconds for built-in Checkers
--http-retries N3Maximum HTTP retries on transient Checker errors (0–10)
--crates-api-base URLhttps://crates.iocrates.io API base URL
--pypi-api-base URLhttps://pypi.orgPyPI API base URL
--npm-registry-base URLhttps://registry.npmjs.orgnpm Checker metadata registry; does not configure Fetchers
--github-token TOKENUnsetGitHub API credential (also reused for ghcr.io OCI registries)
--gitlab-token TOKENUnsetGitLab API credential (GITLAB_TOKEN fallback; also reused for registry.gitlab.com)
--gitea-token TOKENUnsetGitea/Forgejo API credential (GITEA_TOKEN fallback supported)
--oci-token TOKENUnsetOCI registry token or user:pass credential (overrides ~/.docker/config.json)

Global options can appear before or after the subcommand. Relative paths resolve from the current working directory. Each setting has a corresponding environment variable. --help shows variable names and default descriptions; see Runtime configuration for the full precedence rules.

nix-pins --config project/pins-config.nix update --pins project/pins.json

Selection

PIN is a configured name; you can provide several. --filter is a Rust regular expression applied to Pin names. --failed selects configured Pins with recorded failures in the Pins File. Names, regex matches, and --failed form a union. With none of them, all Pins are selected. Unknown explicit names, invalid regular expressions, and a --filter selection whose union matches nothing are errors. When --failed is given alone and no configured Pins have failures, the command succeeds without modifying the Pins File.

nix-pins update editor --filter '^language-'
nix-pins update --failed
nix-pins status --failed

Selection applies to Pins, not Sources or Packages. See Updating and selecting Pins for the full behavior.

Automation

Use exit codes to determine success instead of inferring it from TUI icons or output line counts. After a runtime failure, inspect status and failure records in the Pins File. Configuration files can execute external commands; run only trusted configurations.

There are currently no separate add, remove, or status --refresh commands. To add a Pin, edit the declaration (or start with nix-pins init) and run update. After removing a Pin, run a full update.