Skip to main content

Installation

Requirements

  • Node.js: >= 18.17 (declared in the package engines field).
  • A package manager: npm, yarn, or pnpm.

The package ships dual ESM (dist/index.js) and CommonJS (dist/index.cjs) builds with bundled TypeScript declarations (dist/index.d.ts). No extra @types packages are needed.

Installing globally puts the openapi-cli binary on your PATH:

npm install -g @powerduck/openapi-cli

Verify the binary:

openapi-cli --help

Pin the version inside a project so CI uses a known release:

npm install --save-dev @powerduck/openapi-cli

Then invoke the binary through your package manager runner:

npx openapi-cli --spec openapi.json
# or
pnpm exec openapi-cli --spec openapi.json

One-off run with npx

No installation required:

npx @powerduck/openapi-cli --spec openapi.json

Package layout

EntryPath
ESM entrydist/index.js
CommonJS entrydist/index.cjs
Type definitionsdist/index.d.ts
CLI entry (bin)dist/cli.js
Binary nameopenapi-cli

The package declares "type": "module" and exposes only the . and ./package.json subpaths.

Programmatic import

// ESM
import { runTests, resolveConfig } from "@powerduck/openapi-cli";

// CommonJS
const { runTests, resolveConfig } = require("@powerduck/openapi-cli");

Runtime dependencies

The published package depends on:

  • @powerduck/openapi-parser (^0.3.3) — internal $ref dereferencing.
  • @powerduck/openapi-request (^0.2.2) — protocol request execution.
  • commander (^15.0.0) — CLI argument parsing.

Next steps