Skip to content

generateCommandSchema

Generated reference page for the generateCommandSchema function export.

Signatures

ts
function generateCommandSchema(schema: CommandSchema, options?: JsonSchemaOptions, meta?: ExampleMeta): CommandDefinitionDocumentV1;
ParameterTypeDescription
schemaCommandSchemaThe command schema to serialize.
optionsJsonSchemaOptions | undefinedGeneration options.
metaExampleMeta | undefinedProgram name/version for function-form examples; defaults to
the command's own name with no version.

Members

Members

generateCommandSchema

Generate the definition metadata document for a single command.

The per-command counterpart of generateSchema: one entry of its commands array (flags, args, subcommands, examples), plus the schemaVersion every standalone document carries. Powers --help in --json mode and is useful for embedding one command's definition into custom tooling.

ts
(schema: CommandSchema, options?: JsonSchemaOptions, meta?: ExampleMeta): CommandDefinitionDocumentV1;

See Also

Released under the MIT License.