ai-commit is a Bun CLI that:
- Creates/switches to a branch
- Stages all tracked and untracked changes
- Summarizes staged diffs per file asynchronously, then generates commit + PR metadata
- Commits, pushes, and opens a PR using
gh
flowchart TD
A[Run CLI: aic or ai-commit] --> B[Parse args + env]
B --> C[Validate tools: git, gh]
C --> D[Resolve branches]
D --> E[git add -A]
E --> F[Read staged status + per-file diffs]
F --> G[Async per-file AI summaries]
G --> H[AI metadata generation]
H --> I[git commit]
I --> J[git push]
J --> K{--no-pr or --current-branch?}
K -- Yes --> L[Done]
K -- No --> M[gh pr create]
M --> L
- Bun
gitgh(GitHub CLI) for PR creation- OpenAI-compatible API credentials
bun install# run once without installing globally
npx @juniyadi/ai-commit --help
# install globally
npm i -g @juniyadi/ai-commit
aic --helpbun run index.ts --branch feat/my-changebun link
ai-commit --branch feat/my-change
aic --branch feat/my-changeaic and ai-commit are equivalent:
aic --branch <name> [options]
# or
ai-commit --current-branch [options]Required:
--branch <name>branch to create/switch and push, or--current-branchcommit/push current branch and skip PR creation
Options:
--base <branch>base branch for PR (default: remote HEAD, fallback current branch)--model <model>model id (default:gpt-4o-mini)--api-key <key>API key (or env vars)--base-url <url>OpenAI-compatible API base URL--provider-name <name>provider label used by AI SDK--api-mode <mode>chatorresponses(default:chat)--responses-path <path>responses API path (default:/responses)--remote <name>git remote name (default:origin)--no-prskip PR creation--dry-runonly generate AI metadata--debugprint API request/response diagnostics (sensitive values are masked)
--skill is an optional command family to install/update/remove skill markdown files.
- Manage reusable AI-agent skills in either repository scope or user scope.
- Keep skill format generic so it works for Codex, Claude, or other agents.
# install
aic --skill install --file <path/to/skill.md> --scope <repo|user> [--agent <codex|claude|generic>] [--name <skill-name>] [--force]
# update
aic --skill update --file <path/to/skill.md> --scope <repo|user> [--agent <codex|claude|generic>] [--name <skill-name>] [--force]
# remove
aic --skill remove --name <skill-name> --scope <repo|user> [--agent <codex|claude|generic>]--scope repo: install inside current repository.--scope user: install in user-level skill directory.
Default target directories:
codex+repo:.codex/skills/codex+user:~/.codex/skills/claude+repo:.claude/skills/claude+user:~/.claude/skills/generic+repo:.skills/generic+user:~/.skills/
---
name: conventional-commit-writer
description: Generate clear conventional commit messages from git diff.
version: 1.0.0
agent: generic
---
# conventional-commit-writer
## Use when
- You need a commit message from staged changes.
## Inputs
- `git diff --cached`
- `git status --short`
## Rules
- Use Conventional Commits.
- Keep subject <= 72 characters.
- Mention breaking changes explicitly.
## Output
- Single commit message with optional body.installfails if target exists, unless--forceis set.updatefails if target does not exist, unless--forceis set (create).removedeletes target skill markdown from resolved directory.--nameoverrides filename derived from markdownname.--agentdefaults togenericwhen omitted.- Validate markdown has required fields:
name,description.
OPENAI_API_KEYorAI_COMMIT_API_KEYOPENAI_BASE_URLorOPENAI_API_BASE_URLorAI_COMMIT_BASE_URLorAI_COMMIT_API_URLOPENAI_MODELorAI_COMMIT_MODELAI_COMMIT_PROVIDER_NAME(optional)AI_COMMIT_API_MODEorOPENAI_API_MODE(chatorresponses)AI_COMMIT_USE_RESPONSES_APIorOPENAI_USE_RESPONSES_API(true/false)AI_COMMIT_RESPONSES_PATHorOPENAI_RESPONSES_PATH(default:/responses)AI_COMMIT_SUMMARY_CONCURRENCY(default:4, max:12) controls parallel per-file AI summary callsAI_COMMIT_MOCK_METADATA_JSON(optional, local testing without API calls)AI_COMMIT_DEBUG(true/false, optional)
CLI args override environment variables.
bun run build:local
./dist/ai-commit --branch feat/my-change
# build all targets
bun run build:all
bun run build:mac-arm64
bun run build:mac-amd64
bun run build:linux-amd64
bun run build:linux-arm64Output binaries are written to dist/:
ai-commit-macos-arm64ai-commit-macos-amd64ai-commit-linux-arm64ai-commit-linux-amd64
This repo includes a release workflow at .github/workflows/release.yml.
When you push a tag like v1.0.0, GitHub Actions will:
- Run builds for:
- Linux AMD64
- Linux ARM64
- macOS AMD64
- macOS ARM64
- Use Node.js
20and Bun in the workflow. - Upload all binaries to the GitHub Release for that tag.
- Upload
checksums.txt(SHA-256 for all release binaries). - Publish
@juniyadi/ai-committo npm using GitHub OIDC trusted publishing.
Tag and push example:
git tag v1.0.0
git push origin v1.0.0