{"id":45869367,"url":"https://github.com/kessler/commitai","last_synced_at":"2026-02-27T09:30:06.170Z","repository":{"id":316335998,"uuid":"1060888646","full_name":"kessler/commitai","owner":"kessler","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-24T01:31:53.000Z","size":39,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T18:18:44.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kessler.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":null,"dco":null,"cla":null}},"created_at":"2025-09-20T19:53:32.000Z","updated_at":"2025-09-25T12:34:24.000Z","dependencies_parsed_at":"2025-09-24T03:07:06.294Z","dependency_job_id":"74d4a5e4-c0e8-4af2-9da3-994e8825d005","html_url":"https://github.com/kessler/commitai","commit_stats":null,"previous_names":["kessler/commitai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kessler/commitai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcommitai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcommitai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcommitai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcommitai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/commitai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fcommitai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29889388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T08:34:21.514Z","status":"ssl_error","status_checked_at":"2026-02-27T08:32:38.035Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-27T09:30:05.352Z","updated_at":"2026-02-27T09:30:06.136Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commitai\n\n_module generated with AI_\n\nGenerate intelligent git commit messages from your staged changes using LLMs (OpenAI or Anthropic). CommitAI analyzes your git diff, groups related changes together, and generates conventional commit messages following best practices.\n\n## Features\n\n- 🤖 **Multiple LLM Support**: Works with both OpenAI (GPT) and Anthropic (Claude) models\n- 🎯 **Smart Grouping**: Automatically groups related file changes into logical commits\n- ✨ **Interactive Setup**: Simple onboarding wizard to configure your LLM provider\n- 📝 **Conventional Commits**: Generates messages following conventional commit standards\n- 🔄 **Flexible Workflow**: Use staged or unstaged changes, pipe diffs, or work directly with git\n- ✅ **Confirmation Prompts**: Review and confirm commits before they're created\n- 🔧 **Configurable**: Support for project-specific and global configurations\n\n## Installation\n\n```bash\nnpm install -g @kessler/commitai\n```\n\nOr use locally in your project:\n\n```bash\nnpm install commitai\n```\n\n## Quick Start\n\n### 1. Run the interactive setup\n\n```bash\ncommitai setup\n```\n\nThis will guide you through:\n- Selecting your preferred LLM provider (OpenAI or Anthropic)\n- Entering your API key\n- Choosing your preferred model\n\n### 2. Generate and commit\n\n```bash\n# Stage your changes\ngit add .\n\n# Generate and create commits with confirmation\ncommitai gen | commitai commit\n\n# Or use shortcuts\ncommitai g | commitai c\n```\n\n## Configuration\n\nConfiguration is stored in `~/.config/commitai` (created by the setup wizard) or can be overridden with:\n\n### Project-specific config (`.commitairc`)\n\n```ini\nprovider = openai\nmodel = gpt-4o-mini\napiKey = your-api-key-here\n```\n\n### Environment variables\n\n- `OPENAI_API_KEY` for OpenAI\n- `ANTHROPIC_API_KEY` for Anthropic\n\n### Configuration hierarchy\n\n1. Command-line options (highest priority)\n2. Project `.commitairc` file\n3. User config at `~/.config/commitai`\n4. Environment variables (lowest priority)\n\n## CLI Usage\n\n### Interactive Setup\n\n```bash\ncommitai setup\n```\n\nLaunches an interactive wizard to configure CommitAI with your preferred LLM provider and model.\n\n### Generate commit messages\n\n```bash\n# Generate from staged changes (recommended)\ncommitai generate\n\n# Use aliases for convenience\ncommitai gen\ncommitai g\n\n# Generate from unstaged changes (when no staged changes exist)\ncommitai g\n\n# Provide diff via stdin\ngit diff | commitai g --stdin\n```\n\nOptions:\n- `-g, --git \u003cpath\u003e`: Path to git executable\n- `-p, --provider \u003cprovider\u003e`: LLM provider (openai or anthropic)\n- `-m, --model \u003cmodel\u003e`: Model to use\n- `-k, --api-key \u003ckey\u003e`: API key for the provider\n- `--openai-api-key \u003ckey\u003e`: OpenAI API key\n- `--anthropic-api-key \u003ckey\u003e`: Anthropic API key\n- `--stdin`: Read diff from stdin instead of using git commands\n\n### Create commits\n\n```bash\n# Generate and commit with confirmation prompts (default)\ncommitai g | commitai commit\n\n# Skip confirmation prompts\ncommitai g | commitai c --no-confirm\n\n# Using shorthand\ncommitai g | commitai c\n```\n\nOptions:\n- `-g, --git \u003cpath\u003e`: Path to git executable\n- `--no-confirm`: Skip confirmation prompts\n\n### Show configuration\n\n```bash\ncommitai config\n```\n\nDisplays the current configuration including provider, model, and API key settings.\n\n## API Usage\n\n```javascript\nimport { generate, commit, getGitDiff } from 'commitai';\n\n// Generate commit messages from current git state\nconst diff = getGitDiff();\nconst result = await generate(diff, {\n  provider: 'openai',\n  model: 'gpt-4o-mini'\n});\n\n// Result contains grouped commits\nconsole.log(result.commits);\n// [\n//   {\n//     files: ['src/auth.js', 'src/middleware/auth.js'],\n//     messages: ['feat: add user authentication module']\n//   },\n//   {\n//     files: ['README.md'],\n//     messages: ['docs: update installation instructions']\n//   }\n// ]\n\n// Create commits programmatically\nconst commitResult = await commit(JSON.stringify(result), {\n  confirmation: async ({ message, files }) =\u003e {\n    // Custom confirmation logic\n    return true; // or false to skip\n  }\n});\n```\n\n## How It Works\n\n1. **Diff Analysis**: CommitAI reads your git diff (staged or unstaged changes)\n2. **Smart Grouping**: The LLM analyzes changes and groups related files together\n3. **Message Generation**: Generates conventional commit messages for each group\n4. **Overlap Detection**: Merges commit groups that share files to avoid conflicts\n5. **Confirmation**: Shows you each commit before creating it (can be disabled)\n6. **Commit Creation**: Stages the specific files and creates individual commits\n\n## Supported Models\n\n### OpenAI\n- gpt-4o\n- gpt-4o-mini\n- gpt-4-turbo\n- gpt-3.5-turbo\n- Custom models via manual entry\n\n### Anthropic\n- claude-3-opus\n- claude-3-sonnet\n- claude-3-haiku\n- claude-3.5-sonnet\n- Custom models via manual entry\n\n## Commit Message Format\n\nCommitAI follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:\n\n- `feat:` New features\n- `fix:` Bug fixes\n- `docs:` Documentation changes\n- `style:` Code style changes (formatting, etc.)\n- `refactor:` Code refactoring\n- `test:` Test updates\n- `chore:` Build process or auxiliary tool changes\n- `perf:` Performance improvements\n\n## Tips\n\n1. **Stage your changes first**: CommitAI works best with staged changes (`git add`)\n2. **Review before committing**: Use the confirmation prompts to ensure accuracy\n3. **Group related changes**: Stage related files together for better commit grouping\n4. **Use .gitignore**: Ensure unwanted files aren't included in diffs\n5. **Small, focused changes**: Make small, atomic changes for best results\n\n## License\n\nApache-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fcommitai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fcommitai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fcommitai/lists"}