Getting Started
Install
Install the CLI globally:
pnpm add -g oapiexnpm i -g oapiexyarn global add oapiexOr install it locally in a project:
pnpm add oapiexnpm i oapiexyarn add oapiexUse the global install when you want the oapie command everywhere.
Use the project dependency when you want programmatic imports in your own scripts or build tooling.
First Parse
oapie parse https://maplerad.dev/reference/create-a-customer \
--shape=openapi \
--output=jsonThat command loads the documentation page, extracts the operation metadata, normalizes it into an OpenAPI-like document, and writes the result into output/.
Crawl A Full Section
oapie parse https://maplerad.dev/reference/create-a-customer \
--shape=openapi \
--output=js \
--crawlWhen crawl mode is enabled, OAPIE resolves sidebar links from the current page and visits each discovered operation page.
Generate Your First SDK
oapie generate sdk https://maplerad.dev/reference/create-a-customer \
--dir=./output/sdk \
--crawl \
--output-mode=bothThat command emits a TypeScript SDK package scaffold with generated schema types, runtime bundle exports, and class-based SDK files.
See SDK Generation for output modes, naming strategies, and package layout details.
Initialize Config
oapie initThis creates oapiex.config.js in the current directory with the default settings.
Programmatic Usage
If you want to use OAPIEX without the CLI, install it as a dependency and import from oapiex:
import { Application, extractReadmeOperationFromHtml } from 'oapiex';
const app = new Application({ browser: 'puppeteer' });
const html = await app.loadHtmlSource(
'https://docs.example.com/reference/jobs',
true,
);
const operation = extractReadmeOperationFromHtml(html);
console.log(operation);See Programmatic Usage for the full API flow.
Local HTML Files
You can also parse a saved HTML file:
oapie parse ./saved-page.html --shape=raw --output=prettyIf you need crawl mode from a local file, provide a base URL so sidebar links can be resolved correctly:
oapie parse ./saved-page.html \
--crawl \
--base-url=https://docs.example.com/reference/root-page