{"id":51470255,"url":"https://github.com/dazuaz/git-smart-commits","last_synced_at":"2026-07-06T16:30:41.538Z","repository":{"id":367640277,"uuid":"1091863296","full_name":"dazuaz/git-smart-commits","owner":"dazuaz","description":"CLI that uses an LLM to generate Conventional Commit messages and commit your changes (Bun).","archived":false,"fork":false,"pushed_at":"2026-06-26T20:56:40.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-26T22:18:55.581Z","etag":null,"topics":["bun","cli","conventional-commits","git","llm","openai"],"latest_commit_sha":null,"homepage":null,"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/dazuaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-11-07T16:23:14.000Z","updated_at":"2026-06-26T20:56:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dazuaz/git-smart-commits","commit_stats":null,"previous_names":["dazuaz/git-smart-commits"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dazuaz/git-smart-commits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazuaz%2Fgit-smart-commits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazuaz%2Fgit-smart-commits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazuaz%2Fgit-smart-commits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazuaz%2Fgit-smart-commits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dazuaz","download_url":"https://codeload.github.com/dazuaz/git-smart-commits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazuaz%2Fgit-smart-commits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35199358,"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-07-06T02:00:07.184Z","response_time":106,"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":["bun","cli","conventional-commits","git","llm","openai"],"created_at":"2026-07-06T16:30:40.712Z","updated_at":"2026-07-06T16:30:41.531Z","avatar_url":"https://github.com/dazuaz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-smart-commits\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA lightweight Bun-powered CLI that uses an AI model to produce clean Conventional Commit messages and commit your changes. By default it creates 1 squashed commit; with `--split` it can create 1..N logical commits.\n\n## Prerequisites\n- [Bun](https://bun.sh/) 1.3 or newer\n- An OpenAI-compatible API key exported as `OPENAI_API_KEY`\n\nOptional environment variables:\n- `GIT_SMART_MODEL` or `OPENAI_MODEL` to override the default (`gpt-5-nano-2025-08-07`)\n- `GIT_SMART_TEMPERATURE` or `OPENAI_TEMPERATURE` (defaults to `1`; ignored by some models like `gpt-5-nano-2025-08-07`)\n- `GIT_SMART_BASE_URL` or `OPENAI_BASE_URL` if you are using an OpenAI-compatible endpoint\n\n## Install \u0026 build\n```bash\nbun run build\nchmod +x bin/git-smart-commit\n```\n\nThe build step uses Bun's bundler to emit a standalone executable in `bin/git-smart-commit`. For details, see [Bun bundler executables](https://bun.com/docs/bundler/executables).\n\n(Optional) Add the binary to your PATH:\n```bash\ncp bin/git-smart-commit ~/.local/bin/\n```\n\n## Usage\n\nRun the tool from inside a git repository with changes:\n```bash\ngit-smart-commit\n```\n\n**API note:** For GPT‑5 models, the tool uses the OpenAI **Responses API** (recommended in the docs). For other models and some OpenAI‑compatible endpoints, it falls back to **Chat Completions**.\n\nThe CLI will:\n1. Choose what to include (staged by default; if only unstaged exists it uses that; use `--interactive` to be prompted when both staged and unstaged exist)\n2. Redact common secret-looking values from changed lines before building the model prompt\n3. Ask the model for either a single squashed commit message (default) or a 1..N commit plan (`--split`)\n4. Show the proposed message(s)\n5. Commit non-interactively by default; use `--dry-run`, `--plan-only`, or `--interactive` when you want review before commit creation\n\n**Flags:**\n- `--plan-only` \u0026mdash; print the proposed plan/messages, do nothing\n- `--dry-run` \u0026mdash; simulate staging/commits without committing\n- `--debug` \u0026mdash; print progress/timing to stderr (useful if it feels stuck)\n- `--interactive` \u0026mdash; prompt before including/committing changes\n- `--squash` \u0026mdash; create 1 squashed commit (default)\n- `--split` \u0026mdash; create 1..N commits from the plan instead of squashing\n\n**Examples:**\n```bash\n# Preview the squashed commit message without committing\ngit-smart-commit --plan-only\n\n# Simulate what would be committed\ngit-smart-commit --dry-run\n\n# Create 1 squashed commit\ngit-smart-commit\n\n# Create multiple commits (one per group)\ngit-smart-commit --split --interactive\n```\n\n### Suggested shell aliases\n```bash\nalias gsc=\"git-smart-commit\"\n```\n\n## Commit message style\n\nGenerated summaries are validated against the [Conventional Commits cheat sheet](https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13):\n- Conventional header in the form `\u003ctype\u003e(optional scope): \u003cdescription\u003e` with types like `feat`, `fix`, `docs`, `test`, `chore`, and others.\n- Lower-case, imperative descriptions under 60 characters with no trailing punctuation.\n- Optional body separated by a blank line, with supporting context wrapped at ~72 characters.\n\nMessages are validated before commit creation. If the model returns an invalid Conventional Commit header, the tool refuses to create the commit.\n\n### How the Agent Groups Changes\n\nFor `--split`, the agent asks the model to group parsed diff hunks into logical commits:\n- Analyzes file hunks with context\n- Assigns type, scope, and rationale per group\n- Verifies every hunk is assigned to a group, adding a fallback `chore` group if needed\n- Refuses split plans that would require unsafe staging of new, deleted, or renamed files across multiple commits\n\n**Example grouping outcome:**\n```\nPlan:\n- fix(router): handle 404 for nested routes\n  body: the route matcher now returns the parent index ...\n  files: apps/web/src/router.ts, apps/web/src/__tests__/router.test.ts\n\n- chore(deps): bump axios to 1.7.3\n  files: package.json, package-lock.json\n\n- docs(readme): add usage for auth middleware\n  files: README.md\n```\n\n## Troubleshooting\n- \"Missing OPENAI_API_KEY\": export your API key before running `git-smart-commit`\n- Empty diff: make sure you have local changes before invoking the command\n- API errors: check connectivity and confirm the model name is valid for your key\n- `Failed to parse LLM response as JSON`: this only affects `--split`; try the default squash mode or rerun with `--debug` to capture details\n\n## Development\n```bash\nbun test\nbun run build\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). Security reports: [SECURITY.md](SECURITY.md).\n\n## License\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazuaz%2Fgit-smart-commits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdazuaz%2Fgit-smart-commits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazuaz%2Fgit-smart-commits/lists"}