any-cli

module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0

README

any

Scaffold a new tamnd/*-cli repository, fully wired.

any writes a complete site CLI from one proven template. Every tamnd/*-cli repo shares the same skeleton: a cobra command tree, a pure-Go library package, GoReleaser cross-builds with packages and a container image, the ci/release/docs GitHub Actions, a tago documentation site, and the house style. any new <site> writes all of it at once, so a new CLI starts complete instead of accreting boilerplate by hand.

Install

go install github.com/tamnd/any-cli/cmd/any@latest

Or grab a prebuilt binary from the releases.

Usage

any new reddit                       # scaffold ./reddit-cli, builds as-is
any new reddit --remote              # also create tamnd/reddit-cli and push
any new lobsters -d ~/code --binary lob --short "A command line for Lobsters."

any new <site> derives everything from the bare site name:

Field Example (reddit)
Repository reddit-cli
Module github.com/tamnd/reddit-cli
Binary reddit
Library package reddit/
Container image ghcr.io/tamnd/reddit
Docs domain reddit-cli.tamnd.com

Override any of them with flags (--owner, --binary, --license, --short, --description, --author, --email). Run any new --help for the full set.

After scaffolding, any initialises a git repo, adds the docs theme submodule, runs go mod tidy, and (with --remote) creates the GitHub repository with gh and pushes. Skip steps with --no-git, --no-tidy.

What you get

A repository that builds, tests, lints, and releases with no further setup:

cmd/<bin>/           thin main, wires cli.Root into fang
cli/                 cobra command tree with version
<site>/              library: a paced, retrying HTTP client and your models
docs/                tago site, deploys to GitHub Pages and Cloudflare
.github/workflows/   ci (build/test/lint/vuln/tidy), release, docs
.goreleaser.yaml     archives, deb/rpm/apk, GHCR image, cosign, SBOMs, taps
Dockerfile Makefile .golangci.yml LICENSE

Then you write the site-specific commands in cli/ on top of the library, and cut the first release with git tag v0.1.0 && git push --tags.

Development

make build      # ./bin/any
make test       # go test ./...

The templates live in scaffold/templates, embedded into the binary. Each file is a Go text/template with << >> delimiters (so GitHub Actions ${{ }} and GoReleaser {{ }} expressions pass through), and BINARY / LIBPKG in a path are replaced with the binary and library package names.

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
Package cli builds the any command tree on top of the scaffold engine.
Package cli builds the any command tree on top of the scaffold engine.
cmd
any command
Command any scaffolds a new tamnd/*-cli repository with the full release, docs, and CI setup already wired in, so a new site CLI starts from a complete, building, releasable skeleton instead of a blank directory.
Command any scaffolds a new tamnd/*-cli repository with the full release, docs, and CI setup already wired in, so a new site CLI starts from a complete, building, releasable skeleton instead of a blank directory.
kit
Package kit turns one declaration of an operation into three surfaces: a CLI subcommand, an HTTP route, and an MCP tool.
Package kit turns one declaration of an operation into three surfaces: a CLI subcommand, an HTTP route, and an MCP tool.
errs
Package errs defines the typed error taxonomy shared by every kit-based CLI and its one true mapping to CLI exit codes, HTTP status codes, and MCP error objects.
Package errs defines the typed error taxonomy shared by every kit-based CLI and its one true mapping to CLI exit codes, HTTP status codes, and MCP error objects.
render
Package render turns a stream of record structs into one of the output formats the kit CLI supports: table, markdown, json, jsonl, csv, tsv, url, raw, and a Go text/template.
Package render turns a stream of record structs into one of the output formats the kit CLI supports: table, markdown, json, jsonl, csv, tsv, url, raw, and a Go text/template.
store
Package store defines the pluggable record-store SPI that lets any kit read double as a crawl: with --db set, every emitted record is upserted into a local store before it reaches the output.
Package store defines the pluggable record-store SPI that lets any kit read double as a crawl: with --db set, every emitted record is upserted into a local store before it reaches the output.
store/sqlitestore
Package sqlitestore is the built-in default store backend.
Package sqlitestore is the built-in default store backend.
Package scaffold renders the embedded template tree into a new site CLI repository.
Package scaffold renders the embedded template tree into a new site CLI repository.

Jump to

Keyboard shortcuts

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