Which packages do you recommend for building cli tools?

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

  • Cobra and Viper.

  • urfave/cli

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

  • 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
  • viper

    Go configuration with fangs

  • Cobra and Viper.

  • bubbletea

    A powerful little TUI framework 🏗

  • Don't forget https://github.com/charmbracelet/bubbletea and the rest of the https://charm.sh suite!

  • kong

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

  • I prefer https://github.com/alecthomas/kong these days

  • warg

    Declarative and Intuitive Command Line Apps with Go

  • I wrote my own! https://github.com/bbkane/warg/

  • ff

    Flags-first package for configuration

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • pflag

    Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.

  • I realy enjoyed the patched version from spf13 with "--" support https://github.com/spf13/pflag

  • go-flags

    go command line option parser

  • https://github.com/jessevdk/go-flags provides a pretty neat way to specify flags and handle commands. Not so much extensible as cobra, but good enough for small cli 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