{"id":28092878,"url":"https://github.com/meabed/pr-commit-ai-agent","last_synced_at":"2025-08-12T06:14:51.135Z","repository":{"id":289389170,"uuid":"971073311","full_name":"meabed/pr-commit-ai-agent","owner":"meabed","description":"CLI AI Agent to Commit your code and create Pull Requests 🤖","archived":false,"fork":false,"pushed_at":"2025-08-07T11:31:36.000Z","size":9838,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-08-07T13:26:15.345Z","etag":null,"topics":["ai","ai-agent","cli-agent","commit-agent","git","github","pr-agent"],"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/meabed.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,"zenodo":null}},"created_at":"2025-04-23T01:21:39.000Z","updated_at":"2025-08-05T04:17:57.000Z","dependencies_parsed_at":"2025-04-25T19:27:16.613Z","dependency_job_id":"30b05d6c-f7e3-463c-830f-ff7d260d9816","html_url":"https://github.com/meabed/pr-commit-ai-agent","commit_stats":null,"previous_names":["meabed/pr-commit-agent","meabed/pr-commit-ai-agent"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/meabed/pr-commit-ai-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meabed%2Fpr-commit-ai-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meabed%2Fpr-commit-ai-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meabed%2Fpr-commit-ai-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meabed%2Fpr-commit-ai-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meabed","download_url":"https://codeload.github.com/meabed/pr-commit-ai-agent/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meabed%2Fpr-commit-ai-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269268934,"owners_count":24388571,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","ai-agent","cli-agent","commit-agent","git","github","pr-agent"],"created_at":"2025-05-13T13:49:29.050Z","updated_at":"2025-08-12T06:14:51.127Z","avatar_url":"https://github.com/meabed.png","language":"TypeScript","readme":"# 🚀 GGPR - PR \u0026 Commit AI Assistant\n\nGGPR is an AI-powered CLI tool that **supercharges your Git workflow** by generating high-quality commit messages, branch names, and pull requests. Save time, improve documentation, and let AI handle the tedious parts of your development process! 🎉\n\n[![NPM Version](https://img.shields.io/npm/v/pr-commit-ai-agent.svg)](https://www.npmjs.com/package/pr-commit-ai-agent)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/meabed/pr-commit-ai-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/meabed/pr-commit-ai-agent/actions/workflows/ci.yml)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/meabed/pr-commit-ai-agent/pulls?q=is%3Apr+is%3Aclosed\"\u003e✨ See GGPR in action with real PRs and commits\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 🌟 Why GGPR?\n\n- 🕒 **Save Time**: No more writing commit messages or PR descriptions manually.\n- 🧠 **AI-Powered**: Generate semantic, high-quality commit messages and PRs.\n- 🔧 **Customizable**: Tailor prompts and workflows to your team's needs.\n- 🌍 **Multiple AI Providers**: Choose from OpenAI, Anthropic, Ollama, DeepSeek, and more.\n- 🔒 **Privacy-Friendly**: Use local models with Ollama for complete control.\n\n![img.png](assets/simple01.png)\n\n---\n\n[![demo](https://asciinema.org/a/9G5YvfqaAJSfhMnVrSeqVqlVf.svg)](https://asciinema.org/a/9G5YvfqaAJSfhMnVrSeqVqlVf)\n\n---\n\n## ✨ Features\n\n- **AI-Generated Commit Messages**: Create semantic, best-practice commit messages.\n- **Commit Optimization**: Improve existing commit messages with AI suggestions.\n- **Smart Branch Names**: Generate descriptive branch names automatically.\n- **Automated PR Creation**: Generate PR titles, descriptions, and create them in seconds.\n- **Multiple LLM Support**: Choose from OpenAI, Anthropic, Ollama, or DeepSeek.\n- **Local AI Integration**: Use local models via Ollama for privacy and speed.\n- **GitHub CLI Integration**: Seamlessly create PRs via GitHub CLI.\n\n---\n\n## 📋 Requirements\n\n- **Node.js** v18+\n- **Bun** (recommended) or npm\n- **Git** v2.25+\n- **GitHub CLI** (required for PR creation and updates, ensure it's installed and authenticated with the necessary scopes)\n\n---\n\n## 🛠️ Installation\n\n### 1️⃣ Install GGPR\n\n```bash\n# Install globally with npm\nnpm install -g pr-commit-ai-agent\n\n# Or with bun (recommended)\nbun add -g pr-commit-ai-agent\n\n# Install GitHub CLI (required for PRs)\nbrew install gh\n\n# Authenticate GitHub CLI with proper scopes\ngh auth login --scopes repo,read:org,read:discussion,gist\n\n# Verify GitHub CLI authentication status and scopes and ensure you have the necessary scopes\ngh auth status\n\n# Ensure you have the necessary scopes for PR management\n# If required scopes are missing, refresh your token with:\ngh auth refresh --scopes repo,read:org,read:discussion,gist\n```\n\n\u003e **Note on GitHub Tokens**: If you use `GH_TOKEN` or `GITHUB_TOKEN` environment variables instead of `gh auth login`, ensure your personal access token has the following scopes: `repo`, `read:org`, `read:discussion`, and `gist`. These scopes are required for complete PR management functionality.\n\n---\n\n### 2️⃣ Get Your API Keys 🔑\n\nGGPR supports multiple AI providers. Some offer **free credits** to get started:\n\n- 🌟 **[OpenRouter](https://www.openrouter.ai/)** - Free credits and models available!\n- 🤖 **[OpenAI](https://platform.openai.com/signup)** - Industry-leading models.\n- 🧠 **[Anthropic](https://www.anthropic.com/)** - Advanced AI models.\n- 🔍 **[DeepSeek](https://deepseek.ai/)** - Specialized AI solutions.\n- 🖥️ **[Ollama](https://ollama.com/)** - Local models for privacy.\n\n---\n\n### 3️⃣ Configure GGPR ⚙️\n\n#### Option 1: Interactive Setup (Recommended)\n\n```bash\n# Run the interactive configuration wizard\nggpr config\n```\n\n#### Option 2: Use Environment Variables\n\n```bash\n# Set for current session\nexport LLM_PROVIDER=openai\nexport OPENAI_API_KEY=your_key_here\n\n# Or pass inline for a single command\nLLM_PROVIDER=ollama MODEL=qwen2.5-coder OLLAMA_BASE_URL=http://0.0.0.0:11434/api/generate ggpr\n```\n\n#### Option 3: Edit Configuration File\n\n- Run `ggpr config` to locate the config file (e.g., `~/.config/pr-commit-ai-agent-nodejs/config.json`).\n- Modify the file to set your preferred settings.\n\n---\n\n## 📝 Usage\n\n### Create Command (Default)\n\nGenerate AI-enhanced commits, optimize messages, and create PRs.\n\n```bash\n# Basic usage (interactive)\nggpr\n\n# Auto-confirm all prompts\nggpr --yes\n\n# Log all LLM requests for debugging\nggpr --log-request\n\n# Combine flags\nggpr --yes --log-request\n```\n\n### Info Command\n\nDisplay repository information and status.\n\n```bash\nggpr info\n\n# Show detailed information\nggpr info --full\n```\n\n### Config Command\n\nManage your GGPR configuration settings.\n\n```bash\nggpr config\n```\n\n---\n\n## 🚶 Workflow\n\n1. **Target Branch Selection**: Choose the branch for your PR.\n2. **Uncommitted Changes**: Generate AI commit messages for your changes.\n3. **Commit Optimization**: Improve existing commit messages.\n4. **Branch Creation**: Create a branch with an AI-generated name.\n5. **PR Creation**: Generate a PR with an AI-generated title and description.\n\n### Workflow Diagram\n\n```mermaid\nflowchart TD\n    Start([Start GGPR]) --\u003e InitConfig[Initialize Configs \u0026 Settings]\n    InitConfig --\u003e GitStatus[Get Git Status]\n    GitStatus --\u003e BranchCheck{Determine\\nTarget Branch}\n\n    %% Branch Selection Flow\n    BranchCheck --\u003e|Find Tracking Branch| TrackingExists{Tracking\\nBranch Exists?}\n    TrackingExists --\u003e|Yes| ConfirmTracking{Confirm\\nTracking Branch?}\n    TrackingExists --\u003e|No| FetchRemotes[Fetch Remote Branches]\n    ConfirmTracking --\u003e|Yes| UseTracking[Use Tracking Branch]\n    ConfirmTracking --\u003e|No| FetchRemotes\n    FetchRemotes --\u003e UserSelectBranch[User Selects Branch]\n    UserSelectBranch --\u003e ConfirmBranch{Confirm\\nBranch Selection?}\n    ConfirmBranch --\u003e|Yes| TargetBranchSet[Set Target Branch]\n    ConfirmBranch --\u003e|No| ExitProcess([Exit Process])\n    UseTracking --\u003e TargetBranchSet\n\n    %% Uncommitted Changes Flow\n    TargetBranchSet --\u003e CheckChanges{Working Dir\\nClean?}\n    CheckChanges --\u003e|Yes| OptimizeCommits[Optimize Commit Messages]\n    CheckChanges --\u003e|No| HandleChanges{Commit\\nChanges?}\n    HandleChanges --\u003e|No| ExitProcess\n    HandleChanges --\u003e|Yes| AnalyzeChanges[Analyze Changes with AI]\n    AnalyzeChanges --\u003e CollectModified[Collect Modified Files]\n    CollectModified --\u003e GetDiffs[Get Diffs for Each File]\n    GetDiffs --\u003e AskAI{Send to AI\\nfor Analysis?}\n    AskAI --\u003e|No| ExitProcess\n    AskAI --\u003e|Yes| GenerateCommitMsg[Generate Commit Message]\n    GenerateCommitMsg --\u003e ConfirmCommit{Proceed with\\nCommit?}\n    ConfirmCommit --\u003e|No| ExitProcess\n    ConfirmCommit --\u003e|Yes| CreateCommit[Create Commit]\n    CreateCommit --\u003e MarkCommit[Mark as Created by Tool]\n    MarkCommit --\u003e OptimizeCommits\n\n    %% Optimize Commits Flow\n    OptimizeCommits --\u003e CommitsExists{Commits to\\nOptimize?}\n    CommitsExists --\u003e|No| CheckPRFlag\n    CommitsExists --\u003e|Yes| OptimizeConfirm{Optimize\\nCommits?}\n    OptimizeConfirm --\u003e|No| CheckPRFlag\n    OptimizeConfirm --\u003e|Yes| CheckLastCommit[Check Last Commit]\n    CheckLastCommit --\u003e IsCreatedByTool{Created by\\nThis Tool?}\n    IsCreatedByTool --\u003e|Yes| CheckPRFlag\n    IsCreatedByTool --\u003e|No| IsMergeCommit{Is Merge\\nCommit?}\n    IsMergeCommit --\u003e|Yes| CheckPRFlag\n    IsMergeCommit --\u003e|No| AnalyzeCommit[Analyze with Full Context]\n    AnalyzeCommit --\u003e AINeedsImprovement{Needs\\nImprovement?}\n    AINeedsImprovement --\u003e|No| MarkNoChanges[Mark as Processed]\n    AINeedsImprovement --\u003e|Yes| ConfirmAmend{Amend\\nCommit?}\n    ConfirmAmend --\u003e|No| CheckPRFlag\n    ConfirmAmend --\u003e|Yes| AmendCommit[Amend Commit Message]\n    AmendCommit --\u003e MarkAmended[Mark as Created by Tool]\n    MarkAmended --\u003e CheckPRFlag\n    MarkNoChanges --\u003e CheckPRFlag\n\n    %% PR Creation Flow\n    CheckPRFlag{Create PR?} --\u003e|No| Complete([Complete])\n    CheckPRFlag --\u003e|Yes| ConfirmPR{Proceed with\\nCreating PR?}\n    ConfirmPR --\u003e|No| Complete\n    ConfirmPR --\u003e|Yes| CheckExistingPR[Check for Existing PR]\n    CheckExistingPR --\u003e ExistingPR{PR Already\\nExists?}\n\n    %% Existing PR Flow\n    ExistingPR --\u003e|Yes| ConfirmUpdate{Update\\nExisting PR?}\n    ConfirmUpdate --\u003e|No| GeneratePRDetails\n    ConfirmUpdate --\u003e|Yes| PushToExisting[Push to Existing PR]\n    PushToExisting --\u003e CheckNewCommits[Check for New Commits]\n    CheckNewCommits --\u003e UpdatePRDesc{Update PR\\nDescription?}\n    UpdatePRDesc --\u003e|No| Complete\n    UpdatePRDesc --\u003e|Yes| GenerateUpdatedDesc[Generate Updated Title/Description]\n    GenerateUpdatedDesc --\u003e ConfirmUpdateDesc{Apply\\nUpdates?}\n    ConfirmUpdateDesc --\u003e|No| Complete\n    ConfirmUpdateDesc --\u003e|Yes| UpdatePR[Update PR Title/Description]\n    UpdatePR --\u003e Complete\n\n    %% New PR Flow\n    ExistingPR --\u003e|No| GeneratePRDetails[Generate PR Details with AI]\n    GeneratePRDetails --\u003e ConfirmPRDetails{Create PR with\\nthese Details?}\n    ConfirmPRDetails --\u003e|No| Complete\n    ConfirmPRDetails --\u003e|Yes| CheckBranchTarget{Current Branch\\nis Target?}\n    CheckBranchTarget --\u003e|Yes| CreateNewBranch[Create New Branch]\n    CheckBranchTarget --\u003e|No| UseCurrentBranch[Use Current Branch]\n    CreateNewBranch --\u003e ConfirmNewBranch{Confirm New\\nBranch?}\n    ConfirmNewBranch --\u003e|No| Complete\n    ConfirmNewBranch --\u003e|Yes| CreateBranch[Create Branch]\n    CreateBranch --\u003e PushBranch\n    UseCurrentBranch --\u003e PushBranch[Push Branch to Remote]\n    PushBranch --\u003e CreatePRWithGH{Create PR using\\nGitHub CLI?}\n    CreatePRWithGH --\u003e|No| ShowManualInstructions[Show Manual PR Instructions]\n    CreatePRWithGH --\u003e|Yes| GHCliAvailable{GitHub CLI\\nAvailable?}\n    GHCliAvailable --\u003e|No| ShowManualInstructions\n    GHCliAvailable --\u003e|Yes| CreatePRGH[Create PR with GitHub CLI]\n    CreatePRGH --\u003e PRSuccess[PR Created Successfully]\n    ShowManualInstructions --\u003e Complete\n    PRSuccess --\u003e Complete\n\n    classDef processNode fill:#d4f1f9,stroke:#0e5974,stroke-width:1px;\n    classDef decisionNode fill:#ffe6cc,stroke:#d79b00,stroke-width:1px;\n    classDef startEndNode fill:#d5e8d4,stroke:#82b366,stroke-width:2px;\n    classDef errorNode fill:#f8cecc,stroke:#b85450,stroke-width:1px;\n\n    class Start,Complete,ExitProcess startEndNode;\n    class BranchCheck,TrackingExists,ConfirmTracking,ConfirmBranch,CheckChanges,HandleChanges,AskAI,ConfirmCommit,CommitsExists,OptimizeConfirm,IsCreatedByTool,IsMergeCommit,AINeedsImprovement,ConfirmAmend,CheckPRFlag,ConfirmPR,ExistingPR,ConfirmUpdate,UpdatePRDesc,ConfirmUpdateDesc,ConfirmPRDetails,CheckBranchTarget,ConfirmNewBranch,CreatePRWithGH,GHCliAvailable decisionNode;\n    class ExitProcess errorNode;\n    class InitConfig,GitStatus,FetchRemotes,UserSelectBranch,TargetBranchSet,AnalyzeChanges,CollectModified,GetDiffs,GenerateCommitMsg,CreateCommit,MarkCommit,OptimizeCommits,CheckLastCommit,AnalyzeCommit,MarkNoChanges,AmendCommit,MarkAmended,CheckExistingPR,PushToExisting,CheckNewCommits,GenerateUpdatedDesc,UpdatePR,GeneratePRDetails,CreateNewBranch,UseCurrentBranch,CreateBranch,PushBranch,ShowManualInstructions,CreatePRGH,PRSuccess processNode;\n```\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions of all sizes! Here's how you can help:\n\n1. Fork the repo and create a new branch.\n2. Make your changes and test them locally.\n3. Submit a pull request with a clear description of your changes.\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eMade with ❤️ by \u003ca href=\"https://github.com/meabed\"\u003eMohamed Meabed\u003c/a\u003e and contributors\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/meabed/pr-commit-ai-agent/stargazers\"\u003e⭐ Star us on GitHub\u003c/a\u003e •\n    \u003ca href=\"https://github.com/meabed/pr-commit-ai-agent/issues\"\u003e🐛 Report Bug\u003c/a\u003e •\n    \u003ca href=\"https://github.com/meabed/pr-commit-ai-agent/issues\"\u003e✨ Request Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeabed%2Fpr-commit-ai-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeabed%2Fpr-commit-ai-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeabed%2Fpr-commit-ai-agent/lists"}