We are excited to announce the official release of **GIM (Git Intelligence Message) 2.0**!
GIM is a **command-line tool designed to automatically generate high-quality Git commit messages based on code changes**. It leverages AI to help you write more standardized, semantic, and readable commit messages. Version 2.0 represents a significant **core capability upgrade** from the 1.x series, specifically addressing the common pain points of customization and consistency encountered when using AI-generated commits in real-world projects.
Official Website: https://git-intelligence-message.pages.dev/
Repository: https://github.com/davelet/git-intelligence-message
Key New Features in GIM 2.0
1. Local Project Prompt Support (.gim Directory)
Version 2.0 introduces the ability to create a .gim folder in the root directory of your Git repository. This folder can store **project-specific prompt templates**:
your-project/
├── .git/
├── .gim/
│ ├── diff_prompt.txt
│ └── subject_prompt.txt
This enables:
- Each project to define its own AI prompt templates.
- Different projects to maintain their configurations independently, without sharing or modifying global settings.
- Team conventions and commit styles to be documented directly within the repository, ensuring **natural consistency among team members**.
2. Command-Line Temporary Prompt Overrides
Previous versions required prompt templates to be managed through global configuration files, lacking flexibility. Version 2.0 introduces command-line arguments for temporary overrides:
--diff-prompt <STRING>
--subject-prompt <STRING>
For example:
gim --diff-prompt "Analyze security implications of changes" \
--subject-prompt "Generate commit title in a standardized format"
This allows you to **temporarily override AI guidance for a specific commit**, which is ideal for:
- Temporarily crafting "security-related commits".
- Commits requiring a special format.
- Experimenting with new prompting strategies.
Prompt Precedence
- Command Line (Highest)
- Project-specific
.gimdirectory - Global Configuration
- Built-in Defaults
Standardizing Commit Conventions Per Project
In your project's root directory:
mkdir .gim
echo "Highlight security impacts when analyzing changes" > .gim/diff_prompt.txt
echo "Generate commit titles in a standardized format" > .gim/subject_prompt.txt
All team members will automatically adhere to these conventions without individual configuration.
Temporarily Overriding Prompts
gim --diff-prompt "Focus on performance improvements" \
--subject-prompt "Performance optimization commit"
Recommended Usage Patterns
gim: Generates a commit message based on staged file changes and commits.gim -a: Stages all unstaged changes, then generates and commits the message.gim -p: Amends the previous commit by incorporating the currently staged changes and regenerating the commit message based on both sets of changes.gim -ap: Combines the functionality ofgim -afollowed bygim -p(stage all, then amend commit).gim -t <SUB>: Specifies the commit title. If the-toption is not provided, the title is automatically summarized from the message content.gim update: Updates the GIM software. This can also be done viabrew upgrade git-intelligence-message.gim ai -m <model> -k <apikey> -u <url> -l <language>: Configures AI parameters. This command must be run beforehand; otherwise, executions with parameters will fail.-ldefaults to English and can be omitted.-uis the API endpoint. The software includes built-in endpoints; see https://github.com/davelet/git-intelligence-message?tab=readme-ov-file#built-in-model-support for details. If a model name matches a prefix, you can omit the URL. Starting from version 1.3.2, runninggim aiwithout arguments will display the current configuration.gim -v: Any command can include the-vflag for verbose output, showing detailed execution steps.gim prompt: View current prompts. Use--editto modify prompts, or--prompt <P>to specify the file to edit.
For more detailed usage information, consult the help messages:
gim -hgim ai -hgim update -hgim prompt -h