Skip to content

gaojunran/usage-integrations

Repository files navigation

usage-spec

Monorepo for generating usage spec from CLI framework metadata.

Packages

Package Description
@usage-spec/core Shared Spec types, KDL/JSON rendering via @bgotink/kdl
@usage-spec/commander Commander.js integration
@usage-spec/yargs yargs integration
@usage-spec/oclif oclif integration

Usage

Each adapter package provides the same API surface:

import { generate, generateKDL, generateJSON, convertRoot } from "@usage-spec/<adapter>";

// Generate KDL spec
const kdl = generate(frameworkInstance);

// Generate JSON spec
const json = generateJSON(frameworkInstance);

// Get Spec object for custom processing
const spec = convertRoot(frameworkInstance);

Pipe KDL output to the usage CLI for completions, docs, and man pages:

mycli --usage-spec | usage generate completion bash

Development

aube install -r       # Install dependencies
aube run build -r     # Build all packages
aube run test -r      # Run all tests

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors