git-do is an extension for git to give your commit messages some extra ✨ pizzazz ✨ with the help of AI.
Note
git do is still experimental and subject to change. While I don't expect there to be any huge breaking changes, be aware that there may be breaking changes introduced until a formal v1 is released.
git-do adds a do subcommand to your git CLI. It connects to any Large Language Model API that conforms to the OpenAI API Spec to automate and enhance common git workflows.
| Command | What does it do? |
|---|---|
git do commit |
Generate a commit message of your staged changes and automatically commit. |
git do explain |
Explain the changes made in a commit, or range of commits. |
git do init |
Initialize the git do tool and setup the project config file. |
git do status |
Enhanced version of git status that includes a brief explanation of the changes. |
You can see all, detailed, usage information by running git do help.
Compile the CLI using Go:
go install github.com/julianwyz/git-do/cmd/git-do@latestThen move the binary to your system's $PATH. It will then be available at git do ....
Once you've installed the CLI, run git do init in your project's directory. This will setup the project-level configuration, your user credentials for accessing LLM services and will even initialize an empty git repo if you haven't done so already.
After running git do init, a .do.toml file will be created in your directory.
The available options are:
# The config file version. "1" is the only accepted value.
version = "1"
# A BCP 47 language tag that will be provided to the LLM.
# When used with multi-lingual models, all generated content will be in this language.
language = "en-US"
[llm]
# The base URL to access the LLM API.
api_base = "https://api.openai.com/v1"
# The model to use.
model = "gpt-5-mini"
[llm.context]
# An optional file that will be provided to the LLM to provide
# context on your project and to tune responses.
file = "CONTEXT.md"
[llm.reasoning]
# Optionally specify the intensity of reasoning models.
level = "low"
[commit]
# The commit message standard to use.
# Supported values: "github", "conventional"
format = "github"git do utilizes the OpenAI API standard. Any API that conforms to this standard may be used, including local models through tools like Ollama.
The git do credentials file is located at: $HOME/.gitdo/credentials.
This file is interpreted as an INI file. For example:
[default]
api_key = hello_worldThe default section will be used for all API calls to the LLM API unless there is a matching hostname defined in your credentials.
When interacting with a git do project that is configured with an api_base of https://api.openai.com/v1, a section with the key api.openai.com will be used instead.
[default]
api_key = hello_world
[api.openai.com]
api_key = something_elseThis allows you to easily use git do in multiple projects with multiple LLM providers simultaneously.
Commit messages to me are almost as important as the code change itself.
- Linus Torvalds
We all know that git commit messages are important. A good commit message can help document your code, educate new-comers to a codebase and is an all-around good thing.
We also all know that commit messages have a tendency to get... well... I think XKCD summed it up best:
This is the core motivation behind git-do. It is designed to easily integrate into your workflow and help you craft more robust, accurate and informative commit messages.
Thanks for considering contributing to this project! Feel free to open Github Issues and/or Pull Requests with any contribution you may have. More info is available in CONTRIBUTING.md.
