@grafana/create-plugin

中文文档
9.0.3发布于 2026/11/11Apache-2.0ES Module构建来源已验证近 30 天下载 9953

Create Grafana plugins with ease.

原始使用文档
文档目录7 节
  1. Create a new plugin
  2. Quick overview
  3. Migrate your existing plugin
  4. Update your plugin build config
  5. Customizing or extending the basic configs
  6. Add provisioning to your existing plugin
  7. Contributing

Grafana / Create Plugin

Create Grafana plugins with ease.

ToC

Links

@grafana/create-plugin works on macOS, Linux and Windows Subsystem for Linux (WSL).
If something doesn't work, please file an issue.
If you have questions or need help, please ask in GitHub Discussions.

Create a new plugin

Quick overview

Run the command in the folder where you want to store your plugins. The new plugin will be scaffolded in a sub-directory of the folder where you run the command.

Create Plugin can be used with NPM, PNPM or Yarn 1. The plugin will be scaffolded to use your preferred package manager. Run the command with the package manager of your choice:

npx

npx @grafana/create-plugin@latest

npm

npm init @grafana/plugin

pnpm

pnpm dlx @grafana/create-plugin@latest

yarn (berry)

yarn dlx @grafana/create-plugin@latest

yarn (1.x)

yarn create @grafana/plugin

Migrate your existing plugin

:warning: We do not support plugins written in angular

In case you have an existing plugin previously created using the @grafana/toolkit you can use the following command to migrate it to the new build tooling:

# Run this command from the root of your plugin
cd ./my-plugin

npx @grafana/create-plugin@latest migrate

For more information see here


Update your plugin build config

In case your plugin was using @grafana/toolkit before make sure to migrate it first using npx @grafana/create-plugin migrate.

As new Grafana versions come out we keep updating our plugin build tooling as well to stay compatible and to make it more performant. In order to receive these changes and to make sure your plugin is compatible with the most recent Grafana versions you can use the update command, that automatically updates the build configuration for you:

# Run this command from the root of your plugin
cd ./my-plugin

npx @grafana/create-plugin@latest update

For more information see here


Customizing or extending the basic configs

You can read more about customizing or extending the basic configuration in our documentation.

Add provisioning to your existing plugin

You can streamline the plugin review process by incorporating provisioning into your existing plugin, enabling reviewers to test your plugin more efficiently.

# Run this command from the root of your plugin
cd ./my-plugin

npx @grafana/create-plugin@latest provisioning

For more information see our documentation.


Contributing

We are always grateful for contributions! See CONTRIBUTING.md for more information.

版本与发布记录

@grafana/create-plugin 共发布 1,530 个版本,首次发布于 2022/09/08;过去 12 个月发布了 355 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
9.0.3latest2026/11/115 天前
9.0.22026/11/115 天前
9.0.12026/11/106 天前
9.0.02026/11/106 天前
8.0.22026/11/0412 天前
8.0.12026/11/0413 天前

其他发布通道:canary → 7.6.3-canary.2678.26587359388.0。

关于 @grafana/create-plugin 的常见问题

@grafana/create-plugin 是什么?

Create Grafana plugins with ease.

如何安装 @grafana/create-plugin?

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

@grafana/create-plugin 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/grafana__create-plugin 是否存在。

@grafana/create-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@grafana/create-plugin 需要什么版本的 Node.js?

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

@grafana/create-plugin 可以商用吗?

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

@grafana/create-plugin 的下载量有多少?

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

@grafana/create-plugin 还在维护吗?

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