A POSIX-compliant Go library for parsing command-line arguments and managing hierarchical configurations.
Cmdr is a Go library for building command-line interface (CLI) applications with a focus on parsing arguments and managing configurations. It provides a robust foundation for developers to create CLI tools with features like subcommands, flag parsing, and integration with external configuration sources. The library emphasizes clean, maintainable code and flexibility, allowing developers to choose the command-building approach that best fits their project while ensuring stability and performance.
Go developers building CLI tools who need advanced features like hierarchical configuration management, shell autocompletion, and manpage generation. It is particularly suited for those creating complex CLI applications with multiple subcommands and requiring integration with various configuration sources.
Developers choose Cmdr over alternatives for its POSIX-compliant parser with support for compact flag combinations, flexible command-building styles (traditional stream calls, concise builders, struct-based definitions), and seamless integration with hedzr/store for hierarchical configuration management. Its unique selling points include smart help with typo suggestions using Jaro-Winkler distance and automatic generation of shell autocompletion scripts and manpages.
POSIX-compliant command-line UI (CLI) parser and Hierarchical-configuration operations
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports compact flag combinations like `-c1b23zv` and handles sticky values, offering flexibility for complex CLI syntax as described in the README.
Integrates with hedzr/store for high-performance KV storage and loading from multiple sources like environment variables, config files, Consul, and etcd, with automatic type conversion.
Provides three styles—traditional stream calls, concise builders, and struct-based definitions via tags—allowing developers to choose the approach that best fits their codebase.
Auto-generates help screens and uses Jaro-Winkler distance to suggest corrections for typos in commands and flags, improving user experience.
Generates shell autocompletion scripts for zsh, bash, fish, and PowerShell, and creates manual pages for deployment, enhancing documentation and usability.
Relies on several hedzr libraries (store, logg, evendeep, is), which can increase project complexity, bloat, and potential versioning issues compared to minimalist alternatives.
With multiple command-building paradigms and integrated configuration management, newcomers may find it overwhelming to grasp all options and best practices quickly.
The README mentions a TODO list and historical breaking changes from v1 to v2, indicating some features may be incomplete or subject to instability in future updates.