
Use Git Agent
Turn staged diffs into atomic, intent-aware commits with AI-generated messages via the git-agent CLI.
Install
npx skills add https://github.com/gitagenthq/git-agent-cli --skill use-git-agentWhat is this skill?
- AI-planned atomic commits from working-tree changes with optional intent flag
- Provider resolution: CLI flags → git config → ~/.config/git-agent/config.yml → build defaults
- Dry-run, amend, and no-stage modes for safe iteration
- --free mode uses embedded credentials; mutually exclusive with custom API flags
Adoption & trust: 1 installs on skills.sh; 68 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Triagemattpocock/skills
Caveman Commitjuliusbrussee/caveman
Using Git Worktreesobra/superpowers
Finishing A Development Branchobra/superpowers
Git Commitgithub/awesome-copilot
Git Guardrails Claude Codemattpocock/skills
Journey fit
Common Questions / FAQ
Is Use Git Agent safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Use Git Agent
# git-agent CLI Reference ## Root ``` git-agent [command] [flags] ``` AI-first Git CLI for automated commit message generation. ### Global Flags | Flag | Type | Description | |------|------|-------------| | `--api-key` | string | API key for the AI provider | | `--base-url` | string | Base URL for the AI provider | | `--model` | string | Model to use for generation | | `--free` | bool | Use only build-time embedded credentials; ignore config file and git config | | `--verbose`, `-v` | bool | Verbose output | `--free` is mutually exclusive with `--api-key`, `--model`, and `--base-url` (enforced at parse time by Cobra). ### Provider config resolution (highest to lowest priority) 1. Global CLI flags (`--api-key`, `--model`, `--base-url`) 2. `git config --local git-agent.{model,base-url}` 3. `~/.config/git-agent/config.yml` (supports `$ENV_VAR` expansion) 4. Build-time defaults --- ## git-agent commit ``` git-agent commit [flags] ``` Generate and create commit(s) with AI-generated messages. Auto-stages all changes, auto-generates scopes if none are configured, and splits changes into atomic commits via LLM planning. ### Flags | Flag | Type | Default | Description | |------|------|---------|-------------| | `--intent` | string | | Describe the intent of the change | | `--dry-run` | bool | false | Print commit message without committing | | `--no-stage` | bool | false | Skip auto-staging; only commit already-staged changes | | `--amend` | bool | false | Regenerate and amend the most recent commit | | `--co-author` | stringArray | | Add a co-author trailer (repeatable); skipped if `no_model_co_author` is set in config | | `--trailer` | stringArray | | Add an arbitrary git trailer, format `"Key: Value"` (repeatable) | | `--no-attribution` | bool | false | Omit the default `Co-Authored-By: Git Agent <noreply@git-agent.dev>` trailer (`--no-git-agent` is a deprecated alias) | | `--max-diff-lines` | int | 0 | Maximum diff lines to send to the model (0 = no limit) | `--amend` and `--no-stage` are mutually exclusive (enforced at parse time by Cobra). ### Exit codes | Code | Meaning | |------|---------| | `0` | Success | | `1` | General error (no API key, git error, etc.) | | `2` | Commit blocked by hook after retries | ### Multi-commit splitting The AI planner can split staged changes into multiple atomic commits (max 5 commit groups per run). For each group, git-agent unstages all files, re-stages only the group's files, generates a message, and commits. ### Hook retry logic - 3 retries per commit group - 2 re-plans maximum if retries are exhausted - After all retries and re-plans fail: exits with code `2` ### Auto-scope If no scopes are configured (project config is nil or has empty scopes), git-agent automatically generates scopes from git history before planning. Each scope is a structured object (`{"name": "...", "description": "..."}`) — the description provides LLM context during commit message generation. If any planned commit group lacks a scope, scopes are refreshed once and the plan is regenerated. --- ## git-agent init ``` git-agent init [flags] ``` Initialize git-agent in the current repository. With no flags, runs the full setup wizard: 1. Ensures a git repo exists (runs `git init` if needed) 2. Generates `.gitignore` via AI 3. Generates commit scopes from git history via AI 4. Writes `.git-agent/config.yml` with scopes and `hook: [conventional]` ### Flags | Flag | Type | Default | Description | |------|------|---------|-------------| | `--scope` | bool | false | Generate scopes via AI | | `--gitignore` | bool | false | Generate `.gitignore` via AI | | `--hook` | stringArray | | Hook to configure: `conventional`, `empty`, or a file path (repeatable) | | `--force` | bool | false | Overwrite existing config/`.gitignore` | | `--max-commits` | int | 200 | Max commits to analyze for scope generation | | `--local` | bool | false | Write config to `.git-agent/config.local.yml` (requires an action flag) |