cob

github.com/spf13/cobra

go get github.com/spf13/cobra

386 Versions

v1.3.0

1 year ago
v1.3.0 - The Fall 2021 release 🍁 Completion fixes & enhancements 💇🏼

In v1.2.0, we introduced a new model for completions. Thanks to everyone for trying it, giving feedback, and providing numerous fixes! Continue to work with the new model as the old one (as noted in code comments) will be deprecated in a coming release.

  • DisableFlagParsing now triggers custom completions for flag names #1161
  • Fixed unbound variables in bash completions causing edge case errors #1321
  • help completion formatting improvements & fixes #1444
  • All completions now follow the help example: short desc are now capitalized and removes extra spacing from long description #1455
  • Typo fixes in bash & zsh completions #1459
  • Fixed mixed tab/spaces indentation in completion scripts. Now just 4 spaces #1473
  • Support for different bash completion options. Bash completions v2 supports descriptions and requires descriptions to be removed for menu-complete, menu-complete-backward and insert-completions. These descriptions are now purposefully removed in support of this model. #1509
  • Fix for invalid shell completions when using ~/.cobra.yaml. Log message Using config file: ~/.cobra.yaml now printed to stderr #1510
  • Removes unnecessary trailing spaces from completion command descriptions #1520
  • Option to hid default completion command #1541
  • Remove __complete command for programs without subcommands #1563
Generator changes ⚙️

Thanks to @spf13 for providing a number of changes to the Cobra generator tool, streamlining it for new users!

  • The Cobra generator now won't automatically include Viper and cleans up a number of unused imports when not using Viper.
  • The Cobra generator's default license is now none
  • The Cobra generator now works with Go modules
  • Documentation to reflect these changes
New Features ⭐
  • License can be specified by their SPDX identifiers #1159
  • MatchAll allows combining several PositionalArgs to work in concert. This now allows for enabling composing PositionalArgs #896
Bug Fixes 🐛
  • Fixed multiple error message from cobra init boilerplates #1463 #1552 #1557
Testing 👀
  • Now testing golang 1.16.x and 1.17.x in CI #1425
  • Fix for running diff test to ignore CR for windows #949
  • Added helper functions and reduced code reproduction in args_test #1426
  • Now using official golangci-lint github action #1477
Security 🔏 Documentation 📝
  • Multiple projects added to the projects_using_cobra.md file: #1377 #1501 #1454
  • Removed ToC from main readme file as it is now automagically displayed by GitHub #1429
  • Documentation correct for when the --author flag is specified #1009
  • shell_completions.md has an easier to use snippet for copying and pasting shell completions #1372
Other 💭
  • Bump version of cpuguy83/go-md2man to v2.0.1 #1460
  • Removed lesser typo from the GPL-2.0 license #880
  • Fixed spelling errors #1514

Thank you to all our amazing contributors ⭐🐍🚀


v0.0.0-20151119133415-6c0cb34745aa

1 year ago

v1.2.2-0.20211209214727-19c9c7438498

1 year ago

v1.2.2-0.20211208185637-01e05b8ea13c

1 year ago

v1.2.2-0.20211207232406-36bff0a4d541

1 year ago

v1.2.2-0.20211207224648-d298d79e6a8b

1 year ago

v0.0.0-20191223205140-447f182a9da8

1 year ago

v0.0.0-20211116222018-9e1d6f1c2aa8

1 year ago

v1.2.2-0.20211116222018-9e1d6f1c2aa8

1 year ago

v1.2.2-0.20211115202611-3c84bf87042f

1 year ago

v1.2.2-0.20211115203316-78969f9c816b

1 year ago

v1.2.2-0.20211115203940-442031e4ff69

1 year ago

v1.2.2-0.20211103193651-bfacc59f62c6

1 year ago

v1.2.0

1 year ago
🌠 v1.2.0 - The completions release

