{"id":48805569,"url":"https://github.com/spectra010s/git-aic","last_synced_at":"2026-04-14T05:01:26.538Z","repository":{"id":343530212,"uuid":"1172560524","full_name":"Spectra010s/git-aic","owner":"Spectra010s","description":"AI-powered Git commit generator using Google Gemini ","archived":false,"fork":false,"pushed_at":"2026-04-03T02:25:40.000Z","size":68,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T10:46:49.127Z","etag":null,"topics":["ai","ai-commits","commit","commit-generator","git","git-aic","git-subcommand","git-tool","spectra010s"],"latest_commit_sha":null,"homepage":"https://medium.com/codex/building-an-ai-powered-git-commit-message-tool-from-scratch-using-google-gemini-llm-a1a5eca5766a","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Spectra010s.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":"2026-03-04T12:57:41.000Z","updated_at":"2026-04-03T03:37:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Spectra010s/git-aic","commit_stats":null,"previous_names":["spectra010s/git-aic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Spectra010s/git-aic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spectra010s%2Fgit-aic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spectra010s%2Fgit-aic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spectra010s%2Fgit-aic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spectra010s%2Fgit-aic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spectra010s","download_url":"https://codeload.github.com/Spectra010s/git-aic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spectra010s%2Fgit-aic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["ai","ai-commits","commit","commit-generator","git","git-aic","git-subcommand","git-tool","spectra010s"],"created_at":"2026-04-14T05:01:24.481Z","updated_at":"2026-04-14T05:01:26.519Z","avatar_url":"https://github.com/Spectra010s.png","language":"TypeScript","readme":"# Git Aic\n\n**git-aic** is a command-line interface (CLI) tool built in TypeScript that upgrades your Git workflow by automatically generating high-quality, conventional commit messages.\n\nPowered by Google Gemini, it analyzes your staged code changes and produces concise, descriptive, and standard-compliant commit messages, helping you maintain a clean and consistent Git history.\n\nYou define the rules.  \nYou customize the system prompt.  \nYou decide when it runs.\n\nYour workflow. Your control.\n\n## Features\n\n- **AI-Powered Message Generation**  \n  Uses Google Gemini API to generate commit messages from your Git diff.\n\n- **Self-Hosted \u0026 On-Demand**  \n  Runs locally in your terminal. No background processes. No editor lock-in.\n\n- **Full Control Over Rules**  \n  Modify the system prompt to enforce your own commit conventions and formatting style.\n\n- **Flexible Prompt Management**  \n  Edit prompts globally or per repository, and set them from your editor, direct text, or a file.\n\n- **Conventional Commits Compliance**  \n  Strictly follows formats like `feat:`, `fix:`, `refactor:`, `chore:`.\n\n- **Commit Confirmation \u0026 Editing**  \n  Before committing, you can:\n  - Accept the suggested commit message\n  - Edit the full message in your editor\n  - Reject it\n  - Retry generation\n\n- **Issue Linking**  \n  Attach commits to GitHub issues with `--issue \u003cnumber\u003e`.\n\n- **Optional Push After Commit**  \n  Use `-p` or `--push` to push after committing.\n\n- **Config Management**  \n  Set your Gemini API key or view your config:\n  - `git aic config --key \u003ckey\u003e`\n  - `git aic config`\n\n- **TypeScript \u0026 Type Safety**  \n  Built with TypeScript for maintainability and reliability.\n\n- **Seamless Git Integration**  \n  Directly integrates with Git using a CLI.\n\n## Why Not Just Use Copilot?\n\nMany AI commit tools:\n\n- Depend on editor integrations\n- Limit customization\n- Enforce their defaults\n- Restrict usage\n- Run continuously in the background\n\nThis tool is different.\n\nIt runs only when you call it.  \nIt follows your prompt rules.  \nIt generates commits exactly how you define them.  \nIt stays out of your way.\n\nThere are no forced conventions.  \nNo hidden behavior.  \nNo unnecessary background processes.\n\nIf needed, you can rotate API keys later. You stay in control.\n\nThis is controlled automation — not passive AI assistance.\n\n## User Installation\n\nTo install `git-aic` globally via npm:\n\n```bash\nnpm i -g git-aic\n```\n\n```bash\ngit aic --help\n```\n\n## Developer Installation (For Contributors)\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Spectra010s/git-aic.git\ncd git-aic\n```\n\n### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n### 3. Build the Project\n\n```bash\nnpm run build\n```\n\n## Configuration\n\n### Set API Key (Primary)\n\nUse the CLI config command to save your Google Gemini API key:\n\n```bash\ngit aic config --key \u003cyour_api_key\u003e\n```\n\nTo view your current config:\n\n```bash\ngit aic config\n```\n\n\u003e **Note:** It is masked by default for security reasons.\n\nTo view the full saved API key:\n\n```bash\ngit aic config --show\n```\n\n### Environment Variable (Fallback)\n\nIf you prefer not to use the config system, you can set it manually in your environment:\n\n- **macOS / Linux:**\n\n```bash\nexport GEMINI_COMMIT_MESSAGE_API_KEY=your_api_key_here\n```\n\n- **Windows (PowerShell):**\n\n```powershell\nsetx GEMINI_COMMIT_MESSAGE_API_KEY \"your_api_key_here\"\n```\n\nAfter setting the variable, restart your terminal.\n\n\u003e **Note:** This method works, but using the CLI config is safer and easier for long-term usage.\n\n## Usage\n\n### Commit With AI Assistance\n\n```bash\ngit aic\n```\n\n- Prompts you with a generated commit message.\n- You can **accept, edit, reject, or retry** the message.\n- Editing opens your editor and supports multiline commit messages.\n\n### Commit and Link to Issue\n\n```bash\ngit aic --issue 123\n```\n\n- Attaches the commit to GitHub issue #123.\n\n### Commit and Push\n\n```bash\ngit aic -p\n```\n\n- Pushes automatically after committing.\n\n### Configure API Key\n\n```bash\ngit aic config --key \u003ckey\u003e\n```\n\n- Saves your Google Gemini API key.\n\n```bash\ngit aic config\n```\n\n- Displays your saved config.\n\n### Manage Prompts\n\nEdit the global prompt:\n\n```bash\ngit aic prompt edit\n```\n\nSet the global prompt directly from text:\n\n```bash\ngit aic prompt edit --text \"Write concise conventional commits with a short body when needed.\"\n```\n\nLoad the global prompt from a file:\n\n```bash\ngit aic prompt edit --file ./prompt.txt\n```\n\nReset the global prompt:\n\n```bash\ngit aic prompt reset\n```\n\nEdit a repository-local prompt:\n\n```bash\ngit aic prompt edit --local\n```\n\nSet a repository-local prompt from text:\n\n```bash\ngit aic prompt edit --local --text \"Use a short subject and a clear explanatory body.\"\n```\n\nLoad a repository-local prompt from a file:\n\n```bash\ngit aic prompt edit --local --file ./commit-prompt.txt\n```\n\nReset the local prompt:\n\n```bash\ngit aic prompt reset --local\n```\n\nPrompt resolution order:\n\n1. local prompt from Git config\n2. global prompt from Git-AIC config\n3. built-in default prompt\n\n## How It Works\n\n1. Captures your staged Git diff\n2. Builds a strict system prompt\n3. Resolves the active prompt from local, global, or default settings\n4. Sends the prompt and diff to Gemini\n5. Prompts for commit confirmation (accept, edit, retry, reject)\n6. Opens your editor when you choose to edit the generated message\n7. Executes `git commit` automatically\n8. Optionally pushes if `-p` flag is used\n\n---\n\n## Technologies Used\n\n| Technology        | Purpose                |\n| ----------------- | ---------------------- |\n| TypeScript        | Core language          |\n| Node.js           | Runtime                |\n| Axios             | HTTP client            |\n| Chalk             | Styled terminal output |\n| Commander.js      | CLI framework          |\n| Simple-Git        | Git integration        |\n| Google Gemini API | LLM text generation    |\n\n## Final Takeaway\n\nAutomating repetitive tasks like **commit messages** saves time — but the real win here is ownership.\n\ngit-aic:\n\n- **Self-hosted** — runs entirely on your machine\n- **On-demand** — only runs when you call it\n- **Fully customizable** — prompts, commit format, workflow\n- **Under your control** — you decide every step\n\nIt runs when you need it, follows your rules, and generates commits the way **you** want.\n\n_Choose your model. Define your prompt. Control the format. Extend or optimize anytime._\n\nInstead of adapting to someone else's defaults, _you built a system tailored to your workflow._\n\nYou are not just using AI tools.  \nYou are **building them to fit your process.**\n\n## License\n\n[**ISC License**](https://github.com/Spectra010s/git-aic/blob/main/LICENSE)\n\n## Author\n\nSpectra010s\n\n- [Twitter](https://x.com/Spectra010s)\n- [LinkedIn](https://www.linkedin.com/in/adeloye-adetayo-273723253)\n\n## Parent Repository\n\nThis project is a fork and standalone version of:\n\n[https://github.com/samueltuoyo15/Commit-Message-Tool](https://github.com/samueltuoyo15/Commit-Message-Tool)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectra010s%2Fgit-aic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspectra010s%2Fgit-aic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectra010s%2Fgit-aic/lists"}