Skip to content

Getting Started

Install

Install the CLI globally:

bash
pnpm add -g oapiex
bash
npm i -g oapiex
bash
yarn global add oapiex

Or install it locally in a project:

bash
pnpm add oapiex
bash
npm i oapiex
bash
yarn add  oapiex

Use 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

bash
oapie parse https://maplerad.dev/reference/create-a-customer \
  --shape=openapi \
  --output=json

That 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

bash
oapie parse https://maplerad.dev/reference/create-a-customer \
  --shape=openapi \
  --output=js \
  --crawl

When crawl mode is enabled, OAPIE resolves sidebar links from the current page and visits each discovered operation page.

Generate Your First SDK

bash
oapie generate sdk https://maplerad.dev/reference/create-a-customer \
  --dir=./output/sdk \
  --crawl \
  --output-mode=both

That 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

bash
oapie init

This 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:

ts
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:

bash
oapie parse ./saved-page.html --shape=raw --output=pretty

If you need crawl mode from a local file, provide a base URL so sidebar links can be resolved correctly:

bash
oapie parse ./saved-page.html \
  --crawl \
  --base-url=https://docs.example.com/reference/root-page

Released under the MIT License.