Simple, intuitive CLI framework for Go pkg.go.dev/go.followtheprocess.codes/cli
go cli
0

Configure Feed

Select the types of activity you want to include in your feed.

README.md

Examples#

This directory contains a bunch of example programs built with cli to show you how the library works and how you might implement common patterns.

./cover#

Not really an example, but holds the source code used to generate the cover image with freeze

./quickstart#

Implements the quickstart command from the main project README

quickstart

./subcommands#

A CLI with multiple subcommands, each with their own flags and expected arguments. Shows how to easily store parsed flag values in an options struct and pass them around your program.

subcommands

./namedargs#

A CLI with named positional arguments that may or may not have default values. Shows how to retrieve these arguments by name and use them without having to care if they were provided or you're using the default.

namedargs

./cancel#

This examples shows how cli requiring you to pass a context.Context to your run functions leads to elegant and resilient cancellation and CTRL+C handling.

cancel

TODO#

  • Replicate one or two well known CLI tools as an example
    • Docker
    • Cargo