Thanks for helping! cli-kit collects the terminal and command-line plumbing that our Go tools kept writing again: terminal detection, prompts, tables, progress output, secrets and self-updates. Contributions that make these pieces more robust or more broadly useful are welcome.
You need Go 1.27 or newer and golangci-lint v2.
git clone https://github.com/mittwald/cli-kit.git
cd cli-kit
make check # vet, lint, race tests, locale tests, cross-compile, go mod tidy check
make test-min # run the tests on Go 1.27.0, the oldest supported releaseInteractive packages (pick, live, progress) are tested without a
terminal. To try them by hand, run the demo program:
go run ./examples/demo --help lists its commands, and make demo ARGS=pick
runs one.
Code that reads untrusted input (escape sequences, archives, signatures,
redaction, style specifications) has fuzz targets. Their seeds run with
go test; make fuzz runs every target for FUZZTIME (30s by default).
Add a target when you add such a parser, and commit any failing input the
fuzzer finds under testdata/fuzz together with the fix.
- One module. All packages share one
go.modand one version. A package moves into a module of its own only when it needs a heavy or cgo dependency, or has to version independently. Discuss that in an issue first. - Few dependencies. Every dependency is paid for by every user of the
module. Prefer the standard library and
golang.org/x. Explain any new dependency in the pull request. - Go 1.27 compatibility. Do not use standard-library APIs newer than the
godirective ingo.mod. CI runs the tests on Go 1.27.0 to catch this. - Platforms. Everything must build on Linux, macOS and Windows. Features that only work on Unix degrade gracefully elsewhere and say so in their documentation.
- No hidden global state. Configuration is passed in as options. The few
process-wide settings (
term.SetColorMode,theme.Use) are documented as such. - Plain output when not on a terminal. Anything that writes escape
sequences asks
term.Coloredorterm.CanAnimatefirst, so pipes, files and test buffers stay clean. - Never print secrets. Errors and logs must not contain credential values.
- Run
make fmtandmake lintbefore you push. - Every exported identifier has a godoc comment that ends with a period.
Each package has its overview in
doc.go. - Write comments and documentation in US English.
- Add tests for new behavior. Add an
Examplefunction where the output is deterministic: it documents the package and is tested at the same time.
- Keep a pull request to one topic.
- Use Conventional Commits for commit
messages, for example
feat(table): add a compact border styleorfix(pick): keep the cursor on the selected row after filtering. - Mark breaking API changes with
!(feat(pick)!: …) and thebreaking-changelabel. cli-kit isv0.x, so breaking changes are allowed, but they bump the minor version and are listed first in the release notes.
Maintainers tag releases from main as vMAJOR.MINOR.PATCH. Pushing the
tag runs the release workflow: it tests the tagged commit, creates the
GitHub release with generated notes, and asks the Go module proxy to fetch
the version so it appears on pkg.go.dev. Tags are never moved or deleted;
a broken release is withdrawn with a retract directive in go.mod.
Please do not open public issues for vulnerabilities. See SECURITY.md.