github.com/spf13/cobra

Cobra

Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.

95

Decision Signals

Health score 95/100, confidence 100/100.

Excellent
Maintenance 88
Adoption 100
Security 92
Maturity 100
Developer DX 97
Confidence 100

Install

go get github.com/spf13/cobra

Package Data

updated May 31, 2026
Latest versionv1.10.2
Imported by195.9K packages
Stars44.0K
Forks3.2K
Last activity1 months ago
Latest releasev1.10.2 (5 months ago)
LicenseApache-2.0
Known vuln records0

API Surface

234 symbols
SymbolKindSynopsis
Command Type type Command struct{ ... }
Command.AddCommand Method func (c *Command) AddCommand(cmds ...*Command)
Command.AddGroup Method func (c *Command) AddGroup(groups ...*Group)
Command.Aliases Field Aliases []string
Command.AllChildCommandsHaveGroup Method func (c *Command) AllChildCommandsHaveGroup() bool
Command.Annotations Field Annotations map[string]string
Command.ArgAliases Field ArgAliases []string
Command.Args Field Args PositionalArgs
Command.ArgsLenAtDash Method func (c *Command) ArgsLenAtDash() int
Command.BashCompletionFunction Field BashCompletionFunction string
Command.CalledAs Method func (c *Command) CalledAs() string
Command.CommandPath Method func (c *Command) CommandPath() string

Similar Packages

Go CLI Frameworks

#1 urfave/cli

Simple, fast, and fun package for building command line apps in Go.

Go CLI Frameworks 24.1K stars 23.1K imported-by 65% confidence
94

#2 dasel

Unified querying, transformation, and modification of JSON, TOML, YAML, XML, INI, HCL, KDL and CSV.

Go CLI Frameworks 8.0K stars 0 imported-by 45% confidence
85

#3 kong

Package kong aims to support arbitrarily complex command-line structures with as little developer effort as possible.

Go CLI Frameworks 0 stars 3.1K imported-by 80% confidence
77

#4 go-arg

Package arg parses command line arguments using the fields from a struct.

Go CLI Frameworks 0 stars 1.7K imported-by 80% confidence
70

#5 flash-flags

Package flashflags provides ultra-fast, zero-dependency, lock-free command-line flag parsing for Go.

Go CLI Frameworks 0 stars 3 imported-by 80% confidence
67