@dimension-studios/ai-changelog

中文文档
1.0.8发布于 2026/10/27MITTypeScriptES Module构建来源已验证近 30 天下载 4146

Semantic-release plugin that generates AI release notes and posts them to Discord.

原始使用文档
文档目录14 节
  1. Contents
  2. Install
  3. Quick Start
  4. Configuration
  5. Required Options
  6. Optional Options
  7. Publishers
  8. Discord
  9. Slack
  10. Discord and Slack
  11. Retry Notifications
  12. GitHub Actions Retry
  13. CI and Testing
  14. License

@dimension-studios/ai-changelog

npm version CI Release License: MIT

AI-written release announcements for semantic-release. Generate one concise changelog message from the release diff, then publish it to Discord, Slack, or both.

Contents

Install

npm install --save-dev @dimension-studios/ai-changelog

Quick Start

Add the plugin after semantic-release has generated release notes:

export default {
  branches: ["main"],
  plugins: [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@dimension-studios/ai-changelog",
  ],
}

Set the required CI secrets:

AI_GATEWAY_API_KEY=...
AI_CHANGELOG_DISCORD_WEBHOOK=https://discord.com/api/webhooks/...
AI_CHANGELOG_SLACK_WEBHOOK=https://hooks.slack.com/services/...

At least one publisher webhook is required unless dryRun is enabled.

Configuration

export default {
  plugins: [
    [
      "@dimension-studios/ai-changelog",
      {
        branches: ["main"],
        model: "openai/gpt-5.4-nano",
        prompt: "Write concise release notes for non-developer readers.",
        discordWebhookUrl: process.env.AI_CHANGELOG_DISCORD_WEBHOOK,
        slackWebhookUrl: process.env.AI_CHANGELOG_SLACK_WEBHOOK,
        includePaths: ["src/", "packages/"],
        excludePaths: ["packages/generated/"],
        dryRun: false,
      },
    ],
  ],
}

Required Options

At least one publisher webhook is required unless dryRun is enabled.

OptionDefaultDescription
discordWebhookUrlAI_CHANGELOG_DISCORD_WEBHOOKDiscord webhook URL.
slackWebhookUrlAI_CHANGELOG_SLACK_WEBHOOKSlack incoming webhook URL.
gatewayApiKeyAI_GATEWAY_API_KEYVercel AI Gateway API key.

Optional Options

OptionDefaultDescription
modelopenai/gpt-5.4-nanoAI SDK Gateway model ID.
promptbuilt-in release announcement promptSystem prompt used to generate the announcement title and description.
branches["main"]Branches allowed to publish announcements.
includePathsall pathsGit path prefixes to include.
excludePathscommon generated/build filesExtra git paths to exclude.
dryRunfalseGenerate and log payloads without posting.

Publishers

Discord

Discord messages are sent as embeds with the generated title and description.

export default {
  plugins: [
    // ...other semantic-release plugins
    [
      "@dimension-studios/ai-changelog",
      {
        discordWebhookUrl: process.env.AI_CHANGELOG_DISCORD_WEBHOOK,
      },
    ],
  ],
}

Slack

Slack messages use Block Kit:

  • header block for the generated title
  • Markdown section block for the generated description
  • context block with version and branch metadata
  • top-level text fallback for notifications and accessibility
export default {
  plugins: [
    // ...other semantic-release plugins
    [
      "@dimension-studios/ai-changelog",
      {
        slackWebhookUrl: process.env.AI_CHANGELOG_SLACK_WEBHOOK,
      },
    ],
  ],
}

Create a Slack incoming webhook from your Slack app settings, then store the generated URL as AI_CHANGELOG_SLACK_WEBHOOK.

Discord and Slack

export default {
  plugins: [
    // ...other semantic-release plugins
    [
      "@dimension-studios/ai-changelog",
      {
        discordWebhookUrl: process.env.AI_CHANGELOG_DISCORD_WEBHOOK,
        slackWebhookUrl: process.env.AI_CHANGELOG_SLACK_WEBHOOK,
      },
    ],
  ],
}

Retry Notifications

If semantic-release succeeds but AI generation or webhook delivery fails, retry the notification without rerunning the release:

npx ai-changelog retry --branch main

By default, the retry command uses the latest reachable git tag, regenerates the AI announcement from the previous tag to that release tag, and posts to every configured publisher. Use --version for a specific release:

npx ai-changelog retry --version 1.0.1 --branch main

Retry only one publisher when the other message was already posted:

npx ai-changelog retry --version 1.0.1 --branch main --publisher slack
npx ai-changelog retry --version 1.0.1 --branch main --publisher discord

Use --dry-run to verify the generated payloads without posting:

npx ai-changelog retry --version 1.0.1 --branch main --dry-run

The retry command reads the same environment variables as the semantic-release plugin:

AI_GATEWAY_API_KEY=...
AI_CHANGELOG_DISCORD_WEBHOOK=https://discord.com/api/webhooks/...
AI_CHANGELOG_SLACK_WEBHOOK=https://hooks.slack.com/services/...

You can also override those values for a single local run with --gateway-api-key, --discord-webhook-url, and --slack-webhook-url.

GitHub Actions Retry

To make retries available from the GitHub Actions UI, add a manual workflow in your repository that checks out full git history, installs dependencies, builds the package, and runs ai-changelog retry. Expose only the retry-specific inputs operators need:

  • version: leave blank to retry the latest tag, or enter a version such as 1.0.1.
  • branch: the branch name shown in Slack/Discord metadata, for example main.
  • publisher: both, slack, or discord.
  • dry_run: preview payloads without sending webhook requests.

Use the same AI_GATEWAY_API_KEY, AI_CHANGELOG_DISCORD_WEBHOOK, and AI_CHANGELOG_SLACK_WEBHOOK secrets as your release workflow so retries use the same model and webhook configuration.

For a complete example, see this repository's retry-changelog.yml workflow.

CI and Testing

Use dryRun: true when validating the plugin in CI. The plugin still collects release context and generates notification payloads, but it does not call any webhooks.

export default {
  plugins: [
    // ...other semantic-release plugins
    [
      "@dimension-studios/ai-changelog",
      {
        dryRun: true,
      },
    ],
  ],
}

This package is verified with:

bun run check
bun run type-check
bun run knip
bun run test
bun run build

License

MIT

版本与发布记录

@dimension-studios/ai-changelog 共发布 11 个版本,首次发布于 2026/06/23;过去 12 个月发布了 11 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.8latest2026/10/2716 天前
1.0.72026/10/101 个月前
1.0.62026/08/302 个月前
1.0.52026/08/302 个月前
1.0.42026/08/302 个月前
1.0.12026/08/053 个月前

其他发布通道:beta → 1.0.0-beta.3。

关于 @dimension-studios/ai-changelog 的常见问题

@dimension-studios/ai-changelog 是什么?

Semantic-release plugin that generates AI release notes and posts them to Discord.

如何安装 @dimension-studios/ai-changelog?

在项目目录运行 npm install @dimension-studios/ai-changelog,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:semantic-release(^25.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 ai-changelog,可以用 npx ai-changelog 直接运行。

@dimension-studios/ai-changelog 支持 TypeScript 吗?

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

@dimension-studios/ai-changelog 支持 ESM 还是 CommonJS?

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

@dimension-studios/ai-changelog 需要什么版本的 Node.js?

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

@dimension-studios/ai-changelog 可以商用吗?

@dimension-studios/ai-changelog 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dimension-studios/ai-changelog 的下载量有多少?

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

@dimension-studios/ai-changelog 还在维护吗?

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