Skip to main content

Scaffold a clispec-compliant, agent-facing Rust CLI in seconds.

Project description

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.

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 dual-publish pipeline - .github/workflows/{ci,release}.yml (GitHub-hosted, building macOS + Linux for crates.io + PyPI + Homebrew), pyproject.toml (maturin), 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 or git 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 is the one mutating: true command (it creates files; it never overwrites).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clihatch-0.1.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

clihatch-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (504.4 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

clihatch-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (469.9 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

clihatch-0.1.0-py3-none-macosx_11_0_arm64.whl (455.2 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

clihatch-0.1.0-py3-none-macosx_10_12_x86_64.whl (488.0 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file clihatch-0.1.0.tar.gz.

File metadata

  • Download URL: clihatch-0.1.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for clihatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d87618e49a33de48acc1fc40015fe4dd84bb28253710a3c610fc4ace94e99035
MD5 2bc9e4159a4ac45612e4d03fd1b705b2
BLAKE2b-256 d86ac7b39c086e4f17282be7a50a6d2643f93ca44adae8c6bcd4a5b7aeb5b83d

See more details on using hashes here.

File details

Details for the file clihatch-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: clihatch-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 504.4 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for clihatch-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e6f35d57c7e2d350f8189286258af80e941239e972256dd6a9ad5a8ce435b3d
MD5 619120571b8b50a06dd9b32ff5a0a69c
BLAKE2b-256 e5b639339c899c2f216cf35aabef3768cca5a9a158f6e66bd601210f2f0db14e

See more details on using hashes here.

File details

Details for the file clihatch-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: clihatch-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 469.9 kB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for clihatch-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 703b18b3a011d8f2d17ed7def1e8c568c69668fa858645cdbc839fcfb0f0fbf9
MD5 1f08b4a4d8cf705cb1dc151d4e1f7bc0
BLAKE2b-256 2c82eb81b54fa8fad806214944eee28ff2c031753a9573121d9d195c48a853d5

See more details on using hashes here.

File details

Details for the file clihatch-0.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: clihatch-0.1.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 455.2 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for clihatch-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f86478d070fd30eb1655c6810216fd316fd8b6649037b3e05d4ade834843d104
MD5 4a43cbfb3c9416e8053717017f6d14f7
BLAKE2b-256 441644e9bd3bb50adac89f1bc59b3db3ec888578b8b3e7be7ec0444e0a896e08

See more details on using hashes here.

File details

Details for the file clihatch-0.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: clihatch-0.1.0-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 488.0 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for clihatch-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 226ccd81a816ea9b89cf18db22f7fa8c157282fac46170f10eabb71ee29a3be7
MD5 3ca1bfbdda55ab8c75e5859add3fa568
BLAKE2b-256 98d22a8784f7dcc88fad11ebe9d4293ce273f31e167f8135d677d432d38494dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page