OpenCLI Specification is a YAML/JSON document format for describing a command-line interface the way OpenAPI describes an HTTP API — a versioned opencli document carrying info, commands, parameters, platforms, environment, tags and reusable components, validated against a published JSON Schema (draft-07). The stated goal is to make a CLI’s surface machine-readable so documentation, shell completion, SDKs, test cases and MCP tool definitions can be generated from one artifact instead of scraped out of --help. Apache-2.0, v1.0.0, published at openclispec.org. Note that at least four unrelated projects currently use the name OpenCLI; this is the smallest of them.
OpenCLI Specification
OpenCLI Specification asks the question that has been sitting unanswered next to
OpenAPI for a decade: if an HTTP API gets a machine-readable contract, why does the
command-line tool shipped alongside it get a --help string and nothing else. The answer proposed here
is a direct transposition. A document declares opencli: 1.0.0, carries an info block, and then
replaces OpenAPI’s paths with a commands tree — each command with a summary, an operationId,
tags, parameters and responses. It validates against a JSON Schema (draft-07) published in the
repository as opencli.spec.json, and it is Apache-2.0.
- Eight root properties, three of them required -
opencli,infoandcommandsare mandatory;externalDocs,platforms,environment,tagsandcomponentsare optional. Five of those eight names are lifted straight from OpenAPI, which is the point — anyone who can read an API description can read this one without learning a new vocabulary. - The two properties that are not from OpenAPI are the interesting ones -
platformsdeclares which operating systems and architectures the tool ships for, andenvironmentmaps environment variables to CLI parameters. Neither has an HTTP analogue, and both are exactly the context an agent running a binary in a container needs and currently has to guess. - Parameters model the things CLIs actually do - a parameter carries
in: flag,aliasfor short forms, andscope: inheritedfor flags that apply down the whole subcommand tree. The definitions behind it arePlatform,EnvironmentVariable,Tag,Command,Parameter,Schema,ResponseandMediaType— a small surface, deliberately. - It describes itself - the site publishes
opencli.json, a valid OpenCLI document describing the specification’s ownocstool, complete withOCS_CONFIG_PATHandOCS_VERBOSEin theenvironmentblock. Self-description is the cheapest honest signal a specification can give, and this one gives it. - The AI and MCP pitch is roadmap, not shipped - the project markets itself as “AI-native” and
“MCP ready,” but the README’s own generator example is a
commented-out line under the heading “Future vision,” and the working code it shows is a manual
convertToMCPTools(cliSpec)you would write yourself. There is no reference generator, no conformance suite and no released tooling in the repository. Read the specification as a data format and ignore the ecosystem claims until something ships. - The name is contested four ways, and this is the smallest claimant -
opencli.org(spectreconsole/open-cli, “OCS”, 283 stars) andopencli.dev(bcdxn/opencli, 44 stars) are unrelated projects solving the same problem under the same name, andopenclispec.comhosts a fourth, “OCLIS.” This entry coversopenclispec.org— 9 stars, 2 forks, 39 commits, created 18 July 2025 and last pushed 29 October 2025. Anyone evaluating “OpenCLI” needs to establish which one is meant before comparing anything. - “Working Group” and “Community” name nobody - the published document credits an “OpenCLI Working Group” and the site’s schema.org block a publisher called “OpenCLI Community.” Both resolve to a single personal GitHub repository with two contributors and no governance file, charter or membership. That is not disqualifying for a v1.0.0 format, but the institutional language is ahead of the institution.
For an API provider the relevant fact is not which OpenCLI wins. It is that the CLI has quietly become a
primary consumption surface — agents shell out to gh, aws, stripe and your tool far more often
than they hand-write an HTTP request — and that surface is the last major one in the stack with no
contract behind it. OpenCLI describes what a CLI offers, in the shape of an API description. The
CLI Agent Spec describes how a CLI must behave when a machine is the caller.
They are the two halves of the same missing artifact, they were written independently and they do not
reference each other — which tells you how early this is.