← All commands

npkg

Manage Nix profiles; helper commands support --help

Package Updates

Usage reference

Try an example

npkg add bat

Syntax

npkg <command> [args]
Availability
Available when nix is installed
Dependencies
nix; jq and fzf 0.68.0+ for optional workflows

Some subcommands change stored data or packages. Check the selected operation before running.

Features & Examples

Examples appear only where they add useful detail.

add [pkg ...]

Add package(s); with no args opens an fzf pickerAlso known as: install [pkg ...]

Example
npkg add bat
find [--] [query ...]

Fuzzy-pick nixpkgs attributes and add selections

Example
npkg find nvim
search <query>

Run a plain nixpkgs search with descriptions

Example
npkg search ripgrep
list

List packages in the current profile

remove [pkg ...]

Remove package(s); with no args opens an fzf picker

outdated

Compare installed and evaluated Nix output identities

refresh

Rebuild the cached nixpkgs attribute index

upgrade [pkg ...]

Upgrade all packages or only the named ones

help

Show this help text

Notes

  • Bare install names become nixpkgs#<name>; any option passes all add arguments to nix unchanged
  • npkg find searches a cached list of nixpkgs attribute names
  • npkg refresh and outdated need jq
  • Interactive add/find/remove needs jq and fzf 0.68.0+
  • refresh/outdated/check/diff accept no operands; -h/--help shows usage
  • find/pick/fzf recognizes -h/--help before --; after -- they are query text
  • Native add/remove/list/search/upgrade arguments pass through as documented
  • Advanced nix flags can be passed through by calling nix directly

In the Guide