gelf is a Go-based CLI tool that generates Git commit messages and AI-assisted pull request titles/descriptions using Vertex AI (Gemini). It analyzes git changes and provides a modern, interactive TUI interface built with Bubble Tea.
- π€ AI-Powered: Intelligent commit message generation using Vertex AI (Gemini)
- π PR Creation: Generate pull request titles and descriptions with AI
- π¬ Interactive Revisions: Refine generated PR titles and bodies with chat-style instructions
- π¨ Clean TUI: Simple and intuitive user interface built with Bubble Tea
- β‘ Fast Processing: Real-time progress indicators during generation
- π‘οΈ Safe Operations: Commit generation uses staged changes for a secure workflow
- π Cross-Platform: Works seamlessly across different operating systems
- π Multi-language Support: Generate commit messages and PRs in multiple languages
- Go 1.24.3 or higher
- Google Cloud account with Vertex AI API enabled
- Git (required for commit operations)
git clone https://github.com/EkeMinusYou/gelf.git
cd gelf
go buildgo install github.com/EkeMinusYou/gelf@latestbrew tap ekeminusyou/gelf
brew install ekeminusyou/gelf/gelfIf macOS blocks execution due to the quarantine attribute, remove it with:
sudo xattr -d com.apple.quarantine "$(which gelf)"gelf supports both configuration files and environment variables. Configuration files provide a more organized approach for managing settings.
Create a gelf.yml file in one of the following locations (in order of priority):
./gelf.yml- Project-specific configuration$XDG_CONFIG_HOME/gelf/gelf.yml- XDG config directory~/.config/gelf/gelf.yml- Default XDG config location~/.gelf.yml- Legacy home directory location
vertex_ai:
project_id: "your-gcp-project-id"
location: "global" # optional, default: global
model:
flash: gemini-3-flash-preview
pro: gemini-3.1-pro-preview
language: "english" # optional, default: english
commit:
model: "flash" # optional, default: flash
language: "english" # optional, inherits from global language
pr:
model: "pro" # optional, default: pro
language: "english" # optional, inherits from global language
title_language: "english" # optional, inherits from pr.language
body_language: "english" # optional, inherits from pr.language
color: "always" # optional, default: alwaysYou can also configure using environment variables:
# Path to your service account key file (gelf-specific, takes priority)
export GELF_CREDENTIALS="/path/to/your/service-account-key.json"
# Alternative: Standard Google Cloud credentials (used if GELF_CREDENTIALS is not set)
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"
# Google Cloud project ID
export VERTEXAI_PROJECT="your-project-id"
# Vertex AI location (optional, default: global)
export VERTEXAI_LOCATION="global"Note: Model configuration and language settings can only be configured via configuration file, not environment variables.
Note: If Application Default Credentials (ADC) are already available (e.g., via gcloud auth application-default login, Workload Identity, or GCE/GKE metadata), you can omit both credential environment variables.
- Create a service account in Google Cloud Console
- Grant the "Vertex AI User" role
- Download the JSON key file
- Set the
GELF_CREDENTIALSenvironment variable to the file path (recommended), or provide ADC viaGOOGLE_APPLICATION_CREDENTIALSorgcloud auth application-default login/ Workload Identity / GCE/GKE metadata
- Stage your changes:
git add .- Generate and commit with AI:
gelf commit- Interactive TUI operations:
- Review the AI-generated commit message
- Press
yto approve ornto cancel - Press
eto edit the commit message - Press
qorCtrl+Cto cancel during generation - The commit will be executed automatically upon approval
- Success message displays after TUI exits
Generate pull requests with AI-generated titles and descriptions based on committed changes:
gelf pr createAfter the PR title and description are generated, the interactive prompt lets you:
- Press
yto create the pull request with the generated content - Press
rto enter chat-style revision instructions (e.g. "shorten the title", "add a Testing section in Japanese"). gelf re-generates the title/body using your feedback and asks again β repeat as many times as you like. - Press
n(orEsc/q) to cancel without creating a PR
Options:
--draftto create a draft PR--dry-runto print the generated title/body without creating a PR--renderto render markdown in dry-run output (default: true)--no-renderto disable markdown rendering in dry-run output--modelto override the model for PR generation--languageto set the output language for both title and body--title-languageto set the language for PR title only--body-languageto set the language for PR body only--yesto skip confirmation prompt (also skips the revise step)
# Show help
gelf --help
# Show commit command help
gelf commit --help
# Generate commit message with TUI interface (default behavior)
gelf commit
# Generate commit message only with diff display (for debugging)
gelf commit --dry-run
# Generate commit message only without diff (for external tool integration)
gelf commit --dry-run --quiet
# Use specific model temporarily
gelf commit --model gemini-2.0-flash-exp
# Generate commit message in a specific language
gelf commit --language japanese
# Automatically approve commit message
gelf commit --yes
# Create a pull request with AI-generated title/body
gelf pr create
# Create a draft pull request
gelf pr create --draft
# Preview generated PR title/body without creating a PR
gelf pr create --dry-run
# Preview without markdown rendering
gelf pr create --dry-run --no-render
# Use specific model and language for PR generation
gelf pr create --model gemini-2.0-flash-exp --language japanese
# Use different languages for title and body
gelf pr create --title-language english --body-language japanese
# Skip confirmation prompt
gelf pr create --yes
gelf supports generating commit messages and pull request content in multiple languages. You can configure language settings both through configuration files and command-line options.
While gelf can work with any language supported by Gemini models, common examples include:
english(default)japanesespanishfrenchgermanchinesekorean- And many more...
# Set language for specific commands
gelf commit --language japanese
gelf pr create --language french
# Use different languages for different operations
gelf commit --language english
gelf pr create --language japanese
# Use different languages for PR title and body
gelf pr create --title-language english --body-language japaneselanguage: "japanese" # Global default language
commit:
language: "japanese" # Language for commit messages
pr:
language: "english" # Language for pull request titles and descriptions
title_language: "english" # Override language for PR title only
body_language: "japanese" # Override language for PR body onlyIf no language is specified, commit messages and PR content will use English.
- Command-line flags (highest priority)
--languagesets both title and body language--title-languageoverrides title language specifically--body-languageoverrides body language specifically
- Configuration file command-specific settings (
commit.language/pr.language/pr.title_language/pr.body_language) - Configuration file global setting (
language) - Default value (
english)
This allows you to set a global default language, override it for specific commands, and even use different languages for PR titles and bodies.
- Commit Target: Staged changes only (
git diff --staged) - PR Target: Committed changes between base branch and
HEAD - AI Provider: Vertex AI (Gemini models)
- Default Flash Model: gemini-3-flash-preview
- Default Pro Model: gemini-3.1-pro-preview
- UI Framework: Bubble Tea (TUI)
- CLI Framework: Cobra
cmd/
βββ root.go # Root command definition
βββ commit.go # Commit command implementation
βββ pr.go # Pull request command implementation
internal/
βββ git/
β βββ diff.go # Git operations (staged and unstaged diffs)
β βββ branch.go # Branch and commit range helpers
βββ github/
β βββ template.go # GitHub PR template resolution
βββ ai/
β βββ vertex.go # Vertex AI integration (commit messages and PR generation)
βββ ui/
β βββ tui.go # Bubble Tea TUI implementation (commit)
βββ config/
βββ config.go # Configuration management (API keys etc)
main.go # Application entry point
The application provides a clean, interactive terminal interface for commit and PR generation:
- Loading indicator while generating commit messages
- Review screen for generated commit messages with approval options
- Success confirmation after successful commits
- Loading indicator while generating PR title and description
- Review screen showing the generated title and (optionally rendered) body
- Choose between creating, revising via chat instructions, or cancelling
- When revising, type your feedback (e.g. "make it more concise") and gelf regenerates the title/body β loop until you are satisfied
The interface features color-coded states, animated progress indicators, and intuitive keyboard controls for a smooth user experience.
Settings are applied in the following order (highest to lowest priority):
- Environment variables (for Vertex AI settings only)
- Configuration file (
gelf.yml) - Default values
vertex_ai:
project_id: string # Google Cloud project ID
location: string # Vertex AI location (default: global)
model:
flash: string # Gemini Flash model to use (default: gemini-3-flash-preview)
pro: string # Gemini Pro model to use (default: gemini-3.1-pro-preview)
language: string # Global default language (default: english)
commit:
model: string # Model for commits: "flash", "pro", or custom (default: flash)
language: string # Language for commit messages (inherits from global if not set)
max_diff_bytes: number # Maximum staged diff size sent to the AI (default: 100000)
pr:
model: string # Model for pull requests: "flash", "pro", or custom (default: pro)
language: string # Language for pull request titles and descriptions (inherits from global if not set)
title_language: string # Language for PR title only (inherits from pr.language if not set)
body_language: string # Language for PR body only (inherits from pr.language if not set)
color: string # Color output setting: "always" or "never" (default: always)| Variable | Description | Default Value | Required |
|---|---|---|---|
GELF_CREDENTIALS |
Path to service account key file (gelf-specific, takes priority) | - | |
GOOGLE_APPLICATION_CREDENTIALS |
Path to service account key file (ADC fallback) | - | |
VERTEXAI_PROJECT or GOOGLE_CLOUD_PROJECT |
Google Cloud project ID | - | β |
VERTEXAI_LOCATION |
Vertex AI location | global |
β |
*Either GELF_CREDENTIALS or GOOGLE_APPLICATION_CREDENTIALS is required unless ADC is already available (e.g., gcloud auth application-default login, Workload Identity, or GCE/GKE metadata). If both are set, GELF_CREDENTIALS takes priority.
Note: Model configuration and language settings are only available through configuration files.
# Install dependencies
go mod download
# Build the project
go build
# Run tests
go test ./...
# Tidy dependencies
go mod tidygo build # Build the project
go test ./... # Run tests
go mod tidy # Tidy dependencies
go run main.go commit # Run commit command in development
go run main.go commit --dry-run # Run message generation only
go run main.go pr create # Run PR creation in developmentgoogle.golang.org/genai- Official Gemini Go clientgithub.com/charmbracelet/bubbletea- TUI frameworkgithub.com/charmbracelet/lipgloss- Styling and layoutgithub.com/charmbracelet/bubbles- TUI components (spinner)github.com/charmbracelet/glamour- Markdown rendering for pull request bodiesgithub.com/spf13/cobra- CLI frameworkgopkg.in/yaml.v3- YAML configuration file support
Pull requests and issues are welcome!
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
- Bubble Tea - For enabling beautiful TUI experiences
- Vertex AI - For providing powerful AI capabilities
- Cobra - For excellent CLI experience
Made with β€οΈ by EkeMinusYou