AsyncAPI Bundler CLI
asyncapi-bundler-cli is a command-line interface tool designed to combine multiple AsyncAPI specification files into a single document. It efficiently resolves `$ref` pointers to external or internal files, consolidating them into a single, comprehensive AsyncAPI definition. While this package currently stands at version 0.7.1, its dedicated functionality for bundling AsyncAPI documents has largely been integrated into the official `@asyncapi/cli` package (which reached version 6.0.0 a month ago), making the `asyncapi-bundler-cli` effectively superseded. It likely has an irregular release cadence as focus has shifted to the more comprehensive official CLI, which offers a broader suite of AsyncAPI development tools, including bundling, validation, and generation. Its primary differentiator was its singular focus on bundling via a dedicated CLI, a role now subsumed by the official toolkit.
Common errors
-
command not found: asyncapi-bundler-cli
cause The CLI executable is not in your system's PATH, typically because it wasn't installed globally or `npm`'s global bin directory isn't configured correctly.fixEnsure the package is installed globally: `npm install -g asyncapi-bundler-cli`. If the problem persists, check your npm global installation path and ensure it's included in your system's PATH environment variable. -
Error: One of the files you tried to bundle is AsyncAPI v3 format, the bundle command does not support it yet, please checkout https://github.com/asyncapi/bundler/issues/133
cause The version of the bundler used by this CLI does not support the AsyncAPI Specification v3.0 format.fixDowngrade your AsyncAPI specification to v2.x or migrate to the latest official `@asyncapi/cli` which is more likely to have (or is actively developing) AsyncAPI v3 support for bundling. -
YAMLParseError: bad indentation of a mapping entry
cause The input AsyncAPI YAML file contains syntax errors, specifically incorrect indentation or invalid YAML structure.fixUse a YAML linter or editor with YAML validation (e.g., VS Code with YAML extension) to correct the syntax errors in your AsyncAPI definition files.
Warnings
- breaking The underlying `@asyncapi/bundler` library (which this CLI relies on) was subject to a critical supply chain attack (GMS-2025-693) on November 24th, 2025. This involved malicious code attempting to harvest credentials and infect repositories during the pre-install phase. All users are strongly advised to rotate credentials, clear npm caches, remove `node_modules`, and roll back dependencies to a safe version or, preferably, migrate to the official `@asyncapi/cli`.
- deprecated This standalone CLI (`asyncapi-bundler-cli`) is largely superseded by the official and actively maintained `@asyncapi/cli` package, which includes a `bundle` command. The official CLI offers broader functionality and more consistent updates.
- gotcha Bundling AsyncAPI v3 documents might not be fully supported, leading to errors. The underlying `@asyncapi/bundler` library has had ongoing efforts for v3 support, and older versions (which this CLI might use) may explicitly fail.
- gotcha As a 0.x version package, `asyncapi-bundler-cli` may introduce breaking changes between minor versions without adhering strictly to semantic versioning. Always review release notes when upgrading.
Install
-
npm install asyncapi-bundler-cli -
yarn add asyncapi-bundler-cli -
pnpm add asyncapi-bundler-cli
Imports
- CLI Usage
npm install -g asyncapi-bundler-cli asyncapi-bundler-cli input.yaml > output.json
- bundle (from @asyncapi/bundler)
const bundle = require('asyncapi-bundler-cli');import { bundle } from '@asyncapi/bundler'; - AsyncAPIBundlerOptions (from @asyncapi/bundler)
import type { AsyncAPIBundlerOptions } from '@asyncapi/bundler';
Quickstart
npm install -g asyncapi-bundler-cli # Bundle a single AsyncAPI file and output to JSON asyncapi-bundler-cli ./path/to/asyncapi.yaml > output.json # Bundle multiple AsyncAPI files (example of complex usage, specific options may vary by version) # Note: Refer to asyncapi/bundler documentation for exact options like baseDir if needed. asyncapi-bundler-cli --baseDir . spec/main.yaml spec/channels.yaml spec/messages.yaml > bundled-api.yaml