zxgo-util

module
v0.0.0-...-5b5ffaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: Apache-2.0

README

zxgo-util

zxgo-util is a very minimalistic library of utilities for any Go project.

Installation

go install gitlab.com/zx42/zxgo-util/cmd/zxgo-util@latest

Or build from source:

git clone https://gitlab.com/zx42/zxgo-util.git
cd zxgo-util
go build -o bin/zxgo-util ./cmd/zxgo-util

Usage

zxgo-util --name=World
Hello, World!

Run zxgo-util --help to see all available flags and commands.

Development

This project uses Kong for CLI parsing, GoConvey for BDD-style tests, and just as a command runner.

Common tasks (see the justfile for the full list):

just build     # build the binary into bin/
just run       # go run the CLI
just test      # run the test suite
just convey    # launch the GoConvey interactive web UI
just tidy      # go mod tidy

Without just installed, the equivalent raw commands are:

go build -o bin/zxgo-util ./cmd/zxgo-util
go run ./cmd/zxgo-util
go test ./...

Project layout

zxgo-util/
├── cmd/zxgo-util/   # main package (Kong CLI entrypoint)
├── internal/               # private application code
├── go.mod
├── justfile
├── LICENSE
└── README.md

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Directories

Path Synopsis
Package check verifies external CLI tools are installed, and produces a portable, actionable install message (an ordered list of package managers to try, per OS) when one is missing.
Package check verifies external CLI tools are installed, and produces a portable, actionable install message (an ordered list of package managers to try, per OS) when one is missing.
cmd
zxgo-util command
Command zxgo-util is the shared CLI home for repo tooling used across gitlab.com/zx42's Go projects — install it once (`just install`), then invoke it from any consuming repo's justfile.
Command zxgo-util is the shared CLI home for repo tooling used across gitlab.com/zx42's Go projects — install it once (`just install`), then invoke it from any consuming repo's justfile.
internal
cmd/publishscooppackage
Package publishscooppackage implements `zxgo-util publish-scoop-package`: uploads one or more already-built archive files to a GitLab project's Generic Package Registry (https://docs.gitlab.com/user/packages/generic_packages/).
Package publishscooppackage implements `zxgo-util publish-scoop-package`: uploads one or more already-built archive files to a GitLab project's Generic Package Registry (https://docs.gitlab.com/user/packages/generic_packages/).
cmd/updateaiusage
Package updateaiusage implements `zxgo-util update-ai-usage`: refreshing the token-usage line in a project's AI-USAGE.md from its .claude/token-usage.json (written locally by a Claude Code hook, not committed).
Package updateaiusage implements `zxgo-util update-ai-usage`: refreshing the token-usage line in a project's AI-USAGE.md from its .claude/token-usage.json (written locally by a Claude Code hook, not committed).
cmd/use-file-o-sys
Package usefileosys implements `zxgo-util use-file-o-sys`: rewriting a Go project's stdlib "os" and zxgo-util/zxos usage onto the newer zxgo-util/zxos/filesys and zxgo-util/zxos/osys packages.
Package usefileosys implements `zxgo-util use-file-o-sys`: rewriting a Go project's stdlib "os" and zxgo-util/zxos usage onto the newer zxgo-util/zxos/filesys and zxgo-util/zxos/osys packages.
cmd/usezxos
Package usezxos implements `zxgo-util use-zxos`: rewriting a Go project's stdlib "os" imports to gitlab.com/zx42/zxgo-util/zxos wherever every os.* identifier a file uses is mapped in zxgo-util/zxos/zxos.go's var block (the allow-list is read from there, not hardcoded, so it can't drift).
Package usezxos implements `zxgo-util use-zxos`: rewriting a Go project's stdlib "os" imports to gitlab.com/zx42/zxgo-util/zxos wherever every os.* identifier a file uses is mapped in zxgo-util/zxos/zxos.go's var block (the allow-list is read from there, not hardcoded, so it can't drift).
Package zxmain provides a shared main()-lifecycle helper for zx42 Go CLIs built with github.com/alecthomas/kong: a signal-cancellable context, optional logging setup/teardown, kong.Parse+Run, and error logging — the shape every zx42 Go CLI's main() otherwise hand-rolls.
Package zxmain provides a shared main()-lifecycle helper for zx42 Go CLIs built with github.com/alecthomas/kong: a signal-cancellable context, optional logging setup/teardown, kong.Parse+Run, and error logging — the shape every zx42 Go CLI's main() otherwise hand-rolls.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL