ai-conventional-commit-cli

🤖 Providers & Models

Route through OpenCode-supported models, the Claude CLI with no API key, or the Anthropic SDK directly.

The CLI is provider-agnostic. A model string takes the form provider/name, and the provider prefix selects which adapter handles the request.

🌐 Supported providers

ProviderExample model stringsAuth
OpenCode (any supported model)github-copilot/claude-sonnet-4.6, opencode/big-pickleOpenCode session
Claude CLI (no API key needed)claude/sonnet, claude/opus, claude/fableClaude Code auth
Anthropic SDK (direct API)anthropic/claude-sonnet-4-6, anthropic/claude-opus-4-7ANTHROPIC_API_KEY env var
Codex CLIcodex/gpt-5.5Codex CLI auth

🎯 Picking a model

models lists what you can use from every provider available on this machine, one provider/model id per line:

  • OpenCode: whatever opencode models reports.
  • Claude CLI: the aliases claude --help documents (fable, opus, sonnet), when claude is on your PATH.
  • Anthropic SDK: the live model list from the API, only when ANTHROPIC_API_KEY is set.
  • Codex CLI: not listed; model names are free text, so pass --model codex/<name> yourself.

Providers that are unavailable are left out, with one line on stderr naming them and why, so stdout stays safe to pipe.

ai-conventional-commit models

Pick one interactively and persist it as your default:

ai-conventional-commit models --interactive --save

The same list backs the retry picker shown when a model call times out.

Override the model for a single run:

ai-conventional-commit --model claude/sonnet

⚙️ Configuration

Configuration is resolved via cosmiconfig in the following precedence order (later wins):

  1. Built-in defaults
  2. Global config — ~/.config/aicc/aicc.json
  3. Project config — .aiccrc / .aiccrc.json at the repo root
  4. Environment variables (AICC_*)
  5. CLI flags (--model, --style, …)

model has no built-in default — it must come from the config file, AICC_MODEL, or --model. Nothing is chosen on your behalf.

Config file example

{
  "model": "github-copilot/claude-sonnet-4.6",
  "privacy": "low",
  "style": "gitmoji",
  "styleSamples": 120,
  "maxTokens": 512,
  "maxFileLines": 1000,
  "skipFilePatterns": ["**/package-lock.json", "**/dist/**", "**/*.d.ts"],
  "plugins": ["./src/plugins/my-plugin.ts"],
  "ticketFromBranch": false
}

Environment variables

VariableDefaultDescription
AICC_MODEL—Model string, e.g. claude/sonnet or anthropic/claude-sonnet-4-6
AICC_STYLEstandardCommit style: standard, gitmoji, or gitmoji-pure
AICC_PRIVACYlowDiff detail level sent to the model
AICC_YES—Set to true to skip all confirmation prompts. Scope: global — when set in the environment (e.g. via shell RC), it auto-confirms every invocation including unattended agent runs. For per-invocation control, use the -y/--yes CLI flag instead.
AICC_TICKET_FROM_BRANCH—Set to true to prepend the ticket key from the branch name (e.g. SHOP-1234/feature → SHOP-1234: …). Multiple ticket prefixes in the branch (e.g. SHOP-1234/ABC-5678/feature) are joined with /.
AICC_DEBUG—Enable verbose provider logs
AICC_MAX_TOKENS512Token limit for model responses
ANTHROPIC_API_KEY—Required when using anthropic/* models

🔌 OpenCode MCP behaviour

On startup, all MCP servers from your global OpenCode config are automatically disconnected for the duration of this tool's process. This keeps the model's tool count within provider limits (GitHub Copilot caps at 128), removes MCP initialisation latency, and lets the model focus entirely on commit generation. Your global OpenCode setup is unaffected.

Run with AICC_DEBUG=true to see which MCP servers were disconnected.

On this page