Goji
Commitizen-like Emoji Commit Tool written in Go and AI commit message generator (think cz-emoji and other commitizen adapters but in go) š
Install / Use
/learn @muandane/GojiREADME
goji
<img align="right" src="public/go-gopher.gif">[!NOTE] Commitizen-like tool for formatting commit messages using emojis written in go.
goji is an easy-to-use commit message formatting tool, inspired by Commitizen and cz-cli, that helps you create conventional commits with emojis with streamlined [git] commit process by providing a user-friendly TUI for selecting the type of change, scope, and description of your commit message..
? Select the type of change you are committing: (Use arrow keys)
⯠feature ⨠Introducing new features.
fix š Fixing a bug.
docs š Documentation change.
refactor šØ Improve structure/format of the code.
clean š„ Remove code or files.
? What is the scope of this change? (class or file name): (press [enter] to skip)
>
Features
- Interactive and Non-interactive CLI with sensible defaults for choosing commit types, scopes, and descriptions and signing off commits.
- Predefined commit types with corresponding emojis.
- Customizable commit types and scopes through a JSON configuration file.
- Supports Git out of the box
- AI generated commit messages using multiple providers:
- Gemini (OAuth login with Google account or API key, uses Gemini Flash)
- OpenRouter (default, access to multiple models, requires API key)
- Groq (fast inference, requires API key)
- Intelligent large diff handling with automatic summarization
- No rate limiting issues with smart diff compression
Install
Homebrew (macOs/Linux)
brew install --cask muandane/tap/goji
Linux (or WSL)
VERSION=$(curl --silent "https://api.github.com/repos/muandane/goji/releases/latest" | jq .tag_name -r)
curl -Lso goji.tar.gz https://github.com/muandane/goji/releases/download/$VERSION/goji_${VERSION}_Linux_x86_64.tar.gz
tar -xvzf goji.tar.gz
chmod +x ./goji
# optionnal
sudo mv ./goji /usr/local/bin/
Windows (winget)
winget install muandane.goji
Build locally
git clone https://github.com/muandane/goji.git && cd goji
# Auto-detect version from git tags (recommended)
VERSION=$(git describe --tags --always --dirty | sed 's/^v//')
go build -ldflags "-s -w -X github.com/muandane/goji/cmd.version=${VERSION}"
mv goji /usr/local/bin
goji --version
Or manually specify the version:
go build -ldflags "-s -w -X github.com/muandane/goji/cmd.version=0.1.8"
mv goji /usr/local/bin
goji --version
Build with Nix
git clone https://github.com/muandane/goji.git && cd goji
nix-build -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
Usage
Simply run goji in your terminal to start the interactive commit process:

