cmd2 is a powerful Python library for quickly building feature-rich and user-friendly interactive command-line applications. It extends Python's built-in `cmd` module, providing a comprehensive set of enhancements including robust tab completion, searchable command history, text and Python scripting, and advanced argument parsing with `argparse`. The library is actively maintained with a frequent release cadence, continuously improving its capabilities and user experience.
Verified import paths — ran on the pinned version, not inferred.
Commonly used for type hinting command arguments, especially when not using @with_argparser.
This minimal example demonstrates how to create a basic `cmd2` application by subclassing `cmd2.Cmd` and defining a `do_` method for a command. Running `cmdloop()` starts the interactive shell, and you can type `hello_world` or `quit` to exit.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.