UNPKG

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
# Sumgit ๐Ÿง ๐Ÿ“ฆ [![npm version](https://img.shields.io/npm/v/sumgit.svg)](https://www.npmjs.com/package/sumgit) [![npm downloads](https://img.shields.io/npm/dm/sumgit.svg)](https://www.npmjs.com/package/sumgit) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](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)