commit is an AI-powered commit message generator that helps you streamline your version control workflow.
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.
- 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
pushcommand 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.
go install github.com/kaatinga/commit@latest
commit [global options] command [command options] [arguments...]
commit(default): Generate a commit message and commit changes.push: Generate a commit message, commit changes, and push to remote.
--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.
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--keyoption directly.COMMIT_DRYRUN: Set totrueto enable dry-run mode, which will display the generated commit message without actually committing.
commit
commit --key sk-your-api-key-here
commit --path /home/user/my-repo
commit push
export COMMIT_DRYRUN=true
commit
For further help or to view a list of commands, run:
commit help