npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cat94cute/ai-commit

v1.0.3

Published

用 AI 生成 Git commit message

Readme

🚀 ai-commit — 用 AI 自動生成 Git Commit Message

ai-commit 是一款命令列工具(CLI),能根據你的 git diff 自動產生符合 Conventional Commits 的 commit message。 支援多種 AI Provider(目前 Groq、Gemini、DeepSeek 已完成),讓你不必再花時間想 commit 名稱。


✨ 功能特色

  • 🔍 自動分析 git diff 的變更內容
  • ✨ 使用多家 AI 模型生成 Commit Message
  • 📏 支援大型 diff,自動分 chunk 避免 token 上限
  • 🎉 一鍵完成 commit

📦 安裝

全域安裝(建議)

npm install -g @cat94cute/ai-commit

專案內安裝

npm install @cat94cute/ai-commit
npm link

🚀 使用方式

1. 設定參數

ai config
目前使用: Groq
需要進行甚麼操作:
❯ AI Provider / Model 更換
  API Key 設定
  Chunk Size 設定
  AI Prompt 設定
  取消

2. AI Provider / Model 更換

請選擇 AI Provider:
❯ Groq (目前使用中)
  Gemini
  DeepSeek

AI Provider 已儲存 ✔

3. API Key 設定

依照你選的 provider 儲存對應 API key。

請輸入您的 API Key:
> XXXXXXXXXXXXXXXXXXXXXX

API Key 已儲存 ✔

4. Chunk Size 設定 (可選)

  • Chunk Size 代表每次送給 AI 模型的 git diff 字數上限,預設為30000
  • 若 diff 太大,超過 AI 模型的 token 限制,會導致無法正確生成 commit message。
  • 系統會自動將 diff 拆成多段(chunks),每段長度不超過這個數值,再依序送給 AI。
  • 一般建議保留預設值即可,只有在 diff 很大或想精細控制時才調整。
目前 Chunk Size 為: 30000
請輸入新的 Chunk Size:
❯ 15000

Chunk Size 已儲存 ✔

5. AI Prompt 設定 (可選)

  • 這個設定可以讓你自訂 AI 生成 commit message 的提示語(prompt)。
  • 例如,你可以指定 AI 使用繁體中文、英文,或加入特定規則(如簡短語句、列點、標註破壞性變更等)。
  • 若未設定,系統會使用預設 prompt,已經能產生符合 Conventional Commits 規範的 commit message。
  • 建議一般使用者保持預設,進階使用者或有特殊需求時再修改。
請輸入 AI Prompt:
❯ 你是一個 commit message 助手,請根據 git diff 生成符合 Conventional Commits 的 commit message。

AI Prompt 已儲存 ✔

6. 產生 Commit Message

ai commit

📘 完整指令表

| 指令 | 功能 | | -------------------- | -------------------------------------------- | | ai commit | 根據 git diff 產生 commit message | | ai config | 設定 AI 相關參數(Provider / API Key / Chunk Size / Prompt) | | ai help | 列出所有指令 |

🧩 支援的 AI Provider

| Provider | Model 名稱 | 支援狀態 | | -------- | --------------------------- | ----- | | Groq | meta-llama/llama-4-scout-17b-16e-instruct | 🟢 完成 | | Gemini | gemini-2.5-flash-lite | 🟢 完成 | | DeepSeek | deepseek-chat | 🟢 完成 | | OpenAI | | ⏳ 計畫中 |

🚧 預計功能

  • OpenAI Provider 支援
  • 多語系 commit message