Building the product · Edition No. 59 · 23 Oct 2026

alecthomas/kong

Builds the whole command-line interface of a Go program from a description of its commands.

← Building the productRead the whole edition →
Kong: one declaration, a whole interface. Builds a command-line interface from a description.

3.2k stars · MIT · NO RELEASES AT ALL - /releases/latest renders "There aren't any releases here." A determination, not a gap: Go takes its versions from tags and nothing is missing. · Track this in Scout

Builds the whole command-line interface of a Go program from a description of its commands.

▶Repo detailsthe review · specs · pros & cons · install

What it does

You declare the commands, flags and arguments as a Go structure, with the help text written beside each one as a tag. It then parses what the person typed, fills the structure in, and reports a clear error when something is missing or wrong. Nested subcommands work, so tool thing create --name x needs no manual routing. Values can come from the command line, from environment variables, from a configuration file, or from a default, in an order you control. It generates the help text, including per-command help, so the documentation cannot drift away from the flags. It supports shell completion and can print the parsed result for debugging. It does not do anything at runtime beyond parsing: it builds no interactive prompts and draws no interface, so a program that wants to ask questions on screen needs something else alongside it.

Why it matters

Who it suits. Anyone writing a command-line tool in Go, particularly one with subcommands, who wants the interface described once in one place. It suits small internal tools especially well, because the help text comes free and that is the part nobody writes otherwise. Skip it if the program takes one filename and nothing else, because the standard library handles that in three lines.

Verdict. The best-designed of the three options, and the least used, which is worth knowing. Code was pushed on 11 October 2026 and it is MIT licensed. It publishes no GitHub releases at all, which is a determination rather than a gap: Go takes its versions from tags, and there is nothing missing. The honest comparison is the deciding factor. spf13/cobra has 44,600 stars against this one's 3,200, is used by most well-known Go tools, and is what a new contributor will already know, at the cost of more code to write for the same interface. urfave/cli sits in between. Choose Kong for a tool you will maintain yourself and want described in one structure; choose Cobra when the project is shared and familiarity matters more than elegance.

Stars3.2k
LicenceMIT
LatestNO RELEASES AT ALL - /releases/latest renders "There aren't any releases here." A determination, not a gap: Go takes its versions from tags and nothing is missing.
Good
  • The whole interface is one declaration, so flags, help text and parsing cannot disagree.
  • Values can come from flags, environment variables or a file, with the order under your control.
  • Help text and shell completion are generated, which are the two things people skip.
Watch for
  • Far less widely used than the obvious alternative, so fewer examples and fewer people who know it.
  • Describing an interface through structure tags is concise but harder to read than plain code.
  • Go only. Nothing here transfers to another language.
Similar repositories
  • spf13/cobra

    Apache-2.0, the same job and by far the most widely used, behind most well-known Go command-line tools; it needs more code written by hand for the same interface.

    Track this in Scout
  • urfave/cli

    MIT, the same job with the interface built as values rather than structure tags, which some people find easier to follow and others find longer.

    Track this in Scout
Install
go get github.com/alecthomas/kong
Screenshots
alecthomas/kong: GitHub preview cardalecthomas/kong: Screenshot 1

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.