1 unstable release
Uses new Rust 2024
| 0.1.0 | Jan 23, 2026 |
|---|
#1148 in Machine learning
43KB
1K
SLoC
$gh <✨/sparkle>
A GitHub CLI extension that brings VS Code's "Generate Commit Message" flow to your terminal. It reads staged changes, asks GitHub Models for a Conventional Commit message, and commits it automatically.
Why sparkle
The name comes from the ✨/sparkle icon in VS Code's "Generate Commit Message"
action. I wanted the same flow inside gh: stage, generate, commit.
Features
- Copilot-style commit message generation from staged diffs
- Handles large changes with summary + trimming
- Defaults to
autowith safe input trimming for large changes - Supports
--language,--examples, and--model - Commits staged changes automatically
Installation
gh extension install dyxushuai/gh-sparkle
Usage
Stage your changes and run:
git add .
gh sparkle
Options
-l, --language <LANGUAGE>: Output language for the commit message. Default:english.-e, --examples[=<N>]: Include recent commit messages as examples. If provided without a value, it uses3. Valid range:1..=20.-m, --model <MODEL>: GitHub Models model to use. Default:auto(resolved viamodelPolicy.autoModelsin the prompt config, tried in order until a request succeeds).
# Generate commit message in a different language
gh sparkle --language chinese
# Add previous commit messages as examples (default 3 when flag is present)
gh sparkle --examples
# Or specify the number of examples (max 20)
gh sparkle --examples 5
# Use a different GitHub Models model
gh sparkle --model xai/grok-3-mini
Prerequisites
- GitHub CLI installed and authenticated (
gh auth login) - A git repository with staged changes
If you use GitHub Enterprise, make sure your host is authenticated:
gh auth login --hostname <your-host>
Notes
- The extension commits automatically using the generated message.
- If there are no staged changes, it exits without committing.
- Large diffs are truncated to fit model input limits.
Upgrade
gh extension upgrade sparkle
Large changes handling
For big diffs, it summarizes and trims input, then retries with a smaller budget when
needed. Input budgets and model policy are defined in
assets/commitmsg.prompt.yml.
Dependencies
~9–29MB
~393K SLoC