Describe
Turn real command definitions into an OpenCLI document with a framework integration.
Learn more →Built upon the OpenCLI specification
Generate a CLI document from yargs, Commander.js, or oclif, then publish it with Docusaurus or VitePress.
Use built-in integrations for yargs, Commander.js, and oclif to generate an OpenCLI document from the command definitions you already maintain.
Explore the frameworks →import { Command } from 'commander';
import { createDocgenCommand, fromCommander } from '@clidoc/commander';
import { infoFromPackageJson } from '@clidoc/core';
const info = infoFromPackageJson(pkg);
const program = new Command(info.binary);
// ...register your commands...
const document = () => fromCommander(program, info);
program.addCommand(createDocgenCommand(document));
program.parse();Publishing plugins generate command pages for Docusaurus and VitePress. You can also render Markdown for other documentation sites.
Explore publishing plugins →// docusaurus.config.js
const clidocPlugin = require('@clidoc/docusaurus');
module.exports = {
plugins: [[clidocPlugin, { input: 'cli.json', outputDir: 'docs/generated-cli', basePath: '/cli' }]],
};Give your CLI a docgen command with a framework integration, then validate its OpenCLI document with clidoc.
Read the CLI guide →$ npm install -g @clidoc/cli
$ mycli docgen --output cli.json
$ clidoc validate cli.jsonAn open specification
OpenCLI describes your CLI’s commands, arguments, and flags in JSON or YAML. This is an excerpt from clidoc’s own generated OpenCLI document, including its validate command.
That shared format connects clidoc to a wider ecosystem of documentation, validation, and code generation tools.
{
"opencliVersion": "1.0.0-alpha.14",
"info": {
"title": "clidoc",
"binary": "clidoc",
"version": "1.1.2",
"summary": "Generate, validate, and publish CLI documentation through OpenCLI."
},
"commands": {
"clidoc validate": {
"summary": "Validate an OpenCLI JSON or YAML document",
"args": [
{
"name": "input",
"required": true,
"type": "string",
"summary": "OpenCLI document filename"
}
]
}
}
}
Turn real command definitions into an OpenCLI document with a framework integration.
Learn more →Validate a JSON or YAML document against the OpenCLI specification.
Learn more →Generate command pages for Docusaurus, VitePress, or Markdown.
Learn more →