{"id":51216305,"url":"https://github.com/caibingcheng/git-cm","last_synced_at":"2026-06-28T04:03:39.517Z","repository":{"id":362846505,"uuid":"1257056943","full_name":"caibingcheng/git-cm","owner":"caibingcheng","description":"AI-powered git commit message generator for the terminal. Optimized for low token usage, no GUI needed.","archived":false,"fork":false,"pushed_at":"2026-06-22T09:45:29.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-22T11:22:53.478Z","etag":null,"topics":["git","git-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caibingcheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-02T10:21:47.000Z","updated_at":"2026-06-22T09:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/caibingcheng/git-cm","commit_stats":null,"previous_names":["caibingcheng/git-cm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/caibingcheng/git-cm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fgit-cm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fgit-cm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fgit-cm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fgit-cm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caibingcheng","download_url":"https://codeload.github.com/caibingcheng/git-cm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fgit-cm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34876276,"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-28T02:00:05.809Z","response_time":54,"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":["git","git-tools"],"created_at":"2026-06-28T04:03:38.598Z","updated_at":"2026-06-28T04:03:39.512Z","avatar_url":"https://github.com/caibingcheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-cm\n\nAI-powered git commit message generator.\n\n`git-cm` analyzes your staged changes and recent commit history to automatically generate meaningful commit messages that match your repository's style and conventions.\n\n## Features\n\n- **Smart Style Analysis**: Matches your commit style (conventional commits, emoji, formatting, etc.)\n- **Multiple LLM Providers**: Supports OpenAI, Anthropic Claude, and any OpenAI-compatible API\n- **Interactive Setup**: First-time configuration wizard\n- **Flexible Configuration**: TOML config file with CLI override support\n- **Safety Checks**: Validates git user configuration against commit history\n- **Code-Aware**: LLM can read project files and search the codebase to generate more accurate messages\n\n## Installation\n\n### From GitHub\n\n```bash\npip install git+https://github.com/caibingcheng/git-cm.git\n```\n\n### For Development\n\n```bash\ngit clone https://github.com/caibingcheng/git-cm.git\ncd git-cm\npip install -e \".[dev]\"\n```\n\n## Usage\n\n```bash\n# Stage your changes\ngit add .\n\n# Generate commit message (interactive)\ngit-cm\n\n# Skip confirmation and commit directly\ngit-cm --yes\n\n# Provide an optional hint to guide the generated message\ngit-cm 'focus on the auth fix'\n\n# Rewrite the latest commit message\ngit-cm -r\n\n# Rewrite a specific commit message\ngit-cm -r \u003ccommit-id\u003e\n\n# Rewrite with a hint\ngit-cm -r 'make the message more formal'\n```\n\nWhen rewriting a commit, `git-cm` will:\n- Stash any uncommitted changes (including untracked files) and restore them afterward.\n- Show the target commit's diff to the LLM for context.\n- Warn you if the commit is not `HEAD` or has already been pushed, and ask for confirmation.\n\nAfter installation, you can also use `git cm` as a git subcommand.\n\n## Configuration\n\nConfiguration is read from `~/.config/git-cm/config.toml`.\n\n### Single Provider (Legacy Format)\n\n```toml\nprovider = \"openai\"\napi_key = \"your-api-key\"\nmodel = \"gpt-4o-mini\"\napi_base = \"https://custom.api.endpoint\"  # optional, for OpenAI-compatible APIs\nsystem_prompt = \"...\"  # optional\n```\n\n### Multiple Providers\n\nYou can configure multiple providers and switch between them:\n\n```toml\ndefault = \"work\"\n\n[[providers]]\nname = \"work\"\nprovider_type = \"openai\"\napi_key = \"sk-work-key\"\nmodel = \"gpt-4o\"\n\n[[providers]]\nname = \"personal\"\nprovider_type = \"anthropic\"\napi_key = \"sk-personal-key\"\nmodel = \"claude-3-5-sonnet-20241022\"\n```\n\nSwitch active provider via environment variable:\n\n```bash\nexport GIT_CM_ACTIVE_PROVIDER=personal\ngit-cm\n```\n\nSupported providers: `openai`, `anthropic`. Any OpenAI-compatible API (DeepSeek, etc.) works via `api_base`.\n\n**Environment variables** (take precedence over config file):\n\n```bash\nexport GIT_CM_PROVIDER=openai\nexport GIT_CM_API_KEY=your-api-key\nexport GIT_CM_API_BASE=https://custom.api.endpoint\nexport GIT_CM_MODEL=gpt-4o\n```\n\n**CLI options** (highest precedence):\n\n```bash\ngit-cm --provider openai --model gpt-4o --api-key sk-...\n```\n\n| Option | Description |\n|--------|-------------|\n| `--provider` | LLM provider (`openai` or `anthropic`) |\n| `--model` | Model name |\n| `--api-key` | API key |\n| `--api-base` | Custom API base URL |\n| `--yes`, `-y` | Skip confirmation and commit directly |\n| `-r`, `--rewrite` | Rewrite an existing commit message |\n| `--verbose` | Enable verbose output for debugging |\n| `--version` | Show version |\n\n## Requirements\n\n- Python 3.9+\n- Git\n- API key for your chosen LLM provider\n\n## Development\n\n```bash\npytest tests/ -v\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaibingcheng%2Fgit-cm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaibingcheng%2Fgit-cm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaibingcheng%2Fgit-cm/lists"}