Generates usage spec for CLIs built with oclif.
npm install @usage-spec/oclifimport { Config } from "@oclif/core";
import { generate } from "@usage-spec/oclif";
const config = await Config.load();
console.log(generate(config));Generates a usage spec in KDL format from an oclif Config object.
Alias for generate().
Generates a usage spec in JSON format.
Converts an oclif Config to the Spec data structure.
The converter accepts a plain object matching the OclifConfig interface, so you can pass config.commands, config.topics, etc. directly from an oclif Config instance without depending on @oclif/core at compile time.
Command IDs with : separators are automatically organized into nested cmd structures. Topic descriptions are used for intermediate group nodes.
MIT