Welcome to v1.2.0 of Cobra! This release focuses on code completions, several critical bug fixes, some documentation updates, and security bumps. Upgrading should be simple but note please take note of the introduction of completions V2 and their default use. The v1 completions library is still available, but will be deprecated in the future. Please open an issue with any problems!


New Features
  • Automatically adds completion command for shell completions. If a completion command is already provided, uses that instead. This will automatically provide shell completions for bash, zsh, fish, and PowerShell https://github.com/spf13/cobra/pull/1192
    • Users can configure the command auto creation:
      • disable the creation of the completion command
      • disable completion descriptions
      • disable the --no-descriptions flag for "always on" completion descriptions
  • Introduction of bash completions V2, a uniform completion approach which include completion descriptions. The V1 bash completions are still available and will be deprecated in a latter release - https://github.com/spf13/cobra/pull/1146
    • Note that projects providing completion through a different command name (say a command named "complete") will continue to use v1 for their own command but will also provide cobra's implicit "completion" command which will use v2, unless of course, these projects take the time to disable the default "completion" command as noted above.
  • Commands now support context being passed to completions - https://github.com/spf13/cobra/pull/1265
  • Removed dependency onmitchellh/go-homedir in favor of core Go os.UserHomeDir() - https://github.com/spf13/cobra/commit/8eaca5f0f49ad747a0722d39dca7a75c34abd21a
Bug Fixes Testing Security Other

Thank you to _all our amazing contributors 🐍🚀_


v1.2.1

1 year ago
Bug fixes

v1.2.2-0.20211102151014-f09e9476376b

1 year ago

v1.2.2-0.20211101190133-d2c0cb310d52

1 year ago

v1.2.1-0.20210702152547-de187e874d1c

1 year ago

v0.0.0-20200719220246-c6fe2d4df810

1 year ago

v0.0.7

1 year ago

Bug fix to restore previous exit behavior when a command is not runnable.

Issue Ref: #1056 Bug Introduced: #922 Affected Releases: 0.0.6


v0.0.6

1 year ago

v1.1.0

