CLI Command Parser
CLI Command Parser is a class-based CLI argument parser that defines parameters with descriptors. It provides the tools to quickly and easily get started with basic CLIs, and it scales well to support even very large and complex CLIs while remaining readable and easy to maintain.
- Some of the primary goals and key features of this project:
Minimal boilerplate code is necessary to define CLI parameters and access their parsed values
Typing support for CLI parameters that can be validated via type checkers
Subcommands can inherit common parameters so they don’t need to be repeated
Easy to handle common initialization tasks for all actions / subcommands once
Example Program
from cli_command_parser import Command, Option, main
class Hello(Command):
"""Simple greeting example"""
name = Option('-n', default='World', help='The person to say hello to')
count = Option('-c', type=int, default=1, help='Number of times to repeat the message')
def main(self):
for _ in range(self.count):
print(f'Hello {self.name}!')
if __name__ == '__main__':
main()
$ hello_world.py --name Bob -c 3
Hello Bob!
Hello Bob!
Hello Bob!
$ hello_world.py -h
usage: hello_world.py [--name NAME] [--count COUNT] [--help]
Simple greeting example
Optional arguments:
--name NAME, -n NAME The person to say hello to (default: 'World')
--count COUNT, -c COUNT Number of times to repeat the message (default: 1)
--help, -h Show this help message and exit
Installing CLI Command Parser
CLI Command Parser can be installed and updated via pip:
$ pip install -U cli-command-parser
There are no required dependencies. Support for formatting wide characters correctly in help text descriptions can be included by adding wcwidth to your project’s requirements, and/or by installing with optional dependencies:
$ pip install -U cli-command-parser[wcwidth]
Python Version Compatibility
Python versions 3.10 and above are currently supported. The last release of CLI Command Parser that supported 3.9 was 2025-09-27. Support for Python 3.9 officially ended on 2025-10-31.
Links
Documentation: https://dskrypa.github.io/cli_command_parser/
Example Scripts: https://github.com/dskrypa/cli_command_parser/tree/main/examples
PyPI Releases: https://pypi.org/project/cli-command-parser/
Source Code: https://github.com/dskrypa/cli_command_parser
Issue Tracker: https://github.com/dskrypa/cli_command_parser/issues
Metadata
Release files for cli-command-parser 2026.7.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cli_command_parser-2026.7.4.tar.gz | 144.9 kB | Without provenance | Details for cli_command_parser-2026.7.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cli_command_parser-2026.7.4-py3-none-any.whl | Python 3 | none | any | Details for cli_command_parser-2026.7.4-py3-none-any.whl |
Total release size: 316.9 kB
Release files / cli_command_parser-2026.7.4.tar.gz
| Download URL | cli_command_parser-2026.7.4.tar.gz |
|---|---|
| Size | 144.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6050e8e4b18faacb9020a4279739e561da2a2a2e06a22f930a7f0cd99b55f206
|
|
BLAKE2b-256 checksum How to use checksums |
4506f664557941c98eb1c54898ea46075d25f7e5f4e8839b6fa47f98640bf1b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / cli_command_parser-2026.7.4-py3-none-any.whl
| Download URL | cli_command_parser-2026.7.4-py3-none-any.whl |
|---|---|
| Size | 171.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c98651da44138a1b32a5306f54b08ad1e7366221d4160943ae3e5ef5f25f14d
|
|
BLAKE2b-256 checksum How to use checksums |
f5c517e78e696fecf33ccd7d8d40ffc610f54182a58afa2dcb9013b747bb018b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for cli-command-parser 2026.7.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.