cli README

The project's README from github.com/urfave/cli. As one markdown file: README.md.

Welcome to urfave/cli

Go Reference Go Report Card codecov Tests status

urfave/cli is a declarative, simple, fast, and fun package for building command line tools in Go featuring:

Documentation

See the hosted documentation website at https://cli.urfave.org. Contents of this website are built from the ./docs directory.

Support

Check the Q&A discussions. If you don't find answer to your question, create a new discussion.

If you found a bug or have a feature request, create a new issue.

Please keep in mind that this project is run by unpaid volunteers.

License

See LICENSE.

cli (urfave/cli)

Searching Database…

24.3K ·GitHub
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
Creator
urfave
Size
12.5 MB
Stars
24.3K
Age
13y
Commits · 90 Days