How-to guides
How-to guides are task-oriented: each one shows how to solve a specific problem. They assume you already know the basics — if not, start with the tutorial.
- Add options — string and boolean flags, shorthands, defaults, and optional options.
- Add arguments — positional arguments and how they map into
args. - Add subcommands — nest commands to any depth.
- Set a default command — run a command when none is given.
- Share global options — options inherited by subcommands.
- Generate shell completion — ship a bash completion script.
- Compile a standalone binary — turn your CLI into a single executable with Bun.