@sayedameer/bruno-openapi-sync
v1.0.3
Published
Sync an OpenAPI spec into a Bruno collection with interactive git-style diffs
Downloads
451
Readme
@sayedameer/bruno-openapi-sync
Sync an OpenAPI spec into a Bruno collection with interactive git-style diffs.
When your API spec changes, this tool imports the new spec into a temp dir, diffs each file against your existing Bruno collection, and lets you review/accept/skip changes one by one — just like git add -p.
Installation
npm install -g @sayedameer/bruno-openapi-syncOr run without installing:
npx @sayedameer/bruno-openapi-sync -s ./openapi.json -o ./brunoPrerequisites
@usebruno/cli must be available. Install it globally or as a project dependency:
npm install -g @usebruno/cli
# or
npm install --save-dev @usebruno/cliUsage
bruno-openapi-sync [options]
Options:
-s, --source <path> Path to OpenAPI JSON file (required)
-o, --output <path> Path to Bruno output directory (required)
-y, --yes Auto-accept all changes without prompting
-h, --help Show helpExamples
# Interactive sync
bruno-openapi-sync -s ./openapi.json -o ./bruno
# Auto-accept all changes
bruno-openapi-sync -s ./openapi.json -o ./bruno --yesInteractive prompts
For each changed file you'll be prompted:
Apply this change? [y/n/a(all)/q(quit)]- y — apply this change
- n — skip this change
- a — apply this and all remaining changes
- q — quit without applying further changes
New files are always added automatically. Deleted files (removed from spec) prompt for confirmation.
Programmatic API
import { sync } from '@sayedameer/bruno-openapi-sync';
await sync({
source: './openapi.json',
output: './bruno',
yes: true, // optional, auto-accept all
});License
MIT
