惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
WordPress大学
WordPress大学
小众软件
小众软件
云风的 BLOG
云风的 BLOG
IT之家
IT之家
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
宝玉的分享
宝玉的分享
博客园 - Franky
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
D
Docker
博客园 - 聂微东
C
Check Point Blog
H
Help Net Security

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
GitHub - benS-03/commait: A CLI tool for ai generated com...
dogbless · 2026-06-24 · via Hacker News - Newest: "AI"

AI-generated commit messages, built to save on tokens and time.

commait demo

npm version downloads license node version

Writing good commit messages is not hard, but why do it if AI can do it faster and better. Commait reads a staged diff and writes one for you in seconds. Includes a compression algorithm to reduce diff tokens.

Install

Quick Start

Ensure you have an API key for either OpenAI or Anthropic in your .env file. Use standard naming conventions (ex. ANTHROPIC_API_KEY)

Then run

to initialize the configurations to your preferences.

Note: initializing config is not necessary as it will be done automatically if no config file exists.

Usage

To commit staged changes, run:

This will generate a message, commit, and push to remote all in one command. It will either prompt you with options or skip prompts based on config.

Features

  • One-command workflow: Generate, commit, and push changes with a single command.

  • Multi-provider support: Generate messages using OpenAI or Anthropic with a simple config change.

  • Fully configurable automation: Dial in exactly how hands-off you want it: auto-stage changes, auto-commit the generated message, auto-push to your remote, or keep every step interactive with prompts.

  • Token budget control: Cap the max diff tokens sent per request, so generation cost stays predictable even on large diffs.

  • Diff compression pipeline: If token budget exceeded by raw diff, a custom staged compression pipeline runs, checking the tokens against the budget at each stage to reduce information loss as much as possible while still getting below budget. See compression section for more details.

  • Custom prompts: Override the default prompt template to match your team's commit conventions or personal style.

  • Optional Context: Prompt can be prefixed with custom context line using -c flag with committing.

  • Interactive model picker: Browse and select models within your chosen provider without needing to memorize exact model name strings.

  • Configurable remotes: Set a default push target, or get prompted for which remote to use on every commit.

Configuration

To run through edit all config options one by one run:

Or to edit a single option run:

$commait config set [option]

A full list of options can be seen below or gotten by running:

Config Options

  • provider: Which AI provider to use for generation.
  • model: which model to use within selected provider.
  • prompt: What to prompt provider with, a default prompt is provided.
  • auto_stage: whether or not you want commit to automatically stage all files without prompting.
  • auto_commit: whether or not you want to automatically commit after generation without prompting.
  • auto_push: whether or not you want to automatically push after commit without prompting.
  • max_diff_tokens: the maximum amount of tokens sent to AI.
  • default_origin: the default remote to push to.
  • ask_origin: whether or not you want to be asked what remote to push to upon commit.

Diff Compression

The compression pipeline works in stages, each one being increasingly more aggressive. After each stage runs, the new token count is checked against the budget so that unnecessary information loss does not occur. The 4 stages are as follows:

  1. Strip Noise Files: This removes any non user generated files, like package-lock, gemfiles, dist files, etc...

  2. Strip Headers: This will strip the header off of each file in the diff, and replace them with just the file name, and an indicator for the AI to convey if the file was deleted or renamed.

  3. Strip Context: This removes the 3 unchanged context lines before and after every hunk.

  4. Strip Lines: This is the final stage and most aggressive. This works by keeping a certain number of lines at the beginning and end of every hunk and stripping the rest. If this does not reduce the token count below the budget, it will loop this action, reducing the number of lines kept each iteration. This can run a max of 6 times, before it gives up.

Default Prompt

You are an expert software engineer writing a Git commit message.

Analyze the provided diff and write a commit message following these rules:

FORMAT:

  • First line: conventional commit >format — (): summary>
  • Types: feat, fix, refactor, chore, >docs, test, style, perf, ci
  • Scope: the module, file, or feature >area affected (omit if unclear)
  • Summary: imperative mood, lowercase, >no period, max 72 chars
  • If needed, add a blank line then a >short body (2–4 sentences max) >explaining WHY, not what

RULES:

  • Never describe what the diff looks >like — describe what the change does
  • Prefer specificity over vagueness >("add retry logic to OAuth token refresh" not "improve auth")
  • If multiple concerns are changed, pick the dominant one for the subject; list others briefly in the body
  • Do not mention file names unless they are the meaningful unit (e.g. a config file)
  • Do not wrap in backticks or add any explanation — output the commit message only

DIFF: {diff}