Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. cmdr

cmdr

Apache-2.0Gov2.2.3

A POSIX-compliant Go library for parsing command-line arguments and managing hierarchical configurations.

Visit WebsiteGitHubGitHub
141 stars10 forks0 contributors

What is cmdr?

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.

Target Audience

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.

Value Proposition

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.

Overview

POSIX-compliant command-line UI (CLI) parser and Hierarchical-configuration operations

Use Cases

Best For

  • Building CLI applications with complex subcommand hierarchies and flag parsing requirements.
  • Developing Go-based CLI tools that need integration with multiple configuration sources like environment variables, config files, Consul, or etcd.
  • Creating CLI applications that require automatic shell autocompletion for zsh, bash, fish, or PowerShell.
  • Generating manual pages (manpages) for deployment to enhance end-user documentation.
  • Implementing CLI tools with flexible command definition styles, including struct-based definitions via tags for cleaner code organization.
  • Building CLI applications that need smart typo suggestions for commands and flags using Jaro-Winkler distance.

Not Ideal For

  • Developers building simple, single-command CLI tools without subcommands or advanced configuration needs
  • Projects prioritizing minimal dependencies and lightweight libraries, as cmdr relies on multiple hedzr modules
  • Teams already standardized on Cobra or similar frameworks who value extensive community plugins and tooling

Pros & Cons

Pros

POSIX-Compliant Parsing

Supports compact flag combinations like `-c1b23zv` and handles sticky values, offering flexibility for complex CLI syntax as described in the README.

Hierarchical Configuration Integration

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.

Flexible Command Building

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.

Smart Help and Suggestions

Auto-generates help screens and uses Jaro-Winkler distance to suggest corrections for typos in commands and flags, improving user experience.

Autocompletion and Manpage Generation

Generates shell autocompletion scripts for zsh, bash, fish, and PowerShell, and creates manual pages for deployment, enhancing documentation and usability.

Cons

Dependency Heavy

Relies on several hedzr libraries (store, logg, evendeep, is), which can increase project complexity, bloat, and potential versioning issues compared to minimalist alternatives.

Steep Learning Curve

With multiple command-building paradigms and integrated configuration management, newcomers may find it overwhelming to grasp all options and best practices quickly.

API and Feature Maturity

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.

Frequently Asked Questions

Quick Stats

Stars141
Forks10
Contributors0
Open Issues0
Last commit16 days ago
CreatedSince 2019

Tags

#commandlineparser#posix-compliant#command-line-interface#cli-framework#go-library#command-line-parser#cli-parser#golang#cli#commandline#commandline-interface#configuration-management#command-line#getopt#shell-autocompletion

Built With

G
Go

Links & Resources

Website

Included in

Go169.1k
Auto-fetched 18 hours ago

Related Projects

cobracobra

A Commander for modern Go CLI interactions

Stars44,304
Forks3,175
Last commit13 days ago
clicli

A declarative, simple, fast, and fun package for building command line tools in Go

Stars24,175
Forks1,802
Last commit3 days ago
elvishelvish

Powerful scripting language & versatile interactive shell

Stars6,340
Forks326
Last commit3 months ago
kingpinkingpin

CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser

Stars3,566
Forks280
Last commit16 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub