https://github.com/kaatinga/commit
AI-powered commit message generator CLI tool
https://github.com/kaatinga/commit
Last synced: 5 months ago
JSON representation
AI-powered commit message generator CLI tool
- Host: GitHub
- URL: https://github.com/kaatinga/commit
- Owner: kaatinga
- License: mit
- Created: 2023-10-07T00:47:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-28T18:57:01.000Z (8 months ago)
- Last Synced: 2025-10-28T20:37:09.397Z (8 months ago)
- Language: Go
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/kaatinga/commit/actions/workflows/test.yml)
[](https://github.com/kaatinga/commit/releases)
[](https://github.com/kaatinga/commit/blob/main/LICENSE)
[](https://github.com/kaatinga/commit/actions?query=workflow%3Alinter)
[](https://github.com/kaatinga/commit/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
# commit CLI Tool
`commit` is an AI-powered commit message generator that helps you streamline your version control workflow.
## Overview
Instead of racking your brains for a descriptive commit message, simply run the `commit` tool. It will automatically
stage all changed files in your git repository and craft a concise, meaningful commit message for you.
## Features:
- Leverages OpenAI to generate commit messages based on your code changes.
- Automatically stages all changed files in the git repository.
- Commits with the AI-generated message.
- Optional `push` command to commit and push in one step.
- Dry-run mode to preview commit messages without committing.
- Works with user-provided API keys and repository paths.
## Installation:
go install github.com/kaatinga/commit@latest
## Usage:
commit [global options] command [command options] [arguments...]
### Commands:
- `commit` (default): Generate a commit message and commit changes.
- `push`: Generate a commit message, commit changes, and push to remote.
### Global Options:
- `--key value`: Provide a valid key to work with OpenAI API.
- `--path value`: Specify the path to your git repository (default: current directory).
- `--help, -h`: Display help information.
- `--version, -v`: Print the current version of the tool.
## Environment Variables:
- `OPENAI_API_KEY`: The tool can optionally read from this environment variable to interface with the OpenAI API. Set this variable if you don't intend to use the `--key` option directly.
- `COMMIT_DRYRUN`: Set to `true` to enable dry-run mode, which will display the generated commit message without actually committing.
## Examples:
### Basic usage (uses OPENAI_API_KEY environment variable):
commit
### With explicit API key:
commit --key sk-your-api-key-here
### Specify a different repository path:
commit --path /home/user/my-repo
### Commit and push in one command:
commit push
### Dry-run mode (preview commit message without committing):
export COMMIT_DRYRUN=true
commit
For further help or to view a list of commands, run:
commit help