@335g/pi-git
v0.0.8
Published
Git utilities extension for pi-coding-agent
Maintainers
Readme
@335g/pi-git
A pi-coding-agent extension that adds a /commit command for generating Conventional Commits messages using LLM or heuristic fallback.
Features
/commitcommand – Stage all changes and generate a commit message in one step- Inline message support –
/commit fix typouses the message directly without AI generation - AI-powered generation – Leverages pi's LLM to produce Conventional Commits messages from staged diffs
- Heuristic fallback – When the LLM is unavailable, generates a commit message from diff analysis
- Language support – Commit message (subject and body) can be written in English or Japanese (configured via
.pi-git/config.toml) - Interactive confirmation – Review, edit, or cancel the proposed commit message before executing
- Merge conflict detection – Refuses to commit when a merge is in progress
Installation
pi install @335g/pi-gitOr add it to your pi package config:
{
"packages": {
"@335g/pi-git": "latest"
}
}Usage
Basic commit
In a pi session, inside a git repository:
/commitThis will:
- Check for merge conflicts
- Check for uncommitted changes
- Stage all files (
git add -A) - Analyze the staged diff
- Generate a Conventional Commits message via LLM
- Present the message for confirmation
- Execute the commit
Inline commit message
/commit fix typo in headerSkips AI generation and commits directly with the provided message.
Configuration
Create .pi-git/config.toml in your project root to set the commit body language:
# .pi-git/config.toml
lang = "ja" # Commit message in Japanese (default: "en" — English)Commit Message Convention
Generated messages follow the Conventional Commits specification:
type(scope): subject
body
footerTypes
| Type | Description |
|------------|-----------------------------------------------------|
| feat | New feature, command, option, or API |
| fix | Bug fix or correction of unintended behavior |
| refactor | Code structure improvement without behavior change |
| chore | Build config, dependencies, CI, repository setup |
| docs | Documentation-only changes |
| test | Adding or modifying tests |
| style | Code formatting (no behavioral impact) |
| perf | Performance improvements |
Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm testRequirements
- pi-coding-agent (peer dependency)
- pi-ai (peer dependency)
- pi-tui (optional peer dependency – enables interactive confirmation UI)
License
MIT © Yoshiki Kudo
