CLI
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
| Command | Behavior |
|---|---|
update | Check 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) |
status | Report existing results and failures for selected Pins without modifying them (--json outputs schema v1 JSON) |
check | Run 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 |
init | Scaffold 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 clean | Inspect entry count and disk usage of the local hash cache, or remove cached entries (--json supported) |
doctor | Diagnose nix, git, nixpkgs, configuration, pins.json, cache, and token readiness (--json supported) |
graph | Export cross-Pin dependencies as text, mermaid, or Graphviz dot |
completions <SHELL> | Print shell completion script for bash, zsh, fish, or nushell |
| No command | Same as status, selecting all Pins |
help, --help | Show help |
--version | Show the CLI version |
Global options
| Option | Default | Meaning |
|---|---|---|
--config PATH | ./pins-config.nix | Nix Pin declaration file |
--pins PATH | ./pins.json | Pins File to read and write |
--nixpkgs PATH_OR_FLAKE | <nixpkgs> | Nixpkgs path or flake reference to evaluate instead of <nixpkgs> |
--system SYSTEM | Host system | Target Nix system for evaluation and Pin systems filtering (e.g. aarch64-linux) |
--checker-jobs N | Half the CPU count, at least 1 | Concurrent version checks |
--download-jobs N | 2 | Concurrent downloads |
--hash-jobs N | Half the CPU count, at least 1 | Concurrent Nix evaluations and builds |
--refresh-dependencies | false | Include transitive prerequisites when updating selected Pins |
--refresh-sources | false | Recompute all Source hashes in the update selection, bypassing locked results and the hash cache |
--github-api-base URL | https://api.github.com | GitHub API base URL |
--gitlab-api-base URL | https://gitlab.com/api/v4 | GitLab API v4 base URL |
--gitea-api-base URL | Unset | Optional Gitea/Forgejo API v1 base URL override for gitea Checkers |
--oci-registry-base URL | Unset | Optional OCI registry base URL override for oci Checkers |
--http-timeout SECONDS | 30 | HTTP request timeout in seconds for built-in Checkers |
--http-retries N | 3 | Maximum HTTP retries on transient Checker errors (0–10) |
--crates-api-base URL | https://crates.io | crates.io API base URL |
--pypi-api-base URL | https://pypi.org | PyPI API base URL |
--npm-registry-base URL | https://registry.npmjs.org | npm Checker metadata registry; does not configure Fetchers |
--github-token TOKEN | Unset | GitHub API credential (also reused for ghcr.io OCI registries) |
--gitlab-token TOKEN | Unset | GitLab API credential (GITLAB_TOKEN fallback; also reused for registry.gitlab.com) |
--gitea-token TOKEN | Unset | Gitea/Forgejo API credential (GITEA_TOKEN fallback supported) |
--oci-token TOKEN | Unset | OCI 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.