CI-Ready API Testing for OpenAPI
Test your OpenAPI APIs from the command line. 6 protocols, declarative assertions, 3 report formats. Postman script support. Drop into any CI pipeline.
Test your API in minutes
# Install globally npm install -g @powerduck/openapi-cli # Run tests from an OpenAPI spec (no subcommand, flat options) openapi-cli --spec ./openapi.yaml # With config file and HTML report openapi-cli --config ./api-tests.json --format html --output ./reports # Filter by tag and method openapi-cli --spec ./openapi.yaml --tag users --method get # Remote spec with auth openapi-cli --spec https://api.example.com/openapi.json --bearer $TOKEN
Everything for API testing
Built for CI/CD pipelines and local development.
Six Protocols
HTTP, SSE, WebSocket, GraphQL, gRPC, and MCP. One config, one runner, all protocols. Auto-detect protocol from operation metadata.
Declarative Assertions
Define assertions in YAML/JSON: status code, headers, body JSON
paths, response time.
runDeclarativeAssertions() evaluates them against
responses.
Three Report Formats
JSON for machine parsing, CLI for terminal output with color and
progress bars, HTML for dashboards.
generateJsonReport(),
printCliReport(),
generateHtmlReport().
Postman Script Support
extractPostmanScripts() extracts and runs Postman
test scripts (pm.test, pm.expect) from imported collections.
Compatible with Postman v2.0/v2.1.
Filtering & Concurrency
Filter operations by method, path, tag, or operationId via
FilterConfig. Configurable concurrency limit for
parallel test execution.
Auth & TLS
Bearer token, API key, basic auth, OAuth2 via
AuthConfig. Custom TLS certificates and insecure
mode via TlsConfig. Remote spec loading with
timeout.
Six protocols, one runner
Test any API type from a single configuration.
HTTP / REST
Standard HTTP requests with full method, header, body, and query support. Response time tracking and body capture.
Server-Sent Events
Connect to SSE endpoints, capture event streams, assert on event data and timing. Auto-detect from content-type.
WebSocket
Connect, send messages, receive responses. Assert on message content and sequence. Manual session support.
GraphQL
Send queries and mutations. Introspect schemas. Assert on response data and errors. Variable support.
gRPC
Unary and streaming calls. Proto file loading and reflection. Assert on response messages and metadata.
MCP
Call MCP tools, list resources, resolve prompts. SSE and stdio transports. Assert on tool output.
Programmatic API
Use the CLI as a library in your Node.js scripts.
| Parameter | Type | Description |
|---|---|---|
| configrequired | CliConfig | Test configuration (spec, baseUrl, auth, filter, assertions, concurrency, timeout) |
TestReport { summary: TestSummary; results: TestResult[] }
Merges CLI args with config file, resolves environment variables, validates required fields. Returns a complete CliConfig.
Supports JSON and YAML. Remote loading with configurable
timeout. Use isRemoteSpec(spec) to check if a
spec path is a URL.
Operators: equals, notEquals, contains, notContains, exists, notExists, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual, matches, isType.
Reads x-assertions extension from OpenAPI
operations. Returns DeclarativeAssertion[].
Extracts pre-request and test scripts from Postman v2.0/v2.1 collections. Returns scripts keyed by request name.
Supports dot notation, bracket notation, array indices, and wildcards. Returns the resolved value or undefined.
Writes report-YYYYMMDD-HHmmss.json to the specified directory.
Color-coded output with progress bar, per-operation results,
and summary. Also available as
generateCliReport(report) returning a string.
Self-contained HTML report with interactive results, charts, and detailed assertion views.
Default concurrency: 5, timeout: 10000ms, report format: cli. Merge with your config via resolveConfig.