@asyncapi/cli

中文文档
6.3.0发布于 2026/11/07Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 30万

All in one CLI for all AsyncAPI tools

原始使用文档
文档目录10 节
  1. Table of contents
  2. Installation
  3. Usage
  4. Architecture
  5. Debugging & Testing
  6. Github Action
  7. Contributing
  8. Set up development environment
  9. Command Structure and Patterns
  10. Contributors

AsyncAPI CLI

CLI to work with your AsyncAPI files. Currently under development, we are working to bring more features.

GitHub license PR testing - if Node project npm

Table of contents

Installation

Learn how to install the AsyncAPI CLI by following the instructions in the installation guide.

Usage

The usage guide provides information about different ways to use the CLI.

Architecture

The architecture guide provides information about the architecture. The bundler library lives in this repo at packages/bundler.

Debugging & Testing

The debugging & testing guide provides step-by-step instructions for debugging CLI commands, API endpoints, and services, along with comprehensive testing guidelines.

Github Action

The AsyncAPI CLI can be used as a GitHub Action. You can find more information in the GitHub Action guide.

Contributing

Read CONTRIBUTING guide.

Set up development environment

Read DEVELOPMENT.md file for development setup.

Additional steps:

  • Run npm run test to make sure everything is properly set up
  • Run npm run build and then bin/run to try new CLI locally

This repository is an npm-workspaces + Turbo monorepo. The root package is @asyncapi/cli (workspaces include "." so Changesets still versions it like today). @asyncapi/optimizer lives in packages/optimizer/ and @asyncapi/diff lives in packages/diff/. Both are published separately to npm. Use npm run optimizer:build / npm run optimizer:test and npm run diff:build / npm run diff:test to work on those packages. See their specs: optimizer, diff.

The UX developed for the CLI should comply with the Command Line Interface Guideline

Command Structure and Patterns

We are following verb + noun and namespace + noun + [verb] pattern for making our commands and arguments. For example asyncapi validate <spec-file-path> and asyncapi config context add <context-name> <spec-file-path>.

Contributors

Thanks go to these wonderful people (emoji key):

Jorge Aguiar Martín
Jorge Aguiar Martín

💻 🤔 ⚠️ 📖
Lukasz Gornicki
Lukasz Gornicki

🤔 💻 👀 🚧
souvik
souvik

💻 🤔 ⚠️ 👀 🚧 📖
David Boyne
David Boyne

💻 🤔 🚧
Fran Méndez
Fran Méndez

💻 🤔 👀
Maciej Urbańczyk
Maciej Urbańczyk

👀 🚧 🤔
Aayush Kumar Sahu
Aayush Kumar Sahu

💻 ⚠️
Mihir Kulkarni
Mihir Kulkarni

💻
Abir
Abir

⚠️ 💻
Peter Ramos
Peter Ramos

💻
Samriddhi
Samriddhi

⚠️
Pranay Kharabe
Pranay Kharabe

💻
Damilola Oladele
Damilola Oladele

📖
Abhay Garg
Abhay Garg

💻 ⚠️
Sambhav Gupta
Sambhav Gupta

💻 ⚠️
Hippolyte Vergnol
Hippolyte Vergnol

💻 🚇
Jente Vets
Jente Vets

💻
Rishi
Rishi

💻
Ashish Padhy
Ashish Padhy

💻
Meet Agrawal
Meet Agrawal

🚇
Chinmay Shewale
Chinmay Shewale

💻 ⚠️
Mahfuza Humayra Mohona
Mahfuza Humayra Mohona

📖
Heiko Henning
Heiko Henning

💻
Zack_Aayush
Zack_Aayush

💻
Ayush Nautiyal
Ayush Nautiyal

💻
AnishKacham
AnishKacham

💻
Viacheslav Turovskyi
Viacheslav Turovskyi

💻
Amanpreet Singh Bedi
Amanpreet Singh Bedi

💻
Debajyoti Halder
Debajyoti Halder

💻
Savio Dias
Savio Dias

💻
Jonas Lagoni
Jonas Lagoni

💻 🤔 👀 ⚠️
Khuda Dad Nomani
Khuda Dad Nomani

💻 📖
Sergio Moya
Sergio Moya

💻
Vishal Sharma
Vishal Sharma

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

版本与发布记录

@asyncapi/cli 共发布 451 个版本,首次发布于 2021/06/18;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.3.0latest2026/11/07今天
6.2.32026/11/025 天前
6.2.22026/10/2712 天前
6.2.12026/10/1226 天前
6.2.02026/09/231 个月前
6.1.02026/09/151 个月前

关于 @asyncapi/cli 的常见问题

@asyncapi/cli 是什么?

All in one CLI for all AsyncAPI tools

如何安装 @asyncapi/cli?

在项目目录运行 npm install @asyncapi/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 asyncapi,可以用 npx asyncapi 直接运行。

@asyncapi/cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@asyncapi/cli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@asyncapi/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.11.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@asyncapi/cli 可以商用吗?

@asyncapi/cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@asyncapi/cli 的下载量有多少?

根据 npm 官方下载统计,@asyncapi/cli 在 2026/10/07 – 2026/11/05 这 30 天内被下载 300,001 次,日均约 10,000 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@asyncapi/cli 还在维护吗?

最新版本 6.3.0 发布于 2026/11/07(今天);至今共发布 451 个版本,其中过去 12 个月发布了 18 个;首次发布于 2021/06/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。