If you don't want the interactive screen you can use the flags to construct a message:
goji --type feat --scope home --message "Add home page" --git-flag="--porcelain" --git-flag="--branch" --signoff --no-verify --add
-a, --add Automatically stage files that have been modified and deleted
--amend Change last commit
-n, --no-verify bypass pre-commit and commit-msg hooks
Check command
To check if a commit message is conventional run:
goji check
To use the check command, add the following to your pre-commit hook in your git repository:
- repo: https://github.com/muandane/goji
rev: v0.0.8
hooks:
- id: goji-check
name: goji check
description: >
Check whether the current commit message follows commiting rules. Allow empty commit messages by default, because they typically indicate to Git that the commit should be aborted.
Draft command
The draft command allows you to generate a commit message for staged changes using various AI providers.
goji draft
This command connects to an AI provider to generate a commit message based on your staged changes.
Quick Start
1. Set up authentication:
# For Gemini (OAuth - recommended, like Gemini CLI)
export GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
# OR for Gemini (API key)
export GEMINI_API_KEY="your-gemini-api-key"
# For OpenRouter (default)
export OPENROUTER_API_KEY="your-openrouter-api-key"
# For Groq
export GROQ_API_KEY="your-groq-api-key"
2. Generate and commit:
git add .
goji draft --commit
Basic Usage
# Generate a commit message (interactive)
goji draft
# Generate and commit directly
goji draft --commit
# Generate with detailed body
goji draft --body
# Generate and commit with detailed body
goji draft --body --commit
Command Options
-c,--commit: Commit the generated message directly.-b,--body: Generate a detailed commit message with body.-t,--type: Override the commit type (e.g., feat, fix, docs).-s,--scope: Override the commit scope (e.g., api, ui, core).
AI Providers
Goji supports multiple AI providers for generating commit messages. Configure your preferred provider in the .goji.json file:
1. Gemini (OAuth Login - Like Gemini CLI)
Use your Google account to authenticate with Gemini, or use an API key. Uses Gemini Flash by default.
Setup with OAuth (Recommended - Browser Login):
Similar to Gemini CLI's "Login with Google" feature - just open browser and sign in!
-
One-time setup: Get an OAuth client ID:
- Visit: https://console.cloud.google.com/apis/credentials
- Click "Create Credentials" ā "OAuth client ID"
- Application type: Desktop app
- Name it (e.g., "Goji CLI")
- Copy the Client ID (you don't need the secret with PKCE)
-
Set the client ID:
export GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com" -
Run goji:
goji draft- Browser will open automatically
- Sign in with your Google account
- Token is saved for future use
Setup with API Key (Simpler):
export GEMINI_API_KEY="your-gemini-api-key"
Configuration:
{
"aiprovider": "gemini",
"aichoices": {
"gemini": {
"model": "gemini-3-flash-preview"
}
}
}
Available Models:
gemini-3-flash-preview(default, recommended)gemini-1.5-progemini-1.5-flash
Authentication Methods:
-
Login with Google (OAuth - Recommended) - Like Gemini CLI
- One-time setup: Create OAuth client ID in Google Cloud Console
- Set
GOOGLE_CLIENT_IDenvironment variable - Browser opens automatically for login
- No API key needed
- Uses PKCE flow (secure, no client secret required)
-
API Key - Simpler alternative
- Get from Google AI Studio
- Set
GEMINI_API_KEYenvironment variable
2. OpenRouter (Default)
Access to multiple AI models through a single API. Requires an OpenRouter API key.
Setup:
export OPENROUTER_API_KEY="your-openrouter-api-key"
Configuration:
{
"aiprovider": "openrouter",
"aichoices": {
"openrouter": {
"model": "anthropic/claude-3.5-sonnet"
}
}
}
Available Models:
anthropic/claude-3.5-sonnet(default)openai/gpt-4oopenai/gpt-4o-minimeta-llama/llama-3.1-405b-instructgoogle/gemini-pro-1.5
3. Groq
Fast inference with various models. Requires a Groq API key.
Setup:
export GROQ_API_KEY="your-groq-api-key"
Configuration:
{
"aiprovider": "groq",
"aichoices": {
"groq": {
"model": "mixtral-8x7b-32768"
}
}
}
Available Models:
mixtral-8x7b-32768(default)llama2-70b-4096llama2-13b-chatgemma-7b-it
Large Diff Handling
Goji automatically handles large diffs using intelligent summarization:
- Small diffs (<20k chars): Processed normally
- Large diffs (>20k chars): Automatically summarized to key changes only
- Smart compression: Reduces large diffs by 90%+ while preserving important context
- No rate limits: Single API call prevents token limit issues
Examples
Basic commit generation:
# Stage your changes
git add .
# Generate commit message
goji draft
# Generate and commit directly
goji draft --commit
Detailed commit with body:
# Generate detailed commit with body
goji draft --body --commit
Override type and scope:
# Force a specific type and scope
goji draft --type feat --scope api --commit
Using different AI providers:
# Switch to Groq (requires GROQ_API_KEY)
goji draft --commit
# Switch to OpenRouter (requires OPENROUTER_API_KEY)
goji draft --commit
Configuration
Update your .goji.json to configure AI providers:
{
"aiprovider": "gemini",
"aichoices": {
"gemini": {
"model": "gemini-3-flash-preview"
},
"groq": {
"model": "mixtral-8x7b-32768"
},
"openrouter": {
"model": "anthropic/claude-3.5-sonnet"
}
}
}
Environment Variables
Goji uses environment variables to authenticate with AI providers. Set these in your shell profile (.bashrc, .zshrc, etc.) or export them before running commands.
Required Environment Variables
| Provider | Environment Variable | Required | Description |
|----------|---------------------|----------|-------------|
| Gemini | GOOGLE_CLIENT_ID (for OAuth) or GEMINI_API_KEY (for API key) | ā | OAuth via browser login (like Gemini CLI) - set GOOGLE_CLIENT_ID once, then browser opens automatically. Or use API key from Google AI Studio |
| OpenRouter | OPENROUTER_API_KEY | ā
| Get from OpenRouter |
| Groq | GROQ_API_KEY | ā
| Get fro
