spf13/cobra
A Commander for modern Go CLI interactions observed · 2026-08-28
Health v2 · maintenance only
77/100
- Activity 91
- Release rhythm 47
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 47.0
- age_days: 4747
- days_rel: 273
- days_push: 54
- n_releases_24m: 5
Adoption not part of the score
44514 stars · 3221 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Cobra is a Go library for building powerful, modern command-line applications with nested subcommands, POSIX-compliant flags, and automatic help generation. It is the de facto standard CLI framework in the Go ecosystem, powering Kubernetes, Docker, Hugo, and GitHub CLI.
Use cases
- build a cli tool in go with subcommands
- add posix-compliant flag parsing to a go app
- generate shell autocomplete for bash zsh fish powershell
- generate man pages for a command-line tool
- scaffold a new go cli project structure
- add command aliases and intelligent typo suggestions to a cli
- integrate cli flags with viper configuration management
When to choose
- you are writing a multi-command CLI in Go similar to git or kubectl
- you want automatic help text, shell completion, and man page generation
- you need battle-tested, widely adopted tooling with a large ecosystem
- you want optional viper integration for 12-factor configuration
When to avoid
- you are building a CLI in a language other than Go
- you need only a simple single-command script with minimal dependencies
- you want a declarative or annotation-based CLI framework rather than imperative command structs
Facets
library · maturity stable
cli developer-tools middleware developer-tools apis go cross-platform cli cli-framework subcommands flag-parsing shell-completion cobra-cli posix-flags man-pages viper-integration command-line
10 sources
- readme: https://github.com/spf13/cobra · fetched 2026-08-28 · 242afefd8aa2
- homepage: https://cobra.dev · fetched 2026-08-29 · ce890b4a9952
- site_page: https://cobra.dev/docs/how-to-guides/context-and-tracing · fetched 2026-08-29 · 6e16c9c50a4f
- site_page: https://cobra.dev/docs/explanations/enterprise-guide · fetched 2026-08-29 · 94981417d847
- site_page: https://cobra.dev/docs/how-to-guides/clis-for-llms · fetched 2026-08-29 · 240013d38009
- site_page: https://cobra.dev/docs · fetched 2026-08-29 · 94d2c55406b1
- site_page: https://cobra.dev/docs/tutorials/first-cli · fetched 2026-08-29 · 48bb1c115c8b
- site_page: https://cobra.dev/docs/examples · fetched 2026-08-29 · 1be70ee3c531
- site_page: https://cobra.dev/docs/tutorials/getting-started · fetched 2026-08-29 · b7df3d662190
- site_page: https://cobra.dev/docs/how-to-guides · fetched 2026-08-29 · 51a1d455f3b6
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| spf13/cobra | main | 77 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem