swift-cli-kit
A Swift library, scaffold, and conventions for native macOS command-line tools. Polish the runtime once, scaffold new CLIs in seconds, ship via a consistent release flow.
Last login: Mon May 25 09:14:22 on ttys004 # me @ lintuxt.ai in ~/dev/swift-cli-kit [09:14:38] $ ./scaffold-cli mycli --tagline "A small thing." --repo me/mycli ✓ Package.swift ✓ Sources/mycli/main.swift ✓ Tests/mycliTests/ ✓ README.md ✓ install.sh ✓ .github/workflows/ci.yml ✓ .github/workflows/release.yml scaffolded mycli — convention-compliant CLI, ready to swift build # me @ lintuxt.ai in ~/dev/swift-cli-kit [09:14:41] $
Library, scaffold, and conventions — in one kit
CLIKit runtime
TTY-aware ANSI styling, Unicode-aligned tables, semver compare, and a GitHub-release self-update flow — packaged as a single dependency-free Swift library.
New CLI in seconds
scaffold-cli <name> generates Package.swift, sources, tests, README, installer, and CI workflows. Born convention-compliant — --help, --version, --upgrade wired from minute zero.
Same look, same shape
CONVENTIONS.md documents the parameter style and Product README template every kit-built CLI follows. solcito and displayswitcher are reference implementations.
Install in one line
In Package.swift:
.package(url: "https://github.com/lintuxt/swift-cli-kit", from: "0.1.0"),
…and on the executable target:
.product(name: "CLIKit", package: "swift-cli-kit"),
Requires Swift 6.0+ (Xcode 16+) and macOS 13 or later.
Quickstart
./scaffold-cli mycli --tagline "A small thing." --repo me/mycli
Generates a complete CLI project — Package.swift, Sources/, Tests/, README.md, install.sh, and .github/workflows/{ci,release}.yml — all wired up with --help, --version, --upgrade, banner, and sponsor footer. The generated project is born convention-compliant: ready to swift build and swift test immediately.
Why it exists
swift-cli-kit is the runtime polished macOS CLIs all end up writing twice — TTY-aware ANSI styling, Unicode-aligned tables, a GitHub-release self-update flow, semver comparison, and a banner + sponsor footer — packaged as a single dependency-free Swift library.
It also ships project templates, a generator that creates a new CLI in seconds, and a documented convention so every tool built on the kit looks and feels the same.
Extracted from solcito and displayswitcher, the kit exists so the third, fourth, and fifth CLI don't have to re-derive the same runtime concerns each time. Same conventions, same shape, same upgrade flow.
Documentation · License
Documentation
CONVENTIONS.md— the parameter and README rules every kit-built CLI follows.CLAUDE.md— codebase orientation: library API, structure, build, requirements, how to add things.
Used by
- solcito — Logitech wireless device manager for macOS.
- displayswitcher — external monitor brightness, contrast, and input over DDC/CI.
License
MIT — see LICENSE.