openapi-http-smoke-cli
v0.1.2
Published
Generic OpenAPI HTTP smoke runner with JSON and HTML reports
Maintainers
Readme
openapi-http-smoke-cli
Generic CLI to run HTTP smoke checks from an OpenAPI/Swagger spec.
It executes API operations, prints live status in console, and saves:
- JSON report
- HTML report
Install
npm i -D openapi-http-smoke-cliOr run without installing (after publish):
npx openapi-http-smoke-cli --helpUsage
After package installation:
npx openapi-http-smoke --base-url http://localhost:3002 --spec openapi.json --token "<JWT>"Without installation (one-off run):
npx openapi-http-smoke-cli --base-url http://localhost:3002 --spec openapi.json --token "<JWT>"Options
--base-url <url>Base URL for API requests (default:http://localhost:<SERVICE_PORT|3000>)--spec <path>OpenAPI file path (default:openapi.json)--token, -t <token>Auth token--auth-header <name>Header name for token (default:Authorization)--auth-scheme <scheme>Token scheme prefix (default:Bearer)--timeout-ms <number>Request timeout in ms (default:15000)--report <path>JSON report path (default:reports/http-smoke-generic-latest.json)--html-report <path>HTML report path (default:reports/http-smoke-generic-latest.html)--fail-fastStop on first failed request
package.json example in service project
{
"scripts": {
"http:smoke": "openapi-http-smoke --base-url http://localhost:3002 --spec openapi.json"
}
}Publish
npm run build
npm publish --access publicFor private registry, use your org registry config and publish as private package.
