Skip to content

CLI Reference

Complete documentation for all nxv commands and options.

Global Options

FlagDescription
--db-path <DB_PATH>Path to the index database (default: platform data dir)
-v, --verbose...Enable verbose output (-v info, -vv debug)
-q, --quietSuppress all output except errors
--no-colorDisable colored output (also: NO_COLOR env)
--api-timeout <SECS>API request timeout in seconds (default: 30)
-h, --helpPrint help
-V, --versionPrint version

Commands

Search for packages by name, version, or description.

bash
nxv search <PACKAGE> [VERSION]

Options:

FlagDescription
-V, --version <VERSION>Filter by version (alternative to positional)
-e, --exactExact name match only
--descSearch in descriptions (full-text)
--license <LICENSE>Filter by license
--show-platformsShow platforms column
--sort <ORDER>Sort order: date, version, name
-r, --reverseReverse sort order
-n, --limit <N>Maximum results (default: 50, 0=unlimited)
--fullShow all commits (no deduplication)
--asciiASCII table borders
-f, --format <FORMAT>Output format: table, json, plain

Examples:

bash
# Basic search
nxv search python

# Find specific version
nxv search python 3.11.4

# Search descriptions
nxv search "web server" --desc

# JSON output for scripts
nxv search python --format json

# Sort by date, newest first
nxv search python --sort date

info

Show detailed information about a specific package version.

bash
nxv info <package> [version] [options]

Options:

FlagDescription
-V, --version <VERSION>Specific version (alternative to positional)
-f, --format <FORMAT>Output format: table, json, plain

Examples:

bash
# Latest version info
nxv info python311

# Specific version
nxv info python311 3.11.4

history

Show version history for a package.

bash
nxv history <PACKAGE> [VERSION]

Options:

FlagDescription
-f, --format <FORMAT>Output format: table, json, plain
--fullShow full details
--asciiASCII table borders

Examples:

bash
# Full history
nxv history python311

update

Refresh the package index, then check for a newer nxv binary and update it (or print a hint for managed installs).

bash
nxv update [options]

Options:

FlagDescription
-f, --forceForce full re-download of the index
--skip-verifySkip manifest signature verification
--public-key <KEY>Custom public key for verification
--no-self-updateSkip the binary self-update check; only refresh the index

--no-self-update also honours the NXV_NO_SELF_UPDATE environment variable, which is useful for CI or systemd timer units that should only refresh the index.

Binary-update behaviour by install method:

Install methodAction
LocalDownloads, verifies SHA-256, atomically swaps the binary
NixLeaves binary alone; prints nix profile upgrade nxv / flake hint
cargo installLeaves binary alone; prints cargo install --locked nxv
HomebrewLeaves binary alone; prints brew upgrade nxv (or reinstall)

Set GITHUB_TOKEN to avoid unauthenticated rate limits when calling the GitHub API. If GitHub rejects the token (401 — e.g. a stale token exported by a dev shell), the check is retried without it. If the binary check fails (e.g., network or rate limit), nxv update prints a warning but still reports the index update as successful.

Examples:

bash
# Refresh the index and update the binary (or print an upgrade hint)
nxv update

# Just refresh the index — don't touch the binary
nxv update --no-self-update

# Force full re-download of the index
nxv update --force

serve

Start the HTTP API server.

bash
nxv serve [options]

Options:

FlagDescription
-H, --host <HOST>Host address (default: 127.0.0.1)
-p, --port <PORT>Listen port (default: 8080)
--corsEnable CORS for all origins
--cors-origins <ORIGINS>Specific CORS origins
--rate-limit <N>Rate limiting per IP (req/sec)
--rate-limit-burst <N>Burst size for rate limiting

Examples:

bash
# Default (localhost:8080)
nxv serve

# Public server with CORS
nxv serve --host 0.0.0.0 --port 3000 --cors

stats

Show index statistics and metadata.

bash
nxv stats

index

Build the index from nixpkgs channel-release snapshots on releases.nixos.org. Downloads and streams packages.json.br for each release — no nixpkgs checkout and no Nix evaluation needed, except for the two flags noted below that require nix.

Requires the indexer feature (nxv-indexer or cargo build --features indexer).

bash
nxv index [options]

Options:

