{"id":27629990,"url":"https://github.com/chrise217/git-ai-commit","last_synced_at":"2026-04-01T23:57:59.426Z","repository":{"id":287565451,"uuid":"965050481","full_name":"ChrisE217/git-ai-commit","owner":"ChrisE217","description":"Generate concise Git commit messages using the power of local AI models with Ollama.  git-ai-commit analyzes your staged changes and uses a local large language model (LLM) via Ollama to suggest a relevant and brief commit message. Streamline your workflow and let AI handle the first draft of your commit messages!","archived":false,"fork":false,"pushed_at":"2025-04-22T10:22:47.000Z","size":1475,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T16:16:59.304Z","etag":null,"topics":["ai","git","llm","ollama"],"latest_commit_sha":null,"homepage":"https://chrise217.github.io/git-ai-commit/","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/ChrisE217.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-04-12T09:53:39.000Z","updated_at":"2025-04-22T10:22:50.000Z","dependencies_parsed_at":"2025-04-12T14:54:31.567Z","dependency_job_id":null,"html_url":"https://github.com/ChrisE217/git-ai-commit","commit_stats":null,"previous_names":["chrise217/git-ai-commit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisE217%2Fgit-ai-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisE217%2Fgit-ai-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisE217%2Fgit-ai-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisE217%2Fgit-ai-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisE217","download_url":"https://codeload.github.com/ChrisE217/git-ai-commit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468277,"owners_count":21435453,"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","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","git","llm","ollama"],"created_at":"2025-04-23T16:17:04.141Z","updated_at":"2026-03-27T04:41:57.868Z","avatar_url":"https://github.com/ChrisE217.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git AI Commit\n\n[![npm version](https://badge.fury.io/js/%40chris_glolabs%2Fgit-ai-commit.svg)](https://badge.fury.io/js/%40chris_glolabs%2Fgit-ai-commit)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Generate concise Git commit messages using the power of local AI models with Ollama.**\n\n`git-ai-commit` analyzes your staged changes and uses a local large language model (LLM) via [Ollama](https://ollama.com/) to suggest a relevant and brief commit message. Streamline your workflow and let AI handle the first draft of your commit messages!\n\n## Installation\n\nInstall the package globally using npm:\n\n```bash\nnpm install -g @chris_glolabs/git-ai-commit\n```\n\nThe installation process automatically runs a setup script that:\n\n1.  Checks if Git is installed.\n2.  Sets up a global Git alias: `git aic` which executes `git-ai-commit`.\n\nYou can now use `git aic` in any Git repository on your system.\n\n## Features\n\n- ✨ **AI-Powered Commits**: Leverages local LLMs through Ollama for message generation.\n- 🏡 **Local First**: Keep your code private. No data is sent to external servers (besides your local Ollama instance).\n- 🚀 **Simple Workflow**: Integrates seamlessly with your Git process via a handy alias (`git aic`).\n- ⚙️ **Configurable**: Choose your preferred Ollama model, set timeouts, customize prompts, and decide whether to auto-accept suggestions.\n- 🤖 **Automatic Setup**: Installs a convenient `git aic` alias during setup.\n- ✅ **Interactive Confirmation**: Review and confirm the generated message before committing (configurable).\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n1.  **Git**: [Download Git](https://git-scm.com/downloads)\n2.  **Node.js**: (Version 16 or higher recommended) [Download Node.js](https://nodejs.org/)\n3.  **Ollama**: Needs to be installed and running.\n    - [Download Ollama](https://ollama.com/download)\n    - **Important:** Make sure the Ollama server is running before using `git-ai-commit`. You can typically start it by running `ollama serve` in your terminal.\n    - Ensure you have pulled at least one model (e.g., `ollama pull llama3:8b`).\n\n## Usage\n\nUsing `git-ai-commit` is straightforward:\n\n1.  **Stage your changes**: Make your code changes and stage them using `git add`.\n\n    ```bash\n    # Example: Stage all changes\n    git add .\n    ```\n\n    ```bash\n    # Example: Stage specific files\n    git add src/feature.js src/utils.js\n    ```\n\n2.  **Generate the commit message**: Run the `git aic` command.\n\n    ```bash\n    git aic\n    ```\n\n3.  **Review and Confirm**:\n\n    - The tool will connect to your running Ollama instance, analyze the staged diff, and generate a commit message.\n    - It will display the suggested message and ask for your confirmation.\n    - Press `Enter` (or `y` then `Enter`) to accept and commit.\n    - Press `n` then `Enter` to abort the commit.\n\n    _(You can disable the confirmation step via configuration - see below)_\n\n**Alternative Commands:**\n\nYou can also invoke the tool directly:\n\n```bash\n# Equivalent to 'git aic'\ngit-ai-commit\n\n# Explicitly use the 'commit' command (same as default)\ngit-ai-commit commit\n```\n\n## Configuration\n\nYou can customize `git-ai-commit`'s behavior using the `config` command:\n\n```bash\ngit aic config\n# or directly via\ngit-ai-commit config\n```\n\nThis will launch an interactive prompt allowing you to configure:\n\n- **Model Selection**: Choose which Ollama model to use (e.g., `llama3:8b`, `mistral`). It attempts to list models available locally if Ollama is running. Ideally choosing a model that will run comfortably on your machine.\n- **Always Accept**: Set to `true` to skip the confirmation step and automatically use the generated commit message. Defaults to `false`.\n- **Timeout**: Set the timeout (in seconds) for requests to the Ollama API. Increase this if you use larger models or have slower hardware. Defaults to 30 seconds.\n- **Custom Prompt**: Allows you to provide your own prompt template for generating commit messages. You can edit the prompt directly in your default text editor.\n\nYour configuration is saved in `~/.git-ai-commit/config.json`.\n\n## Troubleshooting\n\n- **Error: Ollama is not installed**: Make sure you have installed Ollama correctly. See [Prerequisites](#prerequisites).\n- **Error: Ollama is not running**: Start the Ollama server, usually by running `ollama serve` in your terminal.\n- **Error: Request timed out / Ollama is taking too long**:\n  - Your selected model might be too large for your system or the changes are too complex.\n  - Try configuring a smaller model (e.g., `llama3:8b` instead of `llama3:70b`) using `git-ai-commit config`.\n  - Increase the timeout using `git-ai-commit config`.\n- **Error: Failed to fetch available models**: This might happen if Ollama isn't running or accessible when you run `git-ai-commit config`. You can still manually type the name of a model you know you have installed.\n\n## Clone and run locally\n\nIf you want to clone and run the tool locally:\n\n1.  Clone the repository.\n2.  Install dependencies: `npm install`\n3.  Build the TypeScript code: `npm run build`\n4.  Link the tool for using `npm link`\n5.  Run the CLI: `git aic \u003ccommand\u003e`\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details (if applicable, otherwise state MIT License).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrise217%2Fgit-ai-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrise217%2Fgit-ai-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrise217%2Fgit-ai-commit/lists"}