-
Notifications
You must be signed in to change notification settings - Fork 0
OpenCLI
OpenCLI is a specification that describes a command-line application in a machine-readable file, so that both a person and a program can understand how the tool is invoked without reading its source code or its documentation [OpenCLI specification]. It applies the model established by the OpenAPI specification for REST APIs to the command line instead [OpenCLI overview].
A CLI tool usually documents itself in two places: the --help text it prints
and prose documentation written for humans. Neither is a structure a machine
can reliably parse. Anything that wants to build on top of a CLI, such as
generating documentation, producing an auto-completion script, wrapping the
tool for another system, or detecting when its interface changed, has to
re-derive the tool's shape from unreliable text or from its source. There is no
shared contract describing commands, options, and outputs.
OpenCLI defines a formal schema, expressed as JSON or YAML, for the pieces that make up a command-line interface: commands, subcommands, options, arguments, exit codes, and metadata [OpenCLI specification]. The description is platform- and language-agnostic, so a tool written in any language can publish one file that any consumer can read.
The specification lists several consumers the shared contract enables: generating documentation, generating client code for interoperability, automating external tooling such as Model Context Protocol (MCP) servers built over a CLI, detecting changes to a CLI's interface across versions, and generating shell auto-completion scripts [OpenCLI use cases].
OpenCLI sits in Techniques at Assess, positioned outer. The specification is at version 0.1 and is described by its authors as a proposal that welcomes community feedback [OpenCLI specification]. It is maintained under the Spectre.Console organization, whose repository has drawn moderate early interest [open-cli repository]. The idea is sound and the OpenAPI precedent is strong, but the standard is unratified and adoption is limited, so the position is watch rather than build against it. The value is a single machine-readable contract per tool; the ceiling for now is that no ecosystem of producers and consumers has formed around it yet.