# unique-aicommit

> A tool to generate standardized commit messages using AI.

Latest version **1.0.39** (published 2026-11-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install unique-aicommit
pnpm add unique-aicommit
yarn add unique-aicommit
bun add unique-aicommit
```

Provides the command `aicommit`.

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.0.39 |
| Published | 2026-11-27 |
| First published | 2024-07-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 43.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | HashCookie |
| Maintainers | ckiejs |
| Keywords | AI, commit, git, automation, conventional-commits |

## Links

- npm: https://www.npmjs.com/package/unique-aicommit
- Repository: https://github.com/HashCookie/aicommit
- Homepage: https://github.com/HashCookie/aicommit#readme
- Issues: https://github.com/HashCookie/aicommit/issues
- npm.io page: https://npm.io/package/unique-aicommit

## Dependencies (2)

- [@inquirer/input](https://npm.io/package/@inquirer/input.md) ^5.2.1
- [@inquirer/select](https://npm.io/package/@inquirer/select.md) ^5.3.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.39 (latest) — 2026-11-27
- 1.0.38 — 2026-11-27
- 1.0.37 — 2025-02-20
- 1.0.35 — 2025-02-18
- 1.0.34 — 2025-02-11
- 1.0.33 — 2025-02-10
- 1.0.30 — 2025-02-10
- 1.0.29 — 2025-02-10
- 1.0.28 — 2025-01-22
- 1.0.27 — 2025-01-22
- 1.0.23 — 2025-01-22
- 1.0.25 — 2024-11-21
- 1.0.24 — 2024-11-18
- 1.0.22 — 2024-10-25
- 1.0.21 — 2024-10-25
- … 18 more at https://npm.io/package/unique-aicommit/versions

## README

<div align="center">
  <h1>aicommit</h1>
  <p>
    A lightweight CLI that generates Conventional Commits messages and branch
    names from staged git diffs using AI.
  </p>
  <p>
    <a href="https://www.npmjs.com/package/unique-aicommit"
      ><img
        src="https://img.shields.io/npm/v/unique-aicommit"
        alt="npm version"
      ></a
    >
    <a href="https://www.npmjs.com/package/unique-aicommit"
      ><img
        src="https://img.shields.io/npm/dt/unique-aicommit"
        alt="npm downloads"
      ></a
    >
    <img
      src="https://img.shields.io/badge/node-%3E%3D20-brightgreen"
      alt="node >= 20"
    >
  </p>
  <p><strong>English</strong> | <a href="./README.zh-CN.md">简体中文</a></p>
</div>

<div align="center">
  <img src="public/aicommit.jpg" alt="aicommit demo" width="720">
</div>

## Quick Start

Requires Node.js >= 20.

```sh
# 1. Install globally
npm install -g unique-aicommit

# 2. Run interactive setup (or configure manually / via env vars)
aicommit setup

# 3. Stage your changes and generate a commit message
git add .
aicommit
```

## Usage

### Generate a commit message

```sh
git add <files...>
aicommit

# Stage modified tracked files and commit immediately
aicommit -a -y

# Provide extra context for the AI
aicommit -c "fix Safari date parsing"
```

Interactive actions:

- **Accept** — commit directly with the generated message
- **Edit** — modify the message before committing
- **Regenerate** — request a new suggestion
- **Cancel** — abort

### Generate and checkout a branch

```sh
aicommit branch
# shorthand
aicommit b
```

Pick a prefix (`feat`, `fix`, `docs`, `chore`, `refactor`, or `none`), preview the full branch name, and confirm to run `git checkout -b`.

## Supported Providers

If an API key is not set in `~/.aicommitrc`, `aicommit` falls back to the corresponding environment variable. If `AI_PROVIDER` is unset, it auto-detects the first provider with a configured key.

| Provider      | Default Model              | Config Key        | Env Fallback                        | Get Key                                                  |
| ------------- | -------------------------- | ----------------- | ----------------------------------- | -------------------------------------------------------- |
| `deepseek`    | `deepseek-chat`            | `DEEPSEEK_KEY`    | `DEEPSEEK_API_KEY`                  | [DeepSeek](https://platform.deepseek.com/)               |
| `moonshot`    | `moonshot-v1-8k`           | `MOONSHOT_KEY`    | `MOONSHOT_API_KEY`                  | [Moonshot](https://platform.moonshot.cn/)                |
| `siliconflow` | `Qwen/Qwen2.5-7B-Instruct` | `SILICONFLOW_KEY` | `SILICONFLOW_API_KEY`               | [SiliconFlow](https://cloud.siliconflow.cn/)             |
| `openai`      | `gpt-4o-mini`              | `OPENAI_KEY`      | `OPENAI_API_KEY`                    | [OpenAI](https://platform.openai.com/api-keys)           |
| `openrouter`  | `openai/gpt-4o-mini`       | `OPENROUTER_KEY`  | `OPENROUTER_API_KEY`                | [OpenRouter](https://openrouter.ai/keys)                 |
| `gemini`      | `gemini-2.0-flash`         | `GEMINI_KEY`      | `GEMINI_API_KEY` / `GOOGLE_API_KEY` | [Google AI Studio](https://aistudio.google.com/apikey)   |
| `groq`        | `llama-3.3-70b-versatile`  | `GROQ_KEY`        | `GROQ_API_KEY`                      | [Groq](https://console.groq.com/keys)                    |
| `anthropic`   | `claude-3-5-haiku-latest`  | `ANTHROPIC_KEY`   | `ANTHROPIC_API_KEY`                 | [Anthropic](https://console.anthropic.com/settings/keys) |
| `ollama`      | `llama3.2`                 | Not required      | -                                   | [Ollama](https://ollama.com/)                            |

### Local models with Ollama (no API key required)

```sh
aicommit config set AI_PROVIDER=ollama
aicommit config set AI_MODEL=llama3.2
```

### Custom OpenAI-compatible endpoints (OneAPI, LM Studio, proxies)

```sh
aicommit config set AI_BASE_URL=https://api.example.com/v1
aicommit config set AI_MODEL=<model_name>
```

## Configuration

Settings are stored in `~/.aicommitrc` with `0600` file permissions.

```sh
aicommit config list                     # Show active configuration (keys are masked)
aicommit config get <key>                # Read a single config value
aicommit config set <key>=<value>        # Set a config value
aicommit config unset <key>              # Remove a config value
```

Common options:

- `AI_PROVIDER` — active provider (automatically resets `AI_MODEL` to that provider's default)
- `AI_MODEL` — override the default model
- `AI_BASE_URL` — override the default API base URL
- `AI_LOCALE` — commit description language (default: `en`, e.g. `zh` for Simplified Chinese)
- `MAX_DIFF_CHARS` — maximum diff characters sent to the model (default: `32000`)

## Development

```sh
npm test
```

## License

ISC · Inspired by [aicommits](https://github.com/Nutlope/aicommits)

---
_Source: https://npm.io/package/unique-aicommit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
