@schlink If you are sticking to the standard library, argparse.
If you are willing to take a dependency, I like click: https://click.palletsprojects.com/en/7.x/
I have never used it, but I've also heard good things about typer, which is basically "click, but based on the type hints for your functions": https://github.com/tiangolo/typer
Click is particularly helpful if you want to have subcommands, e.g. "myprogram add" and "myprogram remove".