Skip to content

Latest commit

 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clg

clg screenshot

A terminal UI tool that generates commit messages following the Conventional Commits standard — straight from your staged git diff, so you don't have to think about the format every time you commit.

Developers often write lazy commit messages ("fix bug", "update", "wip") because getting the format right takes time and effort. clg reads your staged changes and generates a draft commit message powered by AI (Groq + Qwen3.8-27B by default).

Key Features

  • AI-powered generation — reads git diff --staged and produces a Conventional Commits draft automatically
  • Interactive TUI — accept, edit, retry, or write manual commits from a keyboard-driven interface
  • Multi-language — generate commit messages in English or Bahasa Indonesia
  • Flexible AI providers — works with any OpenAI-compatible provider (Groq, OpenAI, local Ollama, etc.)
  • Retry with fallback — automatically retries with a fallback model if the primary model fails
  • Rate-limit handling — respects try again in Ns responses from Groq with automatic retry
  • Simple configuration — set your provider, model, and language in a single ~/.commitlintgenrc.json file
  • Single static binary — no runtime required, instant startup (~3 MiB memory)

Tech Stack

Category Technology
Language Rust (edition 2024)
Package manager Cargo
Terminal UI ratatui + crossterm
HTTP client reqwest (rustls)
AI client OpenAI-compatible (default: Groq + Qwen3.8-27B)
Text width unicode-width

Supported Platforms

Prebuilt Rust binaries are published to npm via the commitlg package. The npm package is just a shim — it detects your OS and delegates to a native binary. No Node.js runtime needed at execution time.

Platform Architecture Install command
Linux x86_64 npm i -g commitlg
Windows x86_64 npm i -g commitlg

Install a specific channel:

npm i -g commitlg@beta     # pre-release channel (Rust binary, auto-updated)
npm i -g commitlg@latest   # stable release (Rust binary)

Build from source:

git clone https://github.com/dhodo999/commit-lint-gen.git
cd commit-lint-gen
cargo build --release
./target/release/clg

Usage

1. Configure API key

clg config

This creates ~/.commitlintgenrc.json with your Groq API key, model, and language preference.

2. Stage your changes and run

git add .
clg

The TUI opens with a generated commit message. Use the menu:

Key Action
Enter Commit with the generated message
e Edit the message
r Retry — regenerate a new suggestion
l Switch language (EN ↔ ID)
m Manual mode — write your own commit message
q Quit without committing

Arrow keys ← → navigate the menu. Arrow keys ↑ ↓ navigate inside the editor.

Manual commit

Select Manual from the menu, type your commit message, and press Enter to commit directly.

Configuration

The config file lives at ~/.commitlintgenrc.json:

{
  "aiProvider": "groq",
  "apiKey": "your_groq_api_key_here",
  "baseURL": "https://api.groq.com/openai/v1",
  "language": "en",
  "model": "qwen/qwen3.8-27b"
}

Using other AI providers:

{
  "apiKey": "your_api_key",
  "baseURL": "https://api.openai.com/v1",
  "model": "gpt-4o-mini"
}

Any OpenAI-compatible API works. Change baseURL and model to match your provider.

Performance

Metric Value
Cold-start < 5 ms
Resident memory (idle) ~3-5 MiB
Disk size (release, stripped) ~3 MiB
System dependencies None
API latency (Groq, cold) ~400 ms

Contributing

This project is open source and welcomes contributions. Feel free to open an issue or pull request.

License

MIT

About

A CLI tool that lints and generates commit messages following the Conventional Commits standard — straight from your staged git diff, so you don't have to think about the format every time you commit.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages