Cobra is a library for creating powerful modern CLI applications, and at the same time a program to generate applications and command files. It provides a simple interface for creating powerful CLI interfaces, and will also generate application scaffolding so you can quickly develop your Cobra-based application. This scaffolding includes easy subcommand-based CLIs, fully POSIX-compliant flags, global, local and cascading flags, among many others.

The structure of Cobra is based on commands, flags and arguments. The commands represent actions, the central point of the application; flags modify the behavior of commands; while arguments are things. With these easy-to-use concepts, users will natively understand how to use the application.

Features

  • Easy subcommand-based CLIs
  • Flags that are fully POSIX-compliant (both long and short versions)
  • Nested subcommands
  • Global, local and cascading flags
  • Generates applications & commands easily with cobra init appname & cobra add cmdname
  • Intelligent suggestions
  • Automatic help generation for commands and flags
  • Automatic help flag recognition of -h, --help, etc.
  • Automatic generation of bash autocomplete
  • Automatic generation of man pages
  • Command aliases, for changing things without breaking them
  • Define your own help, usage and more
  • Optional tight integration with viper for 12-factor apps

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Cobra

Cobra Web Site

You Might Also Like
Red Hat Ansible Automation Platform on Microsoft Azure Icon
Red Hat Ansible Automation Platform on Microsoft Azure

Red Hat Ansible Automation Platform on Azure allows you to quickly deploy, automate, and manage resources securely and at scale.

Deploy Red Hat Ansible Automation Platform on Microsoft Azure for a strategic automation solution that allows you to orchestrate, govern and operationalize your Azure environment.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Cobra!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Software Development Software, Go Libraries

Registered

2020-06-15