Skip to content

generateCommandSchema

Generated reference page for the generateCommandSchema function export.

Signatures

ts
function generateCommandSchema(schema: CommandSchema, options?: JsonSchemaOptions): Record<string, unknown>;
ParameterTypeDescription
schemaCommandSchemaThe command schema to serialize.
optionsJsonSchemaOptions | undefinedGeneration options.

Members

Members

generateCommandSchema

Generate the definition metadata document for a single command.

The per-command counterpart of generateSchema: the same JSON-serializable shape as one entry of its commands array (flags, args, subcommands, examples). Powers --help in --json mode and is useful for embedding one command's definition into custom tooling.

ts
(schema: CommandSchema, options?: JsonSchemaOptions): Record<string, unknown>;

See Also

Released under the MIT License.