The Hitchhiker's Guide to CLIs in Python
summary
Shows how terminal ancestry and live modes cause quirks (canonical vs raw input, echo off, carriage return behavior) and uses stty -a shows modes examples to prove it. Implements a small git-like CLI with subcommands using sys.argv, getopt/argparse, docopt and then Click with decorator-based commands, demonstrates progress bars, colored output, editor prompts, config in XDG dirs and uses packaged to PyPI with twine to publish — each tool and step actually runs and the Click-based CLI works as shown.
AI-written summary · about
chapters (26)
- 0:00Intro
- 0:17In the beginning ...
- 2:21teletype
- 6:26Signals
- 6:41Control characters
- 7:03Streams
- 7:32stdout and stderr
- 8:07Command-line interfaces
- 9:13Options
- 10:17Standards
- 10:33POSIX
- 10:45XDG base directory specification
- 11:33Standard library
- 11:52getopt
- 12:23optparse
- 12:34PEP 389
- 14:04Python Package Index
- 17:39Progress bars
- 18:20Application folders
- 19:14Paged output
- 19:45Colored text
- 20:42Launching editors
- 21:19User prompts
- 22:17Testing click code
- 22:38Packaging the CLI
- 23:14User experience
related talks
23mThe Hitchhiker's Guide to CLIs in Python
29mBuilding Nice Command Line Interfaces — A Look Beyond the stdlib
37mLet's Make Better Command Line Applications
33mUpgrading Python CLIs From Scripts to Interactive Tools
02h 28mBuilding human-first and machine-friendly CLI applications
25mReinventing the CLI with Go
27mBack to the Future: Modernizing CLIs Using Go
16mBuilding an interactive CLI app in Elixir
