{"id":31644562,"url":"https://github.com/alexwhin/cmai","last_synced_at":"2025-10-07T04:54:05.740Z","repository":{"id":315309420,"uuid":"1058936612","full_name":"alexwhin/cmai","owner":"alexwhin","description":"⚡️ cmai — commits that write themselves. Multi-provider support, rule enforcement, secret redaction, multi-language output, commitlint integration, and flexible usage modes.","archived":false,"fork":false,"pushed_at":"2025-10-04T10:51:23.000Z","size":1014,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T10:59:24.583Z","etag":null,"topics":["ai","anthropic","auomation","cli","commit","git","ollama","openai","productivity","tools","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cmai","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/alexwhin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-17T18:51:06.000Z","updated_at":"2025-10-04T10:51:26.000Z","dependencies_parsed_at":"2025-09-17T22:27:36.783Z","dependency_job_id":"b8ec6853-a5a4-4d36-a3bd-2bedd1d73ce4","html_url":"https://github.com/alexwhin/cmai","commit_stats":null,"previous_names":["alexwhin/cmai"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/alexwhin/cmai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhin%2Fcmai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhin%2Fcmai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhin%2Fcmai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhin%2Fcmai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexwhin","download_url":"https://codeload.github.com/alexwhin/cmai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhin%2Fcmai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278722768,"owners_count":26034461,"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-10-07T02:00:06.786Z","response_time":59,"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","anthropic","auomation","cli","commit","git","ollama","openai","productivity","tools","typescript"],"created_at":"2025-10-07T04:53:59.098Z","updated_at":"2025-10-07T04:54:05.732Z","avatar_url":"https://github.com/alexwhin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡️ cmai - commits that write themselves\n\n![Supports Ollama](https://img.shields.io/badge/⚡-ollama-f2f2f2)\n![Supports Anthropic](https://img.shields.io/badge/⚡-anthropic-d87757)\n![Supports OpenAI](https://img.shields.io/badge/⚡-openai-05a57e)\n![Supports Gemini](https://img.shields.io/badge/⚡-gemini-8c8efe)\n[![NPM Version](https://img.shields.io/npm/v/cmai?logo=npm\u0026color=f11f7a)](https://www.npmjs.com/package/cmai)\n[![Codecov](https://img.shields.io/codecov/c/github/alexwhin/cmai?logo=codecov\u0026color=f11f7a)](https://codecov.io/gh/alexwhin/cmai)\n[![Install Size](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpackagephobia.com%2Fv2%2Fapi.json%3Fp%3Dcmai\u0026query=$.install.pretty\u0026label=size\u0026color=2ea44f)](https://packagephobia.com/result?p=cmai)\n![Build](https://img.shields.io/github/actions/workflow/status/alexwhin/cmai/pipeline.yml?branch=main\u0026color=2ea44f)\n\n![cmai terminal example](assets/demo.gif)\n\n## What It Does\n\n**cmai** analyzes your staged git changes and generates commit messages following your projects existing commit standards. Dynamically creating contextually appropriate messages in multiple languages.\n\n- ⚡ Provider flexibility – supports OpenAI, Anthropic, and local Llama (via Ollama)\n- 🧐 Smart commit generation – Context-aware messages from staged changes and git history\n- 🏃 Fast workflow – terminal, interactive, clipboard output modes with cross-platform support\n- ⚙️ Rule enforcement – define per-project or global rules to keep commits consistent\n- 📝 Multiple suggestions – generate and regenerate commit options until one fits\n- 🌍 Multi-language support – generate commits in 25+ languages\n- 🗜️ Commitlint compatibility – works seamlessly with existing commitlint setups\n- 🔒 Built-in safety – auto-redacts API keys, tokens, and secrets before sending to AI\n- 📊 Git-aware – branch context, recent commit analysis, and large diff handling\n\n## Installation\n\n```bash\npnpm add -g cmai\nnpm install -g cmai\nyarn global add cmai\n```\n\n### Try Without Installing\n\nYou can also run cmai without installing it globally using `pnpx` (or `npx`):\n\n```bash\npnpx cmai init\nnpx cmai init\n```\n\n## Quick Start Guide\n\n```bash\ngit add .\ncmai\n```\n\n### Usage Modes\n\n| Mode      | Description                               |\n| --------- | ----------------------------------------- |\n| clipboard | Copy to clipboard (default)               |\n| commit    | Create a Git commit directly              |\n| terminal  | Output a `git commit` command for editing |\n| display   | Show the messages only                    |\n\n## General Usage\n\n```bash\ncmai init         # Set up provider and key\ncmai settings     # Modify configuration\ncmai              # Generate commit messages\ncmai --dryrun     # Preview prompts before sending\n```\n\n![cmai settings example](assets/settings-rules.png)\n\n## Configuration\n\n**⚠️ Warning**: Settings are stored on a per project basis under `.cmai/settings.json`. Since this directory contains your private key, please ensure it’s listed in your `.gitignore`.\n\n```json\n{\n  \"provider\": \"OLLAMA\",\n  \"maxCommitLength\": 72,\n  \"commitChoicesCount\": 8,\n  \"usageMode\": \"TERMINAL\",\n  \"redactSensitiveData\": true,\n  \"customRules\": [\n    \"all commit messages must be lowercase\"\n  ],\n```\n\n### Environment Variables\n\nAll settings can be overridden with environment variables:\n\n```bash\nCMAI_PROVIDER=ANTHROPIC\nCMAI_MODEL=claude-3-haiku-20240307\nCMAI_USAGE_MODE=COMMIT\nCMAI_COMMIT_LANGUAGE=es\n```\n\n## Development\n\n### Prerequisites\n\n- `node` \u003e=`18.0.0`\n- `pnpm` `10.14.0` (`corepack enable` to install)\n- SonarScanner (optional): `brew install sonar-scanner`\n- Docker/OrbStack (optional): for testing GitHub Actions locally\n\n### Setup\n\n```bash\npnpm install\n\n# Development mode (auto-rebuild on changes)\npnpm dev\n```\n\n### Available Commands\n\n#### Core Development\n\n```bash\npnpm dev              # Watch mode with concurrent build \u0026 typecheck\npnpm build            # Production build\npnpm test             # Run tests in watch mode\npnpm test:ci          # Run tests once (for CI)\npnpm test:coverage    # Generate coverage report (80% threshold)\n```\n\n#### Code Quality\n\n```bash\npnpm lint             # Check code style\npnpm lint:fix         # Auto-fix style issues\npnpm typecheck        # TypeScript type checking\npnpm knip             # Find unused code/dependencies\npnpm knip:fix         # Remove unused dependencies\n```\n\n#### Analysis \u0026 Debugging\n\n```bash\npnpm sonar:local      # SonarCloud (requires project SONAR_TOKEN)\npnpm bundle:stats     # Analyze bundle size\npnpm analyze          # Package content analysis\npnpm act              # Test GitHub Actions locally (needs Docker)\n```\n\n#### Release Process\n\n```bash\npnpm release          # Interactive release with version bump \u0026 changelog\npnpm release:dry      # Preview release without publishing\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome. If you would like to get involved, please open an issue or submit a pull request to help improve the project.\n\n## License\n\nThis project is released under the MIT License.\nCreated and maintained by [Alex Whinfield](https://github.com/alexwhin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwhin%2Fcmai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwhin%2Fcmai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwhin%2Fcmai/lists"}