Skip to content

pog 🤯

Nix-Powered CLI tools

Create feature-rich CLI tools with Nix and bash - complete with flags, documentation, and more

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 bash 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 = ''echo "dev staging prod"'';        # used for tab completion
    }
  ];
  script = helpers: ''
    green "Deploying to $environment in $region..."
    ${helpers.spinner {
      command = "kubectl apply -f ./manifests/";
      title = "Deploying...";
    }}
  '';
}