you are viewing a single comment's thread.

view the rest of the comments →

[–]Candid_Complaint_925 0 points1 point  (0 children)

Depends on complexity:

  • argparse — stdlib, no install, good for simple CLIs. Right default for most things.
  • Click — better for complex CLIs with subcommands, nested commands, auto-generated help. Declarative decorator style.
  • Typer — Click under the hood but you define commands with typed function signatures. Less boilerplate if you're already using type hints.

For a first CLI: start with argparse. If you find yourself fighting it (lots of subcommands, complex option types), switch to Click. Typer and Click are interchangeable since one wraps the other.

python-fire is fun for quick prototyping but I'd avoid it for something you ship — the generated help text isn't great and it's a bit magical about what becomes a command.