What is this?
urfave/cli is a Go package for building command line tools. You declare commands, subcommands, and flags in Go, and it handles argument parsing, the help system, and shell completion for you.
So it's a library I import into my own Go project, not a program I download and run?
Right — it's a Go package that becomes part of the CLI tool you are writing. It defines how your app parses flags, structures subcommands, and prints help; on its own it does nothing.
How do I add it to a project?
Run go get github.com/urfave/cli/v3 in your Go module, then define your commands and flags in code. The hosted documentation site walks through building a first app.
Will pulling it in drag a pile of dependencies with it?
No. The only dependency is the Go standard library, so adding it to a project stays lightweight.
What kinds of flags can I define?
Flags for simple types, slices of simple types, time, duration, and more. Compound short flags work too, so users can type -abc instead of -a -b -c.
Can my tool's options come from anywhere besides the command line?
Yes. Values can be looked up from environment variables, plain text files, and structured file formats, with the latter handled by the separate urfave/cli-altsrc module (JSON, TOML, and YAML).
Does my tool get shell completion for its users out of the box?
Yes — the package generates dynamic shell completion for bash, zsh, fish, and powershell.
Do I have to write man pages or Markdown docs for my commands myself?
No — urfave/cli can generate documentation in man and Markdown format via the urfave/cli-docs module.
What are similar projects?
cheat, inshellisense, yq, terminalizer, oh-my-posh, gvm, ipatool, viper
Which topics is it in?
environment-variables, toml, golang-library, autocomplete, config, declarative, no-dependencies, powershell, yaml, bash, json, command-line