Skip to content

Boilerplate combining Kong CLI argument parsing with zerolog logging. Read-only mirror of https://gitlab.com/tozd/go/cli

License

Notifications You must be signed in to change notification settings

tozd/go-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7da71da · Feb 22, 2025

History

61 Commits
Oct 17, 2023
Feb 22, 2025
Nov 21, 2023
Feb 21, 2025
Dec 8, 2024
Feb 21, 2025
Oct 17, 2023
Feb 21, 2025
Oct 17, 2023
Oct 17, 2023
Feb 22, 2025
Oct 17, 2023
Sep 15, 2024
Sep 6, 2024
Sep 6, 2024
Feb 21, 2025
Feb 22, 2025
Feb 22, 2025

Repository files navigation

Boilerplate combining Kong CLI argument parsing with zerolog logging

pkg.go.dev Go Report Card pipeline status coverage report

A Go package providing boilerplate combining Kong CLI argument parsing with zerolog logging.

Features:

  • Config (from files, CLI arguments, and environment variables) is parsed into a struct based on struct tags, powered by Kong.
  • JSON-based and pretty-printed logging, powered by zerolog.
  • Support for built-time version variables and CLI flag.
  • Handles exit codes: 0 for success, 1 for initialization errors (CLI argument parsing or zerolog configuration failures), 2 for panics, and 3 for program errors.
  • All logging goes to stdout and unexpected errors go to stderr.
  • On errors, a stack trace and other details from errors are shown, powered by gitlab.com/tozd/go/errors.

Installation

This is a Go package. You can add it to your project using go get:

go get gitlab.com/tozd/go/cli

It requires Go 1.23 or newer.

Usage

See full package documentation on pkg.go.dev.

See examples.

GitHub mirror

There is also a read-only GitHub mirror available, if you need to fork the project there.

About

Boilerplate combining Kong CLI argument parsing with zerolog logging. Read-only mirror of https://gitlab.com/tozd/go/cli

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published