FlagDescription
--channel <CHANNELS>Channels to ingest (repeatable or comma-separated; default: nixpkgs-unstable + nixos-unstable-small)
--since <DATE>Only ingest releases dated on/after this date (YYYY-MM-DD)
--until <DATE>Only ingest releases dated on/before this date (YYYY-MM-DD)
--jobs <N>Parallel snapshot download/parse workers
--strictTreat monitor warnings (count floors, sentinels, head lag) as fatal
--report <PATH>Write the end-of-run coverage report as JSON to this path
--retry-failedRetry releases that were parked as failed/skipped
--backfill-evalsAlso ingest the pre-2020 era by evaluating nixexprs.tar.xz with nix-env (requires nix)
--head-evalEvaluate nixpkgs master HEAD when channel observations lag behind (requires nix)
--fullRe-plan every known release instead of only new ones
--max-releases <N>Limit the number of releases ingested this run (for testing)

dedupe

Collapse duplicate (attribute_path, version) rows in the local index. Repairs databases bloated by the pre-0.1.5 incremental indexer bug. Keeps one row per unique pair with the earliest first_commit_* and the latest last_commit_* across the duplicates, then VACUUMs.

Requires the indexer feature (nxv-indexer or cargo build --features indexer).

bash
nxv dedupe [options]

Options:

FlagDescription
--dry-runReport what would change without modifying the database
--no-vacuumSkip the trailing VACUUM (faster, DB file won't shrink)

publish

Generate publishable index artifacts (compressed database, bloom filter, and manifest) for distribution.

Requires the indexer feature.

bash
nxv publish [options]

Options:

FlagDescription
-o, --output <DIR>Output directory for generated artifacts (default: ./publish)
--url-prefix <URL>Base URL prefix for manifest URLs
--signSign the manifest with a minisign secret key
--secret-key <KEY>Secret key for signing (file path or raw key; also NXV_SECRET_KEY env)
--min-version <N>Minimum schema version required to read this index (default: the schema version)

keygen

Generate a new minisign keypair for signing manifests.

Requires the indexer feature.

bash
nxv keygen [options]

Options:

FlagDescription
-s, --secret-key <PATH>Output path for the secret key file (default: ./nxv.key)
-p, --public-key <PATH>Output path for the public key file (default: ./nxv.pub)
-c, --comment <COMMENT>Comment to embed in the key files (default: nxv signing key)
-f, --forceOverwrite existing key files if they exist

completions

Generate shell completion scripts.

bash
nxv completions <shell>

Shells: bash, zsh, fish, powershell, elvish

Examples:

bash
# Bash
nxv completions bash > ~/.local/share/bash-completion/completions/nxv

# Zsh
nxv completions zsh > ~/.zfunc/_nxv

# Fish
nxv completions fish > ~/.config/fish/completions/nxv.fish

skill

Generate and install the nxv agent skill (a SKILL.md following the Agent Skills standard) so AI coding agents can drive nxv. See the Agent Skill guide for details.

bash
nxv skill <list|install|uninstall|show>

Subcommands:

SubcommandDescription
listList supported agents, skill paths, and install status
install [AGENTS...]Install the skill (user-wide by default)
uninstall [AGENTS...]Remove installed skills
showPrint the generated SKILL.md to stdout

Agents: claude, codex, pi, openclaw, copilot, cursor, gemini, amp, goose, agents (the generic cross-agent .agents/skills directory)

Install/uninstall options:

FlagDescription
--projectUse project-level skill directories under the current dir
--dir <PATH>Project directory to operate on (implies --project)
--allInstall for all supported agents (install only)

List options:

FlagDescription
--asciiUse ASCII table borders instead of Unicode

Examples:

bash
# Install user-wide for every agent detected on this machine
nxv skill install

# Install into the current project (.claude/skills + .agents/skills)
nxv skill install --project

# Install for specific agents
nxv skill install claude codex

# See where the skill is (or would be) installed
nxv skill list

Output Formats

table (default)

Human-readable table with colors:

Package          Version   Commit    Date         Description
python311        3.11.4    abc1234   2023-06-15   High-level dynamically-typed programming language
python311        3.11.3    def5678   2023-04-05   High-level dynamically-typed programming language

json

Machine-readable JSON:

json
[
  {
    "attribute_path": "python311",
    "version": "3.11.4",
    "first_commit_date": "2023-06-15T00:00:00Z",
    "first_commit_hash": "abc1234..."
  }
]

plain

Tab-separated values for scripts (with a header row):

PACKAGE	VERSION	COMMIT	DATE	DESCRIPTION
python311	3.11.4	abc1234	2023-06-15	High-level dynamically-typed programming language
python311	3.11.3	def5678	2023-04-05	High-level dynamically-typed programming language

Released under the MIT License.