{"id":50675595,"url":"https://github.com/vinodnimbalkar/gdcm","last_synced_at":"2026-06-08T15:32:50.621Z","repository":{"id":316921276,"uuid":"1065207560","full_name":"vinodnimbalkar/gdcm","owner":"vinodnimbalkar","description":"Git Diff to Commit Message API","archived":false,"fork":false,"pushed_at":"2026-02-27T09:59:21.000Z","size":49,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-27T15:16:07.430Z","etag":null,"topics":["commit","commit-message","git"],"latest_commit_sha":null,"homepage":"https://gdcm.vinversion.com","language":"HTML","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/vinodnimbalkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["vinodnimbalkar"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":["https://paypal.me/vinodnimbalkar"]}},"created_at":"2025-09-27T09:06:20.000Z","updated_at":"2026-02-27T09:59:25.000Z","dependencies_parsed_at":"2025-09-27T16:26:10.109Z","dependency_job_id":null,"html_url":"https://github.com/vinodnimbalkar/gdcm","commit_stats":null,"previous_names":["vinodnimbalkar/gdcm"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vinodnimbalkar/gdcm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnimbalkar%2Fgdcm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnimbalkar%2Fgdcm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnimbalkar%2Fgdcm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnimbalkar%2Fgdcm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinodnimbalkar","download_url":"https://codeload.github.com/vinodnimbalkar/gdcm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnimbalkar%2Fgdcm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34069490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["commit","commit-message","git"],"created_at":"2026-06-08T15:32:49.328Z","updated_at":"2026-06-08T15:32:50.615Z","avatar_url":"https://github.com/vinodnimbalkar.png","language":"HTML","funding_links":["https://github.com/sponsors/vinodnimbalkar","https://paypal.me/vinodnimbalkar"],"categories":[],"sub_categories":[],"readme":"# GDCM - Git Diff to Commit Message API\n\nA Cloudflare Worker-based web service that generates meaningful Git commit messages from Git diffs using Google's Gemini AI API. This is the web service version of the [gcm CLI tool](https://github.com/vinodnimbalkar/gcm).\n\n## Features\n\n- 🚀 **Fast \u0026 Serverless**: Built on Cloudflare Workers for global edge deployment\n- 🤖 **AI-Powered**: Uses Google's Gemini 2.0 Flash model for intelligent commit message generation\n- 📝 **Conventional Commits**: Generates commit messages following conventional commit standards\n- 🎨 **Emoji Support**: Includes appropriate emojis based on change types\n- 🌐 **Web Interface**: Includes a beautiful HTML interface for easy testing\n- 🔒 **Secure**: API key can be provided via request or environment variable\n\n## Quick Start\n\n1. **Get a Gemini API Key**: Visit [Google AI Studio](https://makersuite.google.com/app/apikey) and create an API key\n\n2. **Deploy the Worker**:\n   ```bash\n   git clone https://github.com/vinodnimbalkar/gdcm.git\n   cd gdcm\n   wrangler secret put GEMINI_API_KEY\n   # Enter your API key when prompted\n   wrangler deploy\n   ```\n\n3. **Use the Web Interface**: Open your deployed URL in a browser to access the beautiful web interface\n\n4. **Or use with cURL**:\n   ```bash\n   curl -X POST https://your-worker-url.workers.dev/generate-commit \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"diff\": \"your-git-diff-here\"}'\n   ```\n\n## API Endpoints\n\n### `POST /generate-commit`\n\nGenerates a commit message from a Git diff.\n\n**Request Body:**\n```json\n{\n  \"diff\": \"your git diff content here\",\n  \"gemini_api_key\": \"optional - your Gemini API key\"\n}\n```\n\n**Response (Success):**\n```json\n{\n  \"commit_message\": \"feat: ✨Add user authentication system\\n\\nImplement OAuth2 login flow with Google and GitHub providers\",\n  \"service_used\": \"Gemini\"\n}\n```\n\n**Response (Error):**\n```json\n{\n  \"error\": \"Error message description\"\n}\n```\n\n### `GET /health`\n\nHealth check endpoint.\n\n**Response:**\n```\nOK\n```\n\n## Setup \u0026 Deployment\n\n### Prerequisites\n\n- [Rust](https://rustup.rs/) (latest stable)\n- [wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/)\n- Cloudflare account\n- Google Gemini API key\n\n### Local Development\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/vinodnimbalkar/gdcm.git\n   cd gdcm\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   cargo check\n   ```\n\n3. **Set up environment variables:**\n   Create a `.env` file or set the environment variable:\n   ```bash\n   export GEMINI_API_KEY=\"your_gemini_api_key_here\"\n   ```\n\n4. **Build the project:**\n   ```bash\n   wrangler build\n   ```\n\n5. **Run locally:**\n   ```bash\n   wrangler dev\n   ```\n\n   The service will be available at `http://localhost:8787`\n\n### Production Deployment\n\n1. **Set up secrets in Cloudflare:**\n   ```bash\n   wrangler secret put GEMINI_API_KEY\n   # Enter your Gemini API key when prompted\n   ```\n\n2. **Deploy to Cloudflare Workers:**\n   ```bash\n   wrangler deploy\n   ```\n\n## Usage Examples\n\n### Using cURL\n\n```bash\n# Basic usage\ncurl -X POST https://your-worker-url.workers.dev/generate-commit \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"diff\": \"diff --git a/src/main.rs b/src/main.rs\\nindex 1234567..abcdefg 100644\\n--- a/src/main.rs\\n+++ b/src/main.rs\\n@@ -1,3 +1,4 @@\\n fn main() {\\n+    println!(\\\"Hello, World!\\\");\\n     // existing code\\n }\"\n  }'\n\n# With API key in request\ncurl -X POST https://your-worker-url.workers.dev/generate-commit \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"diff\": \"your git diff here\",\n    \"gemini_api_key\": \"your_api_key_here\"\n  }'\n```\n\n### Using the Web Interface\n\nThe API includes a beautiful web interface that you can access by visiting your deployed worker URL in a browser.\n\n**🌐 Web Interface Location:**\nThe web interface is automatically served when you visit the root URL (`/`) in any web browser. It's built right into the Worker and includes:\n\n- **A large textarea** labeled \"Git Diff\" where you paste your `git diff` output\n- **An optional API key field** for your Gemini API key\n- **Generate button** to create the commit message\n- **Copy to clipboard** functionality for easy use\n\n**How it works:**\n- When you visit the root URL (`/`) in a browser, it automatically serves the HTML interface\n- When you make API calls (like with `curl`), it returns plain text API documentation\n\n**Steps to use the web interface:**\n\n1. **Navigate to your deployed worker URL** in a web browser:\n   - Local development: `http://localhost:8787`\n   - Production: `https://your-worker-name.your-subdomain.workers.dev`\n\n2. **You'll see a form with two main fields:**\n   - **Gemini API Key field** (optional if set as environment variable)\n   - **Large Git Diff textarea** - this is where you paste your git diff content\n\n3. **Get your Git diff and paste it**:\n   - Run `git diff` or `git diff --staged` in your terminal\n   - Copy the entire output\n   - Paste it into the **\"Git Diff\" textarea** on the web page\n   - Or click \"Load Sample Diff\" to test with example data\n\n4. **Click \"Generate Commit Message\"**:\n   - The interface shows a loading spinner while processing\n   - Results appear below with the generated commit message\n\n5. **Copy and use the generated message**:\n   - Click \"Copy to Clipboard\" button\n   - Use with `git commit -m \"paste-message-here\"`\n\n**Features of the web interface:**\n- ✨ Beautiful, responsive design that works on mobile and desktop\n- 🔄 Real-time API calls with loading indicators\n- 💾 Remembers your API key in browser storage\n- 📋 One-click copy to clipboard functionality\n- 🎯 Sample diff loader for quick testing\n- ❌ Clear error messages and validation\n- 🎨 Syntax highlighting for commit messages\n\n**Need more help with the web interface?**\n📖 See the detailed [Web Interface Guide](WEB_INTERFACE_GUIDE.md) for:\n- Visual layout diagram showing exactly where the textarea is\n- Step-by-step screenshots and workflow\n- Troubleshooting common issues\n- Technical implementation details\n\n**Quick reference - The textarea code is located in:**\n- File: `gdcm/public/index.html`\n- Element: `\u003ctextarea id=\"diffInput\" placeholder=\"Paste your git diff here...\" required\u003e\u003c/textarea\u003e`\n- The HTML is embedded in the Worker using `include_str!(\"../../public/index.html\")` in `src/handlers/basic.rs`\n\n### Integration with Git Workflow\n\nYou can integrate this with your Git workflow using a shell function:\n\n```bash\n# Add to your .bashrc, .zshrc, etc.\ngcm-api() {\n    local diff_content\n    diff_content=$(git diff --staged)\n\n    if [ -z \"$diff_content\" ]; then\n        echo \"No staged changes found. Use 'git add' first.\"\n        return 1\n    fi\n\n    local commit_msg\n    commit_msg=$(curl -s -X POST \"https://your-worker-url.workers.dev/generate-commit\" \\\n        -H \"Content-Type: application/json\" \\\n        -d \"{\\\"diff\\\": $(echo \"$diff_content\" | jq -Rs .)}\" | \\\n        jq -r '.commit_message')\n\n    if [ \"$commit_msg\" != \"null\" ] \u0026\u0026 [ -n \"$commit_msg\" ]; then\n        echo \"Generated commit message:\"\n        echo \"$commit_msg\"\n        echo \"\"\n        echo \"Use this message? (y/n)\"\n        read -r response\n        if [[ \"$response\" =~ ^[Yy]$ ]]; then\n            git commit -m \"$commit_msg\"\n        fi\n    else\n        echo \"Failed to generate commit message\"\n    fi\n}\n```\n\n## Supported Commit Types \u0026 Emojis\n\n| Type | Emoji | Description |\n|------|-------|-------------|\n| `feat` | ✨ | New feature |\n| `fix` | 🐛 | Bug fix |\n| `docs` | 📚 | Documentation |\n| `style` | 💄 | Formatting, styling |\n| `refactor` | 🔨 | Code refactoring |\n| `test` | ✅ | Adding tests |\n| `chore` | 🔧 | Maintenance tasks |\n| `perf` | 🐎 | Performance improvement |\n| `ci` | 💚 | Continuous integration |\n| `build` | 📦 | Build system |\n| `revert` | ⏪ | Reverting changes |\n| `security` | 🔒 | Security improvements |\n| `deps` | ⬆️ | Dependency updates |\n| `remove` | 🔥 | Removing code/files |\n| `wip` | 🚧 | Work in progress |\n\n## Configuration\n\n### Environment Variables\n\n- `GEMINI_API_KEY`: Your Google Gemini API key (required)\n\n### Wrangler Configuration\n\nThe `wrangler.toml` file contains the Cloudflare Worker configuration:\n\n```toml\nname = \"gdcm\"\nmain = \"build/index.js\"\ncompatibility_date = \"2025-09-27\"\n\n[build]\ncommand = \"cargo install -q worker-build \u0026\u0026 worker-build --release\"\n```\n\n## Getting a Gemini API Key\n\n1. Go to [Google AI Studio](https://makersuite.google.com/app/apikey)\n2. Click \"Create API Key\"\n3. Copy the generated key\n4. Set it as an environment variable or provide it in requests\n\n## Error Handling\n\nThe API returns appropriate HTTP status codes:\n\n- `200`: Success\n- `400`: Bad request (invalid input)\n- `500`: Internal server error (API failure, etc.)\n\nCommon error scenarios:\n- Empty diff provided\n- No API key provided\n- Invalid API key\n- Gemini API rate limits exceeded\n- Network connectivity issues\n\n## Development\n\n### Project Structure\n\n```\ngdcm/\n├── src/\n│   ├── lib.rs          # Main entry point\n│   ├── types.rs        # Request/Response types\n│   ├── handlers/       # HTTP request handlers\n│   │   ├── mod.rs\n│   │   ├── basic.rs    # Root and health handlers\n│   │   └── commit.rs   # Commit generation handler\n│   ├── services/       # Business logic services\n│   │   ├── mod.rs\n│   │   └── gemini.rs   # Gemini API service\n│   └── routes/         # Router configuration\n│       └── mod.rs\n├── public/\n│   └── index.html      # Web interface\n├── test_api.js         # API testing script\n├── WEB_INTERFACE_GUIDE.md  # Detailed web interface guide\n├── CHANGELOG.md        # Project changelog\n├── Cargo.toml          # Rust dependencies\n├── wrangler.toml       # Cloudflare Worker config\n└── README.md           # This file\n```\n\n### Testing\n\nRun tests locally:\n```bash\ncargo test\n```\n\n### Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Related Projects\n\n- [gcm CLI](https://github.com/vinodnimbalkar/gcm) - The original command-line version\n- [Conventional Commits](https://www.conventionalcommits.org/) - Commit message specification\n\n## Support\n\nIf you encounter any issues or have questions:\n\n1. Check the [Issues](https://github.com/vinodnimbalkar/gdcm/issues) section\n2. Create a new issue with detailed information\n3. Include error messages, request/response examples, and environment details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinodnimbalkar%2Fgdcm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinodnimbalkar%2Fgdcm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinodnimbalkar%2Fgdcm/lists"}