git-quick-summary
v1.0.1
Published
Fast, zero-dependency CLI & TypeScript library to display colorful, instant Git repository summaries (branch, uncommitted status, ahead/behind, recent commits, and top contributors).
Maintainers
Readme
📊 git-quick-summary
Fast, zero-dependency CLI & TypeScript library to display colorful, instant Git repository summaries (branch, uncommitted status, ahead/behind, recent commits, and top contributors).
✨ Features
- ⚡ Zero Dependencies — Ultra-fast execution (<50ms), pure native Node.js and Git commands.
- 🎨 Beautiful Colored Terminal Output — Instant visual snapshot of your repo without typing 5 different git commands.
- 🌿 Branch & Upstream Tracking — Shows current branch, remote tracking target, and
ahead / behindcommit counts. - 📝 Detailed Working Tree Status — Counts staged, modified, and untracked files at a glance.
- ⏱️ Recent Commits Log — Summarizes recent commit hashes, messages, timestamps, and authors.
- 👥 Contributor Leaderboard — Identifies top contributors and total commit counts.
- 🤖 CI/CD & Automation Ready — Supports
--jsonfor scripts, GitHub Actions, and bots. - 📦 Dual ESM & CommonJS — Usable as an executable CLI tool or imported as a library in TypeScript.
📥 Installation
As a CLI Tool (Recommended)
Run directly via npx without installation:
npx git-quick-summaryOr install globally:
npm install -g git-quick-summaryAs a Library
npm install git-quick-summary🚀 CLI Usage
Basic Usage
Simply run inside any Git repository:
npx git-quick-summaryExample Terminal Output
📦 Repository: my-awesome-app (/Users/alex/projects/my-awesome-app)
──────────────────────────────────────────────────
🌿 Branch : main -> origin/main [ahead 1, behind 0]
📝 Status : ✔ Working tree clean
📜 Commits: 142
⏱️ Latest : a1b2c3d feat: add authentication middleware (12 minutes ago) by Alex Doe
👥 Top Contributors:
• Alex Doe 98 commits
• Sarah Connor 44 commits
🪵 Recent Commits:
a1b2c3d feat: add authentication middleware 12 minutes ago
e4f5g6h fix: correct token expiration calculation 2 hours ago
i7j8k9l docs: update API specifications yesterdayInspect Another Folder
npx git-quick-summary ../another-projectJSON Output (For Automation / Bots)
npx git-quick-summary --json{
"isRepo": true,
"repoName": "my-awesome-app",
"branch": "main",
"trackingRemote": "origin/main",
"ahead": 1,
"behind": 0,
"status": {
"staged": 0,
"modified": 0,
"untracked": 0,
"isClean": true
},
"totalCommits": 142
}💻 Programmatic API Usage
import { getGitSummary, formatGitSummary } from 'git-quick-summary';
// 1. Get raw typed data
const summary = getGitSummary();
console.log(`Current branch: ${summary.branch}`);
console.log(`Total commits: ${summary.totalCommits}`);
// 2. Format as string (with or without terminal ANSI colors)
const terminalReport = formatGitSummary(summary, { noColor: false });
console.log(terminalReport);⚙️ CLI Options Reference
| Option | Description |
|---|---|
| [path] | Path to Git repository (defaults to current working directory). |
| --json | Output full repository metadata and statistics as JSON. |
| --no-color | Disable ANSI terminal colors. |
| -v, --version | Display version number. |
| -h, --help | Display help screen. |
🛠 Development & Testing
# Install dependencies
npm install
# Run unit tests
npm test
# Build dual ESM/CJS bundles + CLI executable + .d.ts types
npm run build💖 Support the Project
If you find this package useful, consider sponsoring its ongoing development and maintenance: 👉 Sponsor @Piratha97 on GitHub Sponsors
📄 License
MIT © 2026 Pirapaakaran Pirathapan