1 year ago
Notable Changes
  • Extend Go completions and revamp zsh comp (#1070)
  • Fix man page doc generation - no auto generated tag when cmd.DisableAutoGenTag = true (#1104)
  • Add completion for help command (#1136)
  • Complete subcommands when TraverseChildren is set (#1171)
  • Fix stderr printing functions (#894)
  • fix: fish output redirection (#1247)

v0.0.2

1 year ago

Tagged release for package managers, as requested in #259.


v1.2.2-0.20211004205808-c1973d31bfd7

1 year ago

v0.0.4

1 year ago

As requested in #259 and #857.

Changes: https://github.com/spf13/cobra/compare/v0.0.3...v0.0.4


v0.0.3

1 year ago

Tagged release for package managers, as requested in #693.


v1.1.2

1 year ago
Notable Changes
  • Bump license year to 2021 in golden files (#1309) @Bowbaq
  • Enhance PowerShell completion with custom comp (#1208) @Luap99
  • Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670
  • Documentation readability improvements (#1228 etc.) @zaataylor etc.
  • Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor

v1.1.3

1 year ago
  • Fix: release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility

v0.0.5

1 year ago

v0.0.1

1 year ago

v1.0.0

1 year ago
v1.0.0

Announcing v1.0.0 of Cobra. 🎉

Notable Changes
  • Fish completion (including support for Go custom completion) @marckhouzam
  • API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam
  • Remove/replace SetOutput on Command - deprecated @jpmcb
  • add support for autolabel stale PR @xchapter7x
  • Add Labeler Actions @xchapter7x
  • Custom completions coded in Go (instead of Bash) @marckhouzam
  • Partial Revert of #922 @jharshman
  • Add Makefile to project @jharshman
  • Correct documentation for InOrStdin @desponda
  • Apply formatting to templates @jharshman
  • Revert change so help is printed on stdout again @marckhouzam
  • Update md2man to v2.0.0 @pdf
  • update viper to v1.4.0 @umarcor
  • Update cmd/root.go example in README.md @jharshman

v1.1.1

1 year ago

v0.0.0-20150319192937-384c059f4b9f

1 year ago

v1.2.2-0.20210826031853-4fd30b69ee2b

1 year ago

v1.1.3-0.20210503162530-7223a997c8a0

1 year ago

v1.2.2-0.20210805170825-2a5277810f24

1 year ago

v1.2.2-0.20210802141925-56060d19f885

1 year ago

v1.2.1-0.20210702150158-31a1f21b87f1

1 year ago

v0.0.0-20210210194109-8380ddd3132b

1 year ago

v1.1.3-0.20210701154930-07861c800d07

1 year ago

v1.1.3-0.20210630214930-3c8a19ecd384

1 year ago

v1.1.3-0.20210616015213-9a432671fd84

1 year ago

v0.0.0-20201204193411-7df62f7668c7

1 year ago

v1.1.2-0.20210201194433-1135bdecebe9

1 year ago

v1.1.3-0.20210503165400-95d23d24ff0c

2 years ago

v0.0.0-20151216150201-ea3bf167cfab

2 years ago

v1.1.3-0.20210510231933-4590150168e9

2 years ago

v1.1.3-0.20210215174701-b312f0a8ef6f

2 years ago

v1.1.3-0.20210503180001-c2e21bdc104f

2 years ago

v0.0.2-0.20171201213716-b1ec2ce1ad4e

2 years ago

v1.1.3-0.20210218152603-eb3b6397b1b5

2 years ago

v0.0.0-20210218152603-eb3b6397b1b5

2 years ago

v0.0.0-20170731123819-3da102d464b7

2 years ago

v0.0.0-20170509093356-eceb483eb552

2 years ago

v1.1.3-0.20210215174809-b55fa79836c6

2 years ago

v1.1.3-0.20210214172721-ded486a867a9

2 years ago

v1.1.3-0.20210210194059-893ebf6e36ac

2 years ago

v1.1.2-0.20210209210842-07445ea179fc

2 years ago

v0.0.0-20210208000850-652c755d3751

2 years ago

v1.1.2-0.20210208000850-652c755d3751

2 years ago

v0.0.0-20210201225947-1d71ff02701c

2 years ago

v0.0.0-20150504185605-787b737b480a

2 years ago

v1.1.2-0.20210201225947-1d71ff02701c

2 years ago

v1.1.2-0.20210117014143-4384b91fb4f1

2 years ago

v1.1.2-0.20201229145732-a4ab3fa09e3d

2 years ago

v1.1.2-0.20201204193411-7df62f7668c7

2 years ago

v0.0.0-20201018185926-86f8bfd7fef8

2 years ago

v0.0.0-20170401204539-6421115516be

2 years ago

v1.1.2-0.20201109234615-08c51e585ca7

2 years ago

v0.0.0-20200508011816-5155946348ee

2 years ago

v1.0.1-0.20201006035406-b97b5ead31f7

2 years ago

v1.0.1-0.20201004012507-f64bfa1e08c3

2 years ago

v1.0.1-0.20201001152800-40d34bca1bff

2 years ago

v0.0.0-20200923222621-0bc8bfbe596b

2 years ago

v0.0.0-20200916152758-7f8e83d9366a

2 years ago

v1.0.1-0.20200923222621-0bc8bfbe596b

2 years ago

v1.0.1-0.20200916152758-7f8e83d9366a

2 years ago

v1.0.1-0.20200915144535-2a8d0f327d7a

2 years ago

v0.0.0-20200909172742-8a63648dd905

2 years ago

v1.0.1-0.20200909172742-8a63648dd905

2 years ago

v0.0.0-20200826151851-02a0d2fbc9e6

2 years ago

v1.0.1-0.20200826151851-02a0d2fbc9e6

2 years ago

v0.0.0-20200823174541-9ed1d713d619

2 years ago

v1.0.1-0.20200823174541-9ed1d713d619

2 years ago

v0.0.0-20160822135944-1f4717172e07

2 years ago

v0.0.0-20160718214935-9d9ce1213e32

2 years ago

v0.0.0-20200818201409-8cfa4b4acf63

2 years ago

v1.0.1-0.20200818201409-8cfa4b4acf63

2 years ago

v0.0.0-20200410195628-a684a6d7f5e3

2 years ago

v0.0.0-20200815144417-81e0311edd0b

2 years ago

v1.0.1-0.20200815144417-81e0311edd0b

2 years ago

v1.0.1-0.20200811123951-5cdf8e26ba70

2 years ago

v1.0.1-0.20200805153641-96dc55577faf

2 years ago

v0.0.0-20140411141109-59bd285b5f76

2 years ago

v0.0.2-0.20171202175949-86783686cade

2 years ago

v1.0.1-0.20200731155344-0e27f22f6ef7

2 years ago

v1.0.1-0.20200719220246-c6fe2d4df810

2 years ago

v1.0.1-0.20200715031239-b95db644ed1c

2 years ago

v1.0.1-0.20200713175500-884edc58ad08

2 years ago

v1.0.1-0.20200710201246-675ae5f5a98c

2 years ago

386 Versions

TagPublished
v1.3.01yr ago
v0.0.0-20151119133415-6c0cb34745aa1yr ago
v1.2.2-0.20211209214727-19c9c74384981yr ago
v1.2.2-0.20211208185637-01e05b8ea13c1yr ago
v1.2.2-0.20211207232406-36bff0a4d5411yr ago
v1.2.2-0.20211207224648-d298d79e6a8b1yr ago
v0.0.0-20191223205140-447f182a9da81yr ago
v0.0.0-20211116222018-9e1d6f1c2aa81yr ago
v1.2.2-0.20211116222018-9e1d6f1c2aa81yr ago
v1.2.2-0.20211115202611-3c84bf87042f1yr ago
v1.2.2-0.20211115203316-78969f9c816b1yr ago
v1.2.2-0.20211115203940-442031e4ff691yr ago
v1.2.2-0.20211103193651-bfacc59f62c61yr ago
v1.2.01yr ago
v1.2.11yr ago
v1.2.2-0.20211102151014-f09e9476376b1yr ago
v1.2.2-0.20211101190133-d2c0cb310d521yr ago
v1.2.1-0.20210702152547-de187e874d1c1yr ago
v0.0.0-20200719220246-c6fe2d4df8101yr ago
v0.0.71yr ago
v0.0.61yr ago
v1.1.01yr ago
v0.0.21yr ago
v1.2.2-0.20211004205808-c1973d31bfd71yr ago
v0.0.41yr ago
v0.0.31yr ago
v1.1.21yr ago
v1.1.31yr ago
v0.0.51yr ago
v0.0.11yr ago
v1.0.01yr ago
v1.1.11yr ago
v0.0.0-20150319192937-384c059f4b9f1yr ago
v1.2.2-0.20210826031853-4fd30b69ee2b1yr ago
v1.1.3-0.20210503162530-7223a997c8a01yr ago
v1.2.2-0.20210805170825-2a5277810f241yr ago
v1.2.2-0.20210802141925-56060d19f8851yr ago
v1.2.1-0.20210702150158-31a1f21b87f11yr ago
v0.0.0-20210210194109-8380ddd3132b1yr ago
v1.1.3-0.20210701154930-07861c800d071yr ago
v1.1.3-0.20210630214930-3c8a19ecd3841yr ago
v1.1.3-0.20210616015213-9a432671fd841yr ago
v0.0.0-20201204193411-7df62f7668c71yr ago
v1.1.2-0.20210201194433-1135bdecebe91yr ago
v1.1.3-0.20210503165400-95d23d24ff0c2yrs ago
v0.0.0-20151216150201-ea3bf167cfab2yrs ago
v1.1.3-0.20210510231933-4590150168e92yrs ago
v1.1.3-0.20210215174701-b312f0a8ef6f2yrs ago
v1.1.3-0.20210503180001-c2e21bdc104f2yrs ago
v0.0.2-0.20171201213716-b1ec2ce1ad4e2yrs ago
v1.1.3-0.20210218152603-eb3b6397b1b52yrs ago
v0.0.0-20210218152603-eb3b6397b1b52yrs ago
v0.0.0-20170731123819-3da102d464b72yrs ago
v0.0.0-20170509093356-eceb483eb5522yrs ago
v1.1.3-0.20210215174809-b55fa79836c62yrs ago
v1.1.3-0.20210214172721-ded486a867a92yrs ago
v1.1.3-0.20210210194059-893ebf6e36ac2yrs ago
v1.1.2-0.20210209210842-07445ea179fc2yrs ago
v0.0.0-20210208000850-652c755d37512yrs ago
v1.1.2-0.20210208000850-652c755d37512yrs ago
v0.0.0-20210201225947-1d71ff02701c2yrs ago
v0.0.0-20150504185605-787b737b480a2yrs ago
v1.1.2-0.20210201225947-1d71ff02701c2yrs ago
v1.1.2-0.20210117014143-4384b91fb4f12yrs ago
v1.1.2-0.20201229145732-a4ab3fa09e3d2yrs ago
v1.1.2-0.20201204193411-7df62f7668c72yrs ago
v0.0.0-20201018185926-86f8bfd7fef82yrs ago
v0.0.0-20170401204539-6421115516be2yrs ago
v1.1.2-0.20201109234615-08c51e585ca72yrs ago
v0.0.0-20200508011816-5155946348ee2yrs ago
v1.0.1-0.20201006035406-b97b5ead31f72yrs ago
v1.0.1-0.20201004012507-f64bfa1e08c32yrs ago
v1.0.1-0.20201001152800-40d34bca1bff2yrs ago
v0.0.0-20200923222621-0bc8bfbe596b2yrs ago
v0.0.0-20200916152758-7f8e83d9366a2yrs ago
v1.0.1-0.20200923222621-0bc8bfbe596b2yrs ago
v1.0.1-0.20200916152758-7f8e83d9366a2yrs ago
v1.0.1-0.20200915144535-2a8d0f327d7a2yrs ago
v0.0.0-20200909172742-8a63648dd9052yrs ago
v1.0.1-0.20200909172742-8a63648dd9052yrs ago
v0.0.0-20200826151851-02a0d2fbc9e62yrs ago
v1.0.1-0.20200826151851-02a0d2fbc9e62yrs ago
v0.0.0-20200823174541-9ed1d713d6192yrs ago
v1.0.1-0.20200823174541-9ed1d713d6192yrs ago
v0.0.0-20160822135944-1f4717172e072yrs ago
v0.0.0-20160718214935-9d9ce1213e322yrs ago
v0.0.0-20200818201409-8cfa4b4acf632yrs ago
v1.0.1-0.20200818201409-8cfa4b4acf632yrs ago
v0.0.0-20200410195628-a684a6d7f5e32yrs ago
v0.0.0-20200815144417-81e0311edd0b2yrs ago
v1.0.1-0.20200815144417-81e0311edd0b2yrs ago
v1.0.1-0.20200811123951-5cdf8e26ba702yrs ago
v1.0.1-0.20200805153641-96dc55577faf2yrs ago
v0.0.0-20140411141109-59bd285b5f762yrs ago
v0.0.2-0.20171202175949-86783686cade2yrs ago
v1.0.1-0.20200731155344-0e27f22f6ef72yrs ago
v1.0.1-0.20200719220246-c6fe2d4df8102yrs ago
v1.0.1-0.20200715031239-b95db644ed1c2yrs ago
v1.0.1-0.20200713175500-884edc58ad082yrs ago
v1.0.1-0.20200710201246-675ae5f5a98c2yrs ago