sumgit
Version:
AI-powered CLI to instantly summarize Git commits, diffs, and generate intelligent commit messages for cleaner repos and better changelogs.
89 lines (62 loc) โข 3.27 kB
Markdown
# Sumgit ๐ง ๐ฆ
[](https://www.npmjs.com/package/sumgit)
[](https://www.npmjs.com/package/sumgit)
[](https://opensource.org/licenses/MIT)
[](https://github.com/anthonyhalim150/sumgit/pulls)
**Sumgit** is a powerful CLI tool that uses AI to summarize Git commit messages and diffs, generate new commit messages, and help automate new commits โ ideal for cleaner PRs and smarter commit hygiene.
---
## โจ Features
- ๐ Summarize commit messages
- **Command:** `sumgit` or `sumgit 5`
- ๐ง Summarize actual code diffs
- **Command:** `sumgit --diff` or `sumgit --diff 3`
- ๐ Generate commit messages based on current diff
- **Command:** `sumgit --gen`
- โ
Auto-stage and commit with AI-generated message
- **Command:** `sumgit --gen --commit`
- ๐ Preview commit without writing it (dry run)
- **Command:** `sumgit --gen --commit --dry-run`
- ๐ Summarize the diff of a specific file
- **Command:** `sumgit --file path/to/file.js`
- ๐ Fully configurable prompt system handled on the client
- **Prompts are constructed in CLI and sent directly to backend**
---
## ๐ Installation
```bash
npm install -g sumgit
```
---
## ๐งช Usage
```bash
sumgit [options] [number_of_commits]
```
### ๐ Examples
| Command | Description |
|----------------------------------|--------------------------------------------------|
| `sumgit` | Summarize the last 10 commit messages |
| `sumgit 5` | Summarize the last 5 commit messages |
| `sumgit --diff` | Summarize last 10 commits by code diffs |
| `sumgit --diff 3` | Summarize last 3 commits by diffs |
| `sumgit --gen` | Generate a commit message from current `git diff` |
| `sumgit --gen --commit` | Generate and commit with AI-generated message |
| `sumgit --gen --commit --dry-run` | Preview the AI commit before executing |
| `sumgit --file index.js` | Summarize changes in `index.js` |
---
## ๐ Options
- `--diff` โ Summarize code diffs instead of commit messages
- `--gen` โ Generate a commit message from current unstaged `git diff`
- `--commit` โ Stage and commit with the generated commit message (requires `--gen`)
- `--dry-run` โ Preview the generated commit message and git commands without committing
- `--file <path>` โ Summarize the unstaged diff of a specific file
- `-h`, `--help` โ Show usage
---
## ๐ ๏ธ Requirements
- Node.js 16+
- A Git repository with commits
---
## ๐ค Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Feel free to fork the repo and submit a PR.
---
## ๐ License
MIT ยฉ [anthonyhalim150](https://github.com/anthonyhalim150)