Skip to content

pog 🤯

Nix-Powered CLI tools

Declare complete Bash CLIs in Nix, with rich parsing, portable outputs, and native completion across shells

Define once, choose how to ship ​

A normal pog package can also produce three opt-in, single-file outputs:

OutputDependency modelGood fit
toHostScriptUses commands already installed on the hostBootstrap scripts and managed fleets
toArxCarries the Nix closure inside an experimental Linux bundleInternal tools that need exact Nix dependencies
toAppImageCarries the Nix closure inside an AppImageDistributing a Linux CLI as one familiar artifact

The normal Nix package stays unchanged until one of these outputs is requested. Each format uses the same flags, commands, help, runtime inputs, and script definition.

See the portable outputs guide →

Quick Example ​

nix
pog {
  name = "deploy";                                     # derivation/script name
  description = "Deploy application to cloud";         # used in the help doc
  flags = [
    pog._.flags.aws.region                             # a flag with shell completion, included in pog
    {
      name = "environment";
      short = "e";                                     # defaults to the first character of the name
      description = "deployment environment";          # used in the help doc
      required = true;                                 # forces the user to specify, or prompts for it
      completion = [ "dev" "staging" "prod" ];       # shell-neutral tab completion
    }
  ];
  script = helpers: ''
    green "Deploying to $environment in $region..."
    ${helpers.spinner {
      command = "kubectl apply -f ./manifests/";
      title = "Deploying...";
    }}
  '';
}