chlog is a powerful and flexible CLI (Command-Line Interface) application written in Python, designed to leverage AI in generating meaningful changelogs between two git commits. It's a must-have tool for developers who want to automate their changelog generation process.
- Python 3.7 or later
- Git installed in your system
- Clone the repository:
git clone https://github.com/nathanielheitsch/chlog.git
- Navigate into the cloned repository:
cd chlog
- Install the requirements:
pip install -r requirements.txt
- Run the script:
python main.py
chlog requires two parameters:
new_commit
(optional): The latest commit hash. By default, it is set toNone
.old_commit
(optional): The previous commit hash. By default, it is set toNone
.
Optional Flags:
--token
(optional): API Token for AI Services [default: None]--title
(optional): Title of the changelog [default: None]
python main.py [NEW_COMMIT] [OLD_COMMIT]
If you wish to use an API token for AI services, you can do so with the --token
option:
python main.py --token YOUR_API_TOKEN [NEW_COMMIT] [OLD_COMMIT]
While the --token
option is available for single uses, chlog also supports persistently storing your API token as an environment variable for repeated use. Here's how you can set it up:
Open your terminal, and add the following to your ~/.bashrc
, ~/.bash_profile
, or ~/.zshrc
file:
export CHLOG_API_KEY="your-api-token"
Then, source the file:
source ~/.bashrc
Or, replace ~/.bashrc
with whichever file you appended the export line to.
In Powershell, you can set an environment variable like this:
$env:CHLOG_API_KEY="your-api-token"
Remember to replace "your-api-token"
with your actual API token.
For permanently setting the environment variable on Windows, follow these steps:
- Right-click on Computer.
- Click on 'Properties'.
- Click on 'Advanced system settings'.
- In the System Properties window, click on the 'Environment Variables' button.
- Click on the 'New' button under the 'User variables' or 'System variables' section (depending on your needs), and enter
CHLOG_API_KEY
as the variable name and your actual API token as the variable value.
Now, whenever you use chlog, it will automatically read your API token from the environment variable CHLOG_API_KEY
. This eliminates the need to input your API token each time you use the tool.
If you need more information, use the --help
option:
python main.py --help
This will provide you with the necessary information on how to use the application.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Distributed under the MIT License. See LICENSE
for more information.