{"id":23592535,"url":"https://github.com/yashraj-n/gcmg","last_synced_at":"2025-06-30T05:05:29.897Z","repository":{"id":269201833,"uuid":"906707449","full_name":"yashraj-n/gcmg","owner":"yashraj-n","description":"A command-line tool that uses AI to automatically generate meaningful and well-formatted Git commit messages based on your code changes. It supports multiple AI providers including OpenAI, Anthropic, Google, Groq, and Perplexity.","archived":false,"fork":false,"pushed_at":"2025-06-14T16:04:22.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T16:04:59.877Z","etag":null,"topics":["ai","cli","commit","git","github","npm","package","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yashraj-n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-21T17:07:00.000Z","updated_at":"2025-06-14T16:04:04.000Z","dependencies_parsed_at":"2024-12-21T18:27:58.244Z","dependency_job_id":"b35405fe-729d-4f14-973f-f2acae1a7790","html_url":"https://github.com/yashraj-n/gcmg","commit_stats":null,"previous_names":["yashraj-n/gcmg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yashraj-n/gcmg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashraj-n%2Fgcmg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashraj-n%2Fgcmg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashraj-n%2Fgcmg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashraj-n%2Fgcmg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashraj-n","download_url":"https://codeload.github.com/yashraj-n/gcmg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashraj-n%2Fgcmg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262714504,"owners_count":23352464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cli","commit","git","github","npm","package","typescript"],"created_at":"2024-12-27T08:14:22.710Z","updated_at":"2025-06-30T05:05:29.887Z","avatar_url":"https://github.com/yashraj-n.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🚀 GCMG - Git Commit Message Generator\n\n[![npm version](https://badge.fury.io/js/gcmg.svg)](https://badge.fury.io/js/gcmg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js Version](https://img.shields.io/badge/node-%3E%3D14.0.0-brightgreen)](https://nodejs.org/)\n\n**🤖 Intelligent AI-powered commit message generation for developers who value quality and consistency**\n\n*Transform your git workflow with smart, standardized commit messages generated from your actual code changes*\n\n![Demo](./assets/demo.gif)\n\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n🎯 **Smart Commit Generation** - Analyzes your `git diff` to create meaningful, descriptive commit messages  \n🤖 **Multi-AI Provider Support** - Choose from OpenAI, Anthropic, Google, Groq, and more  \n⚡ **Lightning Fast** - Built with esbuild for optimal performance  \n🔧 **Interactive Setup** - Guided configuration with beautiful CLI prompts  \n📝 **Standardized Format** - Consistent commit message structure across your projects  \n🌍 **Cross-Platform** - Works seamlessly on Windows, macOS, and Linux  \n🔄 **Auto Git Operations** - Optional automatic add, commit, and push workflow  \n💬 **AI Query Mode** - Ask questions about git commands and get instant help  \n\n## 🎨 What Makes GCMG Special?\n\n### 🧠 **Intelligent Analysis**\n- Reads your actual code changes via `git diff`\n- Understands context and generates relevant commit messages\n- Handles large diffs intelligently (with smart 10k character limit)\n\n### 🎭 **Multiple AI Personalities**\nChoose from the industry's best AI models:\n\n| Provider | Models Available | Strengths |\n|----------|-----------------|-----------|\n| **OpenAI** | GPT-4, GPT-4o, o1, o3-mini | Most versatile, excellent reasoning |\n| **Anthropic** | Claude-4, Claude-3.5 Sonnet/Haiku | Superior code understanding |\n| **Google** | Gemini 2.0, Gemini 1.5 Pro/Flash | Fast and efficient |\n| **Groq** | Llama 3.3, Mixtral, Qwen | Lightning-fast inference |\n| **Google Vertex** | Enterprise Gemini models | Enterprise-grade reliability |\n\n### 🎯 **Perfect Commit Format**\nEvery generated message follows this proven structure:\n```\n[feat] Add user authentication system\n- Implement JWT token-based authentication\n- Add login and logout endpoints\n- Create user session management\n- Add password encryption with bcrypt\n... Enhances application security and user management\n```\n\n## 🚀 Quick Start\n\n### Installation\n```bash\nnpm install -g gcmg\n```\n\n### Setup (One-time)\n```bash\ngcmg config\n```\nFollow the interactive prompts to:\n1. 🎯 Select your preferred AI provider\n2. 🤖 Choose an AI model\n3. 🔑 Enter your API key\n\n### Usage\n```bash\n# Make your changes\ngit add .\n\n# Generate and commit\ngcmg\n\n# Or ask for help\ngcmg \"how do I remove sensitive data from git history?\"\n```\n\n## 🎪 Command Showcase\n\nGCMG provides multiple command aliases for maximum convenience:\n\n```bash\ngcmg                           # 🚀 Primary command\ngit-cmg                        # 🔧 Git-style alias  \ngit-commit-msg-generate        # 📝 Descriptive alias\n```\n\n### 🎨 Available Commands\n\n| Command | Description | Example |\n|---------|-------------|---------|\n| `gcmg` | 🎯 Generate commit message from changes | `gcmg` |\n| `gcmg config` | ⚙️ Interactive configuration setup | `gcmg config` |\n| `gcmg edit` | ✏️ Edit configuration file | `gcmg edit` |\n| `gcmg help` | 📚 Show beautiful help message | `gcmg help` |\n| `gcmg \u003cquery\u003e` | 💬 Ask git-related questions | `gcmg \"revert last commit\"` |\n\n## 🛠️ Configuration\n\nConfiguration is stored securely in platform-appropriate locations:\n\n- **Windows:** `%APPDATA%\\gcmg\\.gcmg-config`\n- **macOS:** `~/Library/Application Support/gcmg/.gcmg-config`\n- **Linux:** `~/.config/gcmg/.gcmg-config`\n\n### 🔧 Configuration Structure\n```json\n{\n  \"name\": \"OpenAI\",\n  \"provider\": \"@ai-sdk/openai\",\n  \"model\": \"gpt-4o\",\n  \"apiKey\": \"your-api-key\",\n  \"prompts\": {\n    \"commit\": \"Your custom commit prompt...\",\n    \"help\": \"Your custom help prompt...\"\n  }\n}\n```\n\n## 🎭 Advanced Features\n\n### 🤖 **AI Query Mode**\nGet instant help with git commands:\n```bash\ngcmg \"how to merge branches safely\"\ngcmg \"undo last commit but keep changes\"\ngcmg \"remove file from git history\"\n```\n\n### ⚡ **Smart Diff Handling**\n- Automatically detects when no changes exist\n- Warns about large diffs (\u003e10k characters)\n- Handles binary files and complex changes intelligently\n\n### 🔄 **Streamlined Workflow**\n1. **Analyze** - Reads your git diff\n2. **Generate** - Creates intelligent commit message\n3. **Review** - Shows you the proposed message\n4. **Commit** - Optionally commits with `git add . \u0026\u0026 git commit`\n5. **Push** - Optionally pushes to remote repository\n\n## 🏗️ Architecture\n\nGCMG is built with modern development practices:\n\n- **TypeScript** - Type-safe development\n- **ESBuild** - Lightning-fast compilation\n- **Vercel AI SDK** - Unified AI provider interface\n- **Enquirer** - Beautiful interactive prompts\n- **Zod** - Runtime type validation\n- **Cross-platform** - Works everywhere Node.js runs\n\n### 📁 Project Structure\n```\ngcmg/\n├── src/\n│   ├── commands/         # 🎯 CLI command implementations\n│   ├── lib/             # 🔧 Core libraries (config, LLM, models)\n│   ├── scripts/         # 🛠️ Build and utility scripts\n│   └── prompts.ts       # 💬 AI prompt templates\n├── assets/              # 🎨 Visual assets\n└── dist/               # 📦 Built output\n```\n\n## 🎨 Commit Types\n\nGCMG automatically categorizes your changes:\n\n| Type | Description | Example |\n|------|-------------|---------|\n| `feat` | ✨ New features | `[feat] Add dark mode toggle` |\n| `fix` | 🐛 Bug fixes | `[fix] Resolve login validation error` |\n| `docs` | 📚 Documentation | `[docs] Update API documentation` |\n| `style` | 💄 Code formatting | `[style] Fix indentation and spacing` |\n| `refactor` | ♻️ Code refactoring | `[refactor] Simplify user service logic` |\n| `test` | 🧪 Testing | `[test] Add unit tests for auth module` |\n| `chore` | 🔧 Maintenance | `[chore] Update dependencies` |\n\n## 🤝 Contributing\n\nWe love contributions! Here's how to get started:\n\n1. **Fork** the repository\n2. **Create** your feature branch (`git checkout -b feature/amazing-feature`)\n3. **Commit** your changes using GCMG itself! (`gcmg`)\n4. **Push** to the branch (`git push origin feature/amazing-feature`)\n5. **Open** a Pull Request\n\n### 🛠️ Development Setup\n```bash\ngit clone https://github.com/yashraj-n/gcmg.git\ncd gcmg\nnpm install\nnpm run build\n```\n\n## 📊 Why Choose GCMG?\n\n### 🎯 **Before GCMG**\n```\ngit commit -m \"fix stuff\"\ngit commit -m \"update\"\ngit commit -m \"asdfgh\"\n```\n\n### ✨ **After GCMG**\n```\n[fix] Resolve authentication middleware validation error\n- Fix JWT token verification logic\n- Add proper error handling for expired tokens\n- Update middleware to handle edge cases\n- Add comprehensive logging for debugging\n... Improves application security and user experience\n```\n\n## 🌟 Real-World Example\n\n```bash\n$ gcmg\n✓ Getting Changes...\n✓ Generating Commit Message...\n\n[feat] Implement user profile management system\n- Add user profile CRUD operations\n- Create profile update validation\n- Implement avatar upload functionality\n- Add email verification for profile changes\n- Create comprehensive user settings page\n... Enhances user experience with complete profile control\n\n? Do you want to add and commit these changes? › Yes\n✓ Changes committed successfully\n? Do you want to push the changes? › Yes\n✓ Changes pushed successfully\n👋 Goodbye!\n```\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n\u003cdiv align=\"center\"\u003e\n\n**⭐ Star this repo if GCMG helps improve your git workflow! ⭐**\n\n[🐛 Report Bug](https://github.com/yashraj-n/gcmg/issues) · [✨ Request Feature](https://github.com/yashraj-n/gcmg/issues) · [💬 Discussions](https://github.com/yashraj-n/gcmg/discussions)\n\nMade with 💻 and ☕ for developers who care about quality commits\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashraj-n%2Fgcmg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashraj-n%2Fgcmg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashraj-n%2Fgcmg/lists"}