Recommended framework/library for creating cli apps in go?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • cobra

    A Commander for modern Go CLI interactions

    I've used both cobra and cli, both are good. cli may be, IMO, a bit "lighter", not speed-wise (maybe it's different, but I haven't noticed), but it's not as feature-rich as cobra, but it's excellent.

  • urfave/cli

    A simple, fast, and fun package for building command line apps in Go (by urfave)

    I've used both cobra and cli, both are good. cli may be, IMO, a bit "lighter", not speed-wise (maybe it's different, but I haven't noticed), but it's not as feature-rich as cobra, but it's excellent.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • kong

    Kong is a command-line parser for Go (by alecthomas)

    I switched all from viper to kong.

  • commando

    An easy-to-use command-line application builder. (by thatisuday)

    At least for smaller apps, I like commando because it's light in terms of dependencies, it's straight-forward to use and parses getopt style parameters.

  • go-arg

    Struct-based argument parsing in Go

    I personally swear by the go-arg package, as i prefer its library-not-framework approach.

  • viper

    Go configuration with fangs

    Personally, I went with Cobra and Viper because they are used in so many big tools.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts