{"id":33331563,"url":"https://github.com/negoziator/ai-commit","last_synced_at":"2026-04-01T19:58:09.498Z","repository":{"id":198958042,"uuid":"701839176","full_name":"negoziator/ai-commit","owner":"negoziator","description":"Autonomous git commits","archived":false,"fork":false,"pushed_at":"2026-03-06T01:38:36.000Z","size":3566,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-06T05:37:31.601Z","etag":null,"topics":["ai","automated-commits","autonomous","commit-message","developer-tool","npm-cli"],"latest_commit_sha":null,"homepage":"","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/negoziator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"negoziator"}},"created_at":"2023-10-07T17:55:55.000Z","updated_at":"2026-03-06T01:38:15.000Z","dependencies_parsed_at":"2026-02-24T11:13:01.462Z","dependency_job_id":null,"html_url":"https://github.com/negoziator/ai-commit","commit_stats":null,"previous_names":["negoziator/ai-commit"],"tags_count":374,"template":false,"template_full_name":null,"purl":"pkg:github/negoziator/ai-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negoziator%2Fai-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negoziator%2Fai-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negoziator%2Fai-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negoziator%2Fai-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negoziator","download_url":"https://codeload.github.com/negoziator/ai-commit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negoziator%2Fai-commit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30480423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T23:57:05.347Z","status":"ssl_error","status_checked_at":"2026-03-13T23:56:58.046Z","response_time":60,"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","automated-commits","autonomous","commit-message","developer-tool","npm-cli"],"created_at":"2025-11-20T20:02:50.543Z","updated_at":"2026-03-16T23:01:34.032Z","avatar_url":"https://github.com/negoziator.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e🤖 AI-Commit 🤖\u003c/h1\u003e\n    \u003cimg src=\"./.github/screenshot.png\" alt=\"License\" width=\"1000\" height=\"300\"\u003e\n    \u003cp\u003eA powerful CLI tool that uses AI to generate meaningful, insightful git commit messages based on your code changes.\u003c/p\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@negoziator/ai-commit\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@negoziator/ai-commit\" alt=\"Current version\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n- [Features](#features)\n- [Setup](#setup)\n    - [Installation](#installation)\n    - [Upgrading](#upgrading)\n- [Usage](#usage)\n    - [CLI Mode](#cli-mode)\n    - [Git Hook Integration](#git-hook-integration)\n- [LLM Providers](#llm-providers)\n    - [OpenAI (Default)](#openai-default)\n    - [Anthropic Claude](#anthropic-claude)\n    - [Azure OpenAI](#azure-openai)\n    - [Ollama (Local)](#ollama-local)\n    - [Custom/RAG](#customrag)\n- [Configuration](#configuration)\n    - [Options](#options)\n    - [Environment Variables (.env)](#environment-variables-env)\n    - [Project-Specific Configuration](#project-specific-configuration)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n\n## Features\n\n- 🤖 **AI-Powered Commits**: Generates meaningful commit messages based on your code changes\n- 🔄 **Git Integration**: Works seamlessly with your existing Git workflow\n- 🪝 **Git Hook Support**: Can be installed as a Git hook for automatic message generation\n- 🌐 **Multiple Languages**: Supports commit messages in different locales\n- ⚙️ **Customizable**: Configure the AI model, message length, and other parameters\n- 📝 **Project Context**: Add project-specific context to improve message relevance\n- 🔌 **Multiple LLM Providers**: Choose from OpenAI, Anthropic, Azure OpenAI, Ollama, or custom endpoints\n\n## Setup\n\u003e A minimum of Node v20 is required. Check your Node.js version with `node --version`.\n\n### Installation\n1. **Install AI-Commit:**\n   ```sh\n   npm install -g @negoziator/ai-commit\n   ```\n\n2. **Choose and configure your LLM provider:**\n\n   **Option A: OpenAI (Default)**\n   ```sh\n   aicommit config set OPENAI_KEY=\u003cyour-api-key\u003e\n   ```\n   Get your API key from [OpenAI Platform](https://platform.openai.com/account/api-keys)\n\n   **Option B: Anthropic Claude**\n   ```sh\n   aicommit config set provider=anthropic\n   aicommit config set ANTHROPIC_KEY=\u003cyour-api-key\u003e\n   ```\n   Get your API key from [Anthropic Console](https://console.anthropic.com/)\n\n   **Option C: Ollama (Local, Free)**\n   ```sh\n   # Install Ollama from https://ollama.com, then:\n   ollama pull llama3.2\n   aicommit config set provider=ollama\n   aicommit config set model=llama3.2\n   ```\n\n   **Option D: Azure OpenAI**\n   ```sh\n   aicommit config set provider=azure-openai\n   aicommit config set AZURE_OPENAI_KEY=\u003cyour-key\u003e\n   aicommit config set AZURE_ENDPOINT=\u003cyour-endpoint\u003e\n   ```\n\n   See the [LLM Providers](#llm-providers) section for more options and details.\n\n### Upgrading\n\n```sh\nnpm update -g @negoziator/ai-commit\n```\n\n## Usage\n\n### CLI Mode\n\nUse `aicommit` directly to generate a commit message for your staged changes:\n\n```sh\ngit add \u003cfiles...\u003e\naicommit\n```\n\nExample workflow:\n```\n$ git add .\n$ aicommit\n✓ Analyzing your changes...\n✓ Generating commit message...\n\nAI-generated commit message:\nfeat: add project-specific configuration support via .ai-commit.json\n\n? Use this message? › (Y/n)\n```\n\n### Git Hook Integration\n\nYou can set up AI-Commit as a Git hook to automatically generate commit messages:\n\n```sh\n# Install the prepare-commit-msg hook\naicommit hook install\n```\n\nThis will add a Git hook that automatically suggests commit messages when you run `git commit`.\n\nTo uninstall the hook:\n\n```sh\naicommit hook uninstall\n```\n\n## LLM Providers\n\nAI-Commit supports multiple LLM providers, allowing you to choose the best option for your needs.\n\n### OpenAI (Default)\n\nThe default provider using OpenAI's GPT models.\n\n**Setup:**\n```sh\naicommit config set OPENAI_KEY=\u003cyour-api-key\u003e\n```\n\n**Recommended models:**\n- `gpt-4o-mini` (default, fast and cost-effective)\n- `gpt-4o` (more capable, higher cost)\n- `gpt-4-turbo`\n\n**Get your API key:** [OpenAI Platform](https://platform.openai.com/account/api-keys)\n\n---\n\n### Anthropic Claude\n\nUse Anthropic's Claude models as an alternative to OpenAI.\n\n**Setup:**\n```sh\naicommit config set provider=anthropic\naicommit config set ANTHROPIC_KEY=\u003cyour-api-key\u003e\n```\n\n**Recommended models:**\n- `claude-3-5-sonnet-20241022` (recommended, best balance)\n- `claude-3-opus-20240229` (most capable)\n- `claude-3-haiku-20240307` (fastest, most economical)\n\n**Get your API key:** [Anthropic Console](https://console.anthropic.com/)\n\n---\n\n### Azure OpenAI\n\nUse Azure's OpenAI Service for enterprise deployments.\n\n**Setup:**\n```sh\naicommit config set provider=azure-openai\naicommit config set AZURE_OPENAI_KEY=\u003cyour-api-key\u003e\naicommit config set AZURE_ENDPOINT=\u003cyour-endpoint\u003e\n```\n\n**Example endpoint:** `https://your-resource.openai.azure.com`\n\n**Note:** The `model` config should match your Azure deployment name.\n\n**Learn more:** [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/ai-services/openai-service)\n\n---\n\n### Ollama (Local)\n\nRun AI-Commit completely offline using local models via Ollama.\n\n**Setup:**\n```sh\n# 1. Install Ollama from https://ollama.com\n# 2. Pull a model\nollama pull llama3.2\n\n# 3. Configure AI-Commit\naicommit config set provider=ollama\naicommit config set model=llama3.2\n```\n\n**Recommended models:**\n- `llama3.2` (recommended, good balance)\n- `codellama` (optimized for code)\n- `mistral` (fast and capable)\n- `qwen2.5-coder` (specialized for coding)\n\n**Default endpoint:** `http://localhost:11434` (automatically configured)\n\n**Benefits:**\n- ✅ Completely free\n- ✅ Works offline\n- ✅ Privacy-focused (data never leaves your machine)\n- ✅ No API key required\n\n---\n\n### Custom/RAG\n\nConnect to custom LLM endpoints, RAG systems, or OpenAI-compatible APIs.\n\n**Setup:**\n```sh\naicommit config set provider=custom\naicommit config set CUSTOM_ENDPOINT=\u003cyour-endpoint-url\u003e\naicommit config set CUSTOM_KEY=\u003coptional-api-key\u003e\n```\n\n**Compatible with:**\n- Custom RAG implementations\n- LM Studio\n- LocalAI\n- Text Generation WebUI\n- vLLM\n- Any OpenAI-compatible API\n\n**Example:**\n```sh\naicommit config set provider=custom\naicommit config set CUSTOM_ENDPOINT=https://my-rag.example.com/v1/chat/completions\naicommit config set model=my-custom-model\n```\n\n---\n\n## Configuration\nManage configuration using the `aicommit config` command.\n\nTo get a configuration option value, use the command:\n\n```sh\naicommit config get \u003ckey\u003e\n```\nFor example, to retrieve the API key, you can use:\n\n```sh\naicommit config get OPENAI_KEY\n\u003e sk_1234567890\n```\n\nTo set a configuration option, use the command:\n\n```sh\naicommit config set \u003ckey\u003e=\u003cvalue\u003e\n```\n\n### Options\n\n#### General Options\n\n| Option              | Default         | Description                                                                           |\n|---------------------|-----------------|---------------------------------------------------------------------------------------|\n| `provider`          | `openai`        | LLM provider to use (`openai`, `anthropic`, `azure-openai`, `ollama`, `custom`)      |\n| `locale`            | `en`            | Locale for the generated commit messages                                              |\n| `generate`          | `1`             | Number of commit messages to generate                                                 |\n| `model`             | `gpt-4o-mini`   | The model to use (provider-specific)                                                  |\n| `timeout`           | `10000`         | Network request timeout in milliseconds                                               |\n| `max-length`        | `50`            | Maximum character length of the generated commit message                              |\n| `type`              | `\"\"`            | Type of commit message to generate (`conventional` or empty)                          |\n| `auto-confirm`      | `false`         | Automatically confirm the generated commit message without user prompt                |\n| `prepend-reference` | `false`         | Prepend issue reference from branch name to commit message                            |\n| `temperature`       | `0.2`           | Temperature (0.0-2.0) to control randomness of the output                             |\n| `max-completion-tokens` | `10000`     | Maximum number of tokens that can be generated in the completion                      |\n| `proxy`             | N/A             | HTTPS proxy URL (e.g., `http://proxy.example.com:8080`)                              |\n\n#### Provider-Specific Options\n\n| Option              | Provider        | Description                                                                           |\n|---------------------|-----------------|---------------------------------------------------------------------------------------|\n| `OPENAI_KEY`        | OpenAI          | OpenAI API key (starts with `sk-`)                                                    |\n| `ANTHROPIC_KEY`     | Anthropic       | Anthropic API key (starts with `sk-ant-`)                                             |\n| `AZURE_OPENAI_KEY`  | Azure OpenAI    | Azure OpenAI API key                                                                  |\n| `AZURE_ENDPOINT`    | Azure OpenAI    | Azure OpenAI endpoint URL (e.g., `https://your-resource.openai.azure.com`)           |\n| `OLLAMA_ENDPOINT`   | Ollama          | Ollama server endpoint (default: `http://localhost:11434`)                            |\n| `CUSTOM_ENDPOINT`   | Custom          | Custom API endpoint URL                                                               |\n| `CUSTOM_KEY`        | Custom          | Custom API key (optional, for endpoints requiring authentication)                     |\n\n### Environment Variables (.env)\n\nFor local development, you can create environment files in your project root:\n\n**For CLI usage** (`.env`):\n```bash\n# .env - Used when running aicommit\nprovider=anthropic\nANTHROPIC_KEY=sk-ant-...\nmodel=claude-3-5-sonnet-20241022\nmax-length=80\n```\n\n**For testing** (`.env.local`):\n```bash\n# .env.local - Used when running npm test\nOPENAI_KEY=sk-...\n# or\nprovider=anthropic\nANTHROPIC_KEY=sk-ant-...\n```\n\n**File usage:**\n- `.env` → Loaded when running `aicommit` (CLI usage)\n- `.env.local` → Loaded when running `npm test` (local testing only)\n- Both files are gitignored for security\n\n**Priority order** (highest to lowest):\n1. `.ai-commit.json` (project-specific)\n2. CLI arguments\n3. Environment variables (`.env`, `.env.local`, or shell)\n4. Global config (`~/.aicommit`)\n\n**Note:** See `.env.example` for all available options. Copy it to `.env` for CLI usage or `.env.local` for testing.\n\n### Project-Specific Configuration\n\nYou can add a `.ai-commit.json` file in the root of your project to provide additional context about your project to the AI and to override global configuration settings for the specific project.\n\n**Example with OpenAI:**\n```json\n{\n  \"projectPrompt\": \"This is a Node.js CLI tool that uses AI to generate meaningful git commit messages.\",\n  \"model\": \"gpt-4o\",\n  \"locale\": \"en\",\n  \"max-length\": \"100\",\n  \"temperature\": \"0.5\"\n}\n```\n\n**Example with Anthropic:**\n```json\n{\n  \"provider\": \"anthropic\",\n  \"ANTHROPIC_KEY\": \"sk-ant-...\",\n  \"model\": \"claude-3-5-sonnet-20241022\",\n  \"projectPrompt\": \"This is a TypeScript library for data validation.\",\n  \"max-length\": \"80\"\n}\n```\n\n**Example with Ollama:**\n```json\n{\n  \"provider\": \"ollama\",\n  \"model\": \"codellama\",\n  \"projectPrompt\": \"This is a Python web application using FastAPI.\",\n  \"temperature\": \"0.3\"\n}\n```\n\nThe `.ai-commit.json` file can contain any of the configuration options listed in the [Options](#options) section. Values set in this file will take precedence over the global configuration.\n\nThe `projectPrompt` field should contain a brief description of your project, its purpose, and any other relevant information that would help the AI understand the context of your code changes.\n\n## Maintainers\n[![NegoZiatoR](https://img.shields.io/badge/NegoZiatoR-blue?style=flat\u0026logo=x\u0026link=https://twitter.com/negoziator)](https://twitter.com/negoziator)\n\n## Contributing\nIf you want to help fix a bug or implement a feature in [Issues](https://github.com/negoziator/ai-commit/issues), checkout\nthe [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.\n","funding_links":["https://github.com/sponsors/negoziator"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegoziator%2Fai-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegoziator%2Fai-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegoziator%2Fai-commit/lists"}