CLI Reference
Commands
oapie init
Create a default config file in the current directory.
Options:
--force: overwrite an existing config file
oapie parse <source>
Parse a local HTML file or remote documentation URL.
Options:
--output,-O:pretty,json, orjs--shape,-S:raworopenapi--browser,-B:axios,happy-dom,jsdom, orpuppeteer--crawl,-c: crawl sidebar links and parse discovered operations--base-url,-b: base URL for crawling when the source is a local file
oapie generate sdk <source>
Generate a TypeScript SDK package from either a documentation source or a parsed TypeScript OpenAPI artifact.
Options:
--dir,-d: output directory for the generated SDK package--name,-n: package name for the generated SDK--output-mode,-O:runtime,classes, orboth--signature-style,-S:groupedorflat--namespace-strategy,-N:smartorscoped--method-strategy,-M:smartoroperation-id--root-type-name,-r: root type name for the generatedSchema.tsmodule--browser,-B:axios,happy-dom,jsdom, orpuppeteer--timeout,-t: request or browser timeout in milliseconds--crawl,-c: crawl sidebar links and include discovered operations--base-url,-b: base URL when crawling from a local HTML file
Examples
bash
oapie init
oapie parse ./saved-page.html
oapie parse https://docs.example.com/reference/jobs --output=json --shape=openapi
oapie parse https://docs.example.com/reference/jobs --crawl --browser=puppeteer
oapie generate sdk https://docs.example.com/reference/jobs --dir=./output/sdk --crawl --output-mode=both
oapie generate sdk ./output/docs_example_reference_jobs.openapi.ts --dir=./output/generated-sdk --output-mode=runtimeExit Behavior
Successful commands write their output artifact and log its relative path. Failed commands set a non-zero exit code.