# Bundle and validate OpenAPI files into one publishable spec with swagger-cli

> Resolve multi-file OpenAPI definitions into one validated artifact before docs, code generation, or CI gates depend on the spec.

- Skill: `agentskillexchange/bundle-and-validate-openapi-files-into-one-publishable-spec-` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/bundle-and-validate-openapi-files-into-one-publishable-spec-`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/bundle-and-validate-openapi-files-into-one-publishable-spec-/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/bundle-and-validate-openapi-files-into-one-publishable-spec-

---


# Bundle and validate OpenAPI files into one publishable spec with swagger-cli

Resolve multi-file OpenAPI definitions into one validated artifact before docs, code generation, or CI gates depend on the spec.

## Prerequisites

Node.js, npm or npx, and one or more Swagger/OpenAPI JSON or YAML files with local or remote $ref targets as needed

## Installation

Use the upstream install or setup path that matches your environment:
- npm install -g @apidevtools/swagger-cli
- git clone https://github.com/APIDevTools/swagger-cli.git
- npm install
- npm test

Requirements and caveats from upstream:
- There is a useful Python tool called [pre-commit](https://pre-commit.com/) that can be used to execute a wide suite of pre-commit checks. The swagger-cli validate command can be integrated as part of a git pre-commit...

Basic usage or getting-started notes:
- --------------------------
- bash
- swagger-cli <command> [options] <file>

- Source: https://github.com/APIDevTools/swagger-cli
- Extracted from upstream docs: https://raw.githubusercontent.com/APIDevTools/swagger-cli/HEAD/README.md

## Documentation

- https://github.com/APIDevTools/swagger-cli

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/bundle-and-validate-openapi-files-into-one-publishable-spec-with-swagger-cli/)

