josegonzalez / cli-skeleton

An opinionated framework for building golang cli tools on top of mitchellh/cli.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli-skeleton

An opinionated framework for building golang cli tools on top of mitchellh/cli.

Why

While mitchellh/cli gives quite a bit of code to allow folks to build cli tools on top of it, it does not provide enough structure to allow folks to get started quickly. This project aims to fill that void by implementing a skeleton based upon those provided by the hashicorp suite of tools.

See Command Line Interface Guidelines for further reading on how to structure command line tools.

Examples

For examples on how to perform various tasks, see the following examples:

  • global: Shows how to implement "global" flags.
  • hello-world: The hello-world example.
  • human-readable-logging: The hello-world example with nicer log output.
  • nil: An example cli tool that does nothing. Useful for copying the nil.go command as a command template for your own cli tools.
  • zerolog-logging: The hello-world example with zerolog logger support.

About

An opinionated framework for building golang cli tools on top of mitchellh/cli.

License:MIT License


Languages

Language:Go 99.3%Language:Makefile 0.7%