JSPM

ai-changelog-generator

0.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q66010F
  • License MIT

An npm command line tool that generates changelogs in keep-a-changelog format using OpenAI or XAI

Package Exports

  • ai-changelog-generator
  • ai-changelog-generator/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ai-changelog-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

AI Changelog Generator

An npm command line tool that generates changelogs in Keep a Changelog format using AI services (XAI or OpenAI).

Features

  • 🤖 AI-Powered: Uses XAI (default) or OpenAI to generate meaningful changelog entries
  • 📝 Keep a Changelog Format: Generates changelogs following the standard format
  • 🔍 Dry Run Mode: Test the output before writing to files
  • 📁 Flexible Output: Create new files or append to existing changelogs
  • 🔑 Environment Variables: Supports API keys from environment variables
  • Simple CLI: Easy-to-use command line interface with yargs

Installation

npm install -g ai-changelog-generator

Or use locally in your project:

npm install ai-changelog-generator
npx ai-changelog

Usage

Basic Usage

# Generate changelog for version 1.2.0 (uses XAI by default)
ai-changelog -v 1.2.0

# Use OpenAI instead
ai-changelog -v 1.2.0 -p openai

# Dry run - see output without writing to file
ai-changelog -v 1.2.0 -d

# Append to existing changelog
ai-changelog -v 1.2.0 -a

Advanced Usage

# Generate changelog for commits since a specific date
ai-changelog -v 1.2.0 -s "2024-01-01"

# Generate changelog for commits since 1 week ago
ai-changelog -v 1.2.0 -s "1 week ago"

# Specify custom output file
ai-changelog -v 1.2.0 -o MY_CHANGELOG.md

# Provide API key directly
ai-changelog -v 1.2.0 -k your-api-key-here

API Keys

The tool requires API keys for the AI services. You can provide them in two ways:

For XAI (default):

export XAI_API_KEY="your-xai-api-key"
# or
export X_API_KEY="your-xai-api-key"

For OpenAI:

export OPENAI_API_KEY="your-openai-api-key"

Command Line Option

ai-changelog -v 1.2.0 -k your-api-key-here

Command Line Options

Option Alias Description Default
--version -v Version number for the changelog entry Required
--provider -p AI provider (xai or openai) xai
--api-key -k API key for the AI provider From env vars
--output -o Output file path CHANGELOG.md
--dry-run -d Print changelog without writing to file false
--append -a Append to existing changelog false
--since -s Generate changelog since this date Last 10 commits
--help -h Show help

Example Output

The tool generates changelogs in the standard Keep a Changelog format:

## [1.2.0] - 2024-01-15

### Added
- New user authentication system
- Support for multiple file formats

### Changed
- Improved error handling in API requests
- Updated dependencies to latest versions

### Fixed
- Fixed memory leak in file processing
- Resolved issue with special characters in filenames

### Security
- Enhanced input validation
- Updated authentication tokens

Requirements

  • Node.js >= 14.0.0
  • Git repository (the tool reads git log)
  • API key for XAI or OpenAI

License

MIT © Tantawowa