Recommended framework/library for creating cli apps in go?

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

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • 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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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