Which packages do you recommend for building cli tools?

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

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • cobra

    A Commander for modern Go CLI interactions

    Cobra and Viper.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • urfave/cli

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

  • 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

  • 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

  • Show HN: New set of Go libraries for CLI Development

    5 projects | news.ycombinator.com | 11 Jan 2023
  • Libraries for CLI and console applications

    6 projects | /r/golang | 7 Jan 2023
  • Ask HN: What libraries does go have for building interactive shells?

    6 projects | news.ycombinator.com | 16 Jan 2022
  • Requesting guidance

    11 projects | /r/golang | 30 Sep 2021
  • Developing CLIs

    3 projects | dev.to | 12 Aug 2024

Did you konow that Go is
the 4th most popular programming language
based on number of metions?