Skip to content
rvbenPublic

About

A specification for building CLI tools that work equally well for humans and AI agents

Resources

Stars

16 stars

Watchers

1 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

Repository files navigation

The CLI Spec

6 principles for building CLI tools that work for humans, scripts, and AI agents.

Read the spec at clispec.dev. Score any binary on your $PATH with clispec.

Versions

Version Status Schema
0.3 Candidate clispec.dev/schema/v0.3.json
0.2 Frozen clispec.dev/schema/v0.2.json

A frozen version never changes again, and every published file is listed with its SHA-256 in CHECKSUMS.txt so anyone can verify what they fetched. See Versions for what the two statuses mean and what v0.3 needs before it freezes.

Checking your tool

git clone https://github.com/rvben/clispec && cd clispec
mytool schema > schema.json
make check FILE=schema.json            # errors, plus advisory warnings
make check FILE=schema.json STRICT=1   # warnings become failures
make convert FILE=old-v0.2.json        # v0.2 to v0.3, with an honest review list

make check runs the layers JSON Schema alone cannot: referential integrity, exit-code ownership, and the conditionally required error kinds.

Working on the spec

make test        # the normative fixture suite
make mutate      # proves the suite can fail, by breaking each rule in turn
make checksums   # verifies no frozen artifact has changed
make build       # build the site

CI runs these targets and nothing else, so a green pipeline is reproducible locally. Everything runs through uv run --with at pinned versions, so there is no install step to keep in sync.

Reusable CI

The workflows in .github/workflows provide two centralized checks for CLI repositories:

  • conformance.yml builds a Rust or uv-managed CLI and requires a clispec v0.3 score of 24/24 (Excellent).
  • published-artifacts.yml confirms that the latest GitHub release agrees with crates.io, PyPI, and Homebrew and that published files have valid metadata.

Pin them to a full commit SHA and name the release beside it, so a mutable ref can never change CI code silently:

uses: rvben/clispec/.github/workflows/conformance.yml@<40-char-sha> # v0.3.1

Both halves earn their place. The SHA is what runs. The comment is what lets an update tool prove which release the old SHA stood for and propose the next one; without it a bare SHA is unresolvable and stays frozen until someone transcribes a new one by hand. Repository tags track the spec line they belong to and are not spec publications in their own right, which Versions explains.

Contributing

  • Open an issue to discuss changes
  • Submit a pull request for spec improvements
  • To list your tool as a reference implementation, open a PR

A change to a normative rule touches four places: the schema, a fixture in tests/fixtures/, the mutation in tests/mutate.py that proves the fixture bites, and the prose in docs/.

License

CC BY 4.0 - Copyright 2026 Ruben Jongejan

About

A specification for building CLI tools that work equally well for humans and AI agents

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages