Skip to content

The Nix CLI

The (new) Nix CLI is surprisingly well laid out and well documented to boot.

Generally, nix is organized into a series of subcommands, all of which are listed if you run nix --help.

Some subcommands have subcommands of their own, such as nix flake, to see these, run nix flake --help.

Finally, each command shows a complete help page if you pass it --help. For instance, nix flake init has no subcommands of its own, so nix flake init --help describes what the flake init command does and the arguments you can pass to it.

The same documentation is available as man pages, so man nix gives the same information as nix --help (if somewhat differently formatted). As man nix's output hints, you can find the man pages for various subcommands by running man nix3-<command>. E.g. man nix3-run (nix run) or man nix3-flake-init (nix flake init).