Programming language: Go
License: MIT License
Tags: Command Line     Standard CLI    
Latest version: v1.7.37

cmdr alternatives and similar packages

Based on the "Standard CLI" category.
Alternatively, view cmdr alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of cmdr or a related project?

Add another 'Standard CLI' Package



Build Status Go GitHub tag (latest SemVer) GoDoc FOSSA Status go.dev Go Report Card codecov Coverage Status Mentioned in Awesome Go <!-- https://gowalker.org/github.com/hedzr/cmdr -->

cmdr is a POSIX/GNU style, command-line UI (CLI) Go library. It is a getopt-like parser of command-line options, be compatible with the getopt_long command line UI, which is an extension of the syntax recommended by POSIX.

There are couples of enhancements beyond the standard library flag.

There is a full Options Store (configurations) for your hierarchy configuration data too.

ee99d078e2f7 <!-- built by https://ezgif.com/ -->

To review the image frames, go surfing at https://github.com/hedzr/cmdr/issues/1#issuecomment-567779978

Table of Contents

<!-- Created by gh-md-toc -->

Youtube - 李宗盛2013最新單曲 山丘 官方完整版音檔 / Jonathan Lee - Hill CHT + ENU


The better choice is importing with go-modules enabled:

import "github.com/hedzr/cmdr"

See our extras:


  • docs (WIP):

  • v1.7.27

    • added: WithHelpScreenHooks, GetRemainArgs, ...
    • improved: WithPagerEnabled, InTesting, ...
    • fixed: missed initializing for logger-level in Option Store sometimes.
    • tests
  • v1.7.25

    • New feature: loading command definition from config file
    • fixed bugs
  • v1.7.23

    • A new feature: the builtin pluggable cmdr-addon/plugin. make build && bin/fluent --help && bin/fluent dx
    • added: WithPluginLocations(locations...), WithExtensionsLocations(locations...)
  • v1.7.21

  • v1.7.11

    • update: new log.Logger instance in log.GetLogger
    • fixed: ReadPassword in windows
  • v1.7.10

    • fixed: too much empty lines in help screen
  • v1.7.9

    • right align multi-lines desc string in help screen
    • added new envvars: HELP, NO_COLOR (HELP=1 app some sub cmd == app some sub cmd --help)
  • v1.7.8

    • tabStop in help screen will be autosize now
    • deprecated at next minor release (v1.8+): WithHelpTabStop()
    • deprecated at next minor release (v1.8+): plugins/daemon
    • BREAK: some two methods in the interface Painter has been changed.
  • v1.7.7

    • update deps to improve logging supports
    • deprecated: WithLogex(), as its replacement, WithLogx() has a better generic logging interface (hedzr/log.Logger)
  • v1.7.6:

    • using hedzr/log and remove other logging dependencies.
    • added WithLogx(logger): integrating with your logger (via log.Logger interface)
  • v1.7.5:

    • move some helper function to tool sub-package
  • For more information to refer to [CHANGELOG](./CHANGELOG)



Old README.md: [README.old.md](old/README.old.md)

For Developer

[For Developer](old/Developer.md)


  1. [short](./examples/short/README.md)
    simple codes with structured data style.

  2. [demo](./examples/demo/README.md)
    normal demo with external config files.

  3. [wget-demo](./examples/wget-demo/README.md)
    partial-covered for GNU wget.

  4. [fluent](./examples/fluent)
    demostrates how to define your command-ui with the fluent api style.

  5. [ffmain](./examples/ffmain)

a demo to show you how to migrate from go flag smoothly.

  1. cmdr-http2
    http2 server with daemon supports, graceful shutdown

  2. awesome-tool
    awesome-tool is a cli app that fetch the repo stars and generate a markdown summary, accordingly with most of awesome-xxx list in github (such as awesome-go).

See Also the examples index: [Examples.md](old/Examples.md) (zh-cn TODO: [Examples.zh-cn.md](old/Examples.zh-cn.md))



Feel free to issue me bug reports and fixes. Many thanks to all contributors.

Thanks to JODL

JODL (JetBrains OpenSource Development License) is good:

goland jetbrains



FOSSA Status

*Note that all licence references and agreements mentioned in the cmdr README section above are relevant to that project's source code only.