This module is designed to automatically generate a changelog for a project by summarizing the differences between commits. It uses the OpenAI API to create human-readable summaries of code changes. The changelog is saved in a Markdown file named after the current version of the project, as specified in the package.json file.
- Summarizes code changes between commits using OpenAI.
- Generates a Markdown-formatted changelog.
- The changelog filename includes the project's current version.
To generate a changelog, run the script with an optional argument specifying the number of commits to include in the changelog. If no argument is provided, the script defaults to the last commit.
generate-changelog [number_of_commits]
- Node.js
- An OpenAI API key set in the environment variable `OPENAI_API_KEY`.
To install this tool for generating changelogs, follow these steps:
-
Install the package globally:
You need to have Node.js installed on your system. Then, run the following command to install the package globally:
npm install -g @weirdscience/version
- Obtain an API key from OpenAI.
- Set the API key in your environment variables:
export OPENAI_API_KEY='your_api_key_here'