Skip to main content

clihatch

CI crates.io clispec

Scaffold a complete, clispec-compliant, agent-facing Rust CLI in seconds - source skeleton, schema + conformance test, and the GitHub-hosted dual-publish release pipeline. No more copying your last tool and sed-ing the name.

Install

cargo install clihatch

Usage

clihatch new my-tool
cd my-tool && make check      # lint + tests pass out of the box
./target/debug/my-tool 21     # the example command runs

Options: --description, --owner (default rvben), --author (default: git config), --into <dir>, --no-git, --github, --no-pypi.

Use --no-pypi for a Rust-only tool: it omits the PyPI/maturin machinery, so the crate publishes to crates.io + Homebrew only (and never trips PyPI's new-project rate limit).

The whole path from nothing to a published release is four steps, and clihatch does three of them:

clihatch new my-tool --github   # scaffold + git commit + create & push the repo
cd my-tool && make check        # lint + tests, green out of the box
clihatch secrets my-tool        # bootstrap the three release secrets
vership release                 # tag + dual-publish

--github creates the public owner/name repo and pushes the initial commit (via gh), so clihatch secrets can run immediately. Without it, clihatch new prints the exact gh repo create command in its next-steps. Every new run lists the remaining steps through to a release.

Bootstrap release secrets

Once the repo exists on GitHub, wire up the three secrets the release pipeline needs in one step:

clihatch secrets my-tool            # -> rvben/my-tool
clihatch secrets my-tool --dry-run  # show what would be set, touch nothing
clihatch secrets my-tool --verify   # read-only: which secrets are already set
  • HOMEBREW_TAP_DEPLOY_KEY - generates an ed25519 key, registers it as a write deploy key on the tap (--tap, default rvben/homebrew-tap), and stores the private key. This is the fiddly part, fully automated.
  • CARGO_REGISTRY_TOKEN - read from $CARGO_REGISTRY_TOKEN or ~/.cargo/credentials.toml.
  • PYPI_API_TOKEN - read from $PYPI_API_TOKEN / $UV_PUBLISH_TOKEN, the [pypi] token in ~/.pypirc, or --pypi-token-stdin.

It preflights gh auth and repo access, so it fails fast (before generating a key) if you are not logged in. Re-running is idempotent: it rotates the deploy key (dropping the prior key with the same title) so the key and the stored secret stay in sync. Missing token sources are skipped with a hint, never invented.

What you get

A ready-to-cargo build, ready-to-release crate:

  • src/ - a minimal but complete clispec CLI: a default command, schema, completions, the structured-error envelope, exit-code contract, and TTY-aware -o auto|json|text. Replace the example run logic with yours.
  • schemas/clispec-v0.2.json + tests/conformance.rs - your schema output is validated against the spec by the test suite.
  • tests/cli.rs - end-to-end tests of the binary.
  • The release pipeline - .github/workflows/{ci,release}.yml (GitHub-hosted, building macOS + Linux). Each target publishes in its own job, so one target's failure (e.g. a registry rate limit) doesn't block the rest - re-run just the failed one with gh run rerun --failed. Includes pyproject.toml (maturin) for the PyPI wheel unless --no-pypi, plus Makefile, prek.toml, README.md, LICENSE, .gitignore.
  • A git init + initial commit (skip with --no-git). Generated sources are cargo fmt-clean.

clihatch is itself built with its own output's conventions - it eats its own dog food, and its test suite scaffolds a crate and compiles it to prove the templates stay valid.

Exit codes

code meaning
0 success
2 IO, git, or backend (gh/ssh-keygen) failure
3 usage error, or the target directory already exists

For agents (clispec)

clihatch schema

Structured output on stdout, structured error envelopes on stderr, a schema subcommand validated against clispec.dev/schema/v0.2.json. new and secrets are the mutating: true commands; new never overwrites, and secrets supports --dry-run.

License

MIT

Metadata

Release files for clihatch 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clihatch 0.1.6
File Size Uploaded Provenance Actions
clihatch-0.1.6.tar.gz 57.6 kB Without provenance Details for clihatch-0.1.6.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for clihatch 0.1.6
File Actions
clihatch-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for clihatch-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
clihatch-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for clihatch-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
clihatch-0.1.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for clihatch-0.1.6-py3-none-macosx_11_0_arm64.whl
clihatch-0.1.6-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for clihatch-0.1.6-py3-none-macosx_10_12_x86_64.whl

Total release size: 2.3 MB

Release files / clihatch-0.1.6.tar.gz

Download URL clihatch-0.1.6.tar.gz
Size 57.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a1f9af0fd6de072e1b6a3ea98af3db9e1fb8483a9ff27860cdd0c808e6fb8257
BLAKE2b-256 checksum
How to use checksums
944d184a1a625cebe574dfe9dd966b97cb3823c79b4f108b2dcc93cc4f826a8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / clihatch-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL clihatch-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 578.3 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
79eaabce71ca522f70d8581785fdc521824acfce3a09aef2e48940ef4e9acfeb
BLAKE2b-256 checksum
How to use checksums
0b43e4a1a974a344bcc807a205550903a4055d3ee3047063f9dc9ef25a35aeaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / clihatch-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL clihatch-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 538.6 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
a6e8ec3e020b06131e8518a8b40f979bf2ad1a4f9c59398e531f12d661a8e7a5
BLAKE2b-256 checksum
How to use checksums
000bf12df6464295990adf59e45ab3c952988aff8704ce273c2ef61386a5c99e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / clihatch-0.1.6-py3-none-macosx_11_0_arm64.whl

Download URL clihatch-0.1.6-py3-none-macosx_11_0_arm64.whl
Size 525.2 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d70666e945b62b4849e973522ace9651e020e2004a6fd9449d84f53ec5890c88
BLAKE2b-256 checksum
How to use checksums
fea38077264d94246de3cacf287a2bbdd18a0a8c6684fddcf71f8c0d130a3ee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / clihatch-0.1.6-py3-none-macosx_10_12_x86_64.whl

Download URL clihatch-0.1.6-py3-none-macosx_10_12_x86_64.whl
Size 561.2 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ca1395ec4fc4dab27f22989d7ce9e1131050cd81d3b059650088e78f3658a60f
BLAKE2b-256 checksum
How to use checksums
50a8d713f84bafec9b992cf95ec08c187f0c9a645db5381bd18ef9a26b9c4271
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for clihatch 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page