🤖 An intelligent Zsh plugin that automates your Git workflow using AI-powered commit messages and optional conflict resolution — now with multi‑provider OpenAI‑compatible REST, Node/curl fallback, and one‑file setup.
- Removed Python dependency entirely
- Added multi‑provider support (OpenAI‑compatible endpoints): Mistral, Groq, OpenAI, Together, Anyscale, or custom
- Preferred transport: Node 18+
fetch; fallback transport: purecurl(with optionaljqfor parsing) - Simple setup: edit the plugin file itself to add your provider, API key, and (optional) endpoint/model
- Non‑interactive mode for CI and headless environments
- Works from any subdirectory in your Git repo
- 🪄 AI‑Generated Commit Messages with architecture‑level detail
- 🗂️ Auto‑Staging: stages all changes
- 🔄 Full Workflow: stage → AI message → commit → pull (safe) → optional resolve → push
- ⚔️ Conflict Resolution (optional AI assist)
- 📍 Directory Agnostic: run from any subdirectory within a Git repo
- 🌐 Multi‑Provider via OpenAI‑compatible REST
- 🧰 Node 18+ or
curl‑only fallback (no extra packages) - ⌨️ Keyboard Shortcut:
Ctrl‑X, A - 🛡️ Unicode‑safe diff handling and robust fallbacks
- Zsh shell (Oh My Zsh recommended)
- Git
- curl
- Optional but recommended: Node 18+ (built‑in
fetch),jq(better JSON parsing in curl fallback)
# 1) Create the plugin directory
mkdir -p ~/.oh-my-zsh/custom/plugins/aic
# 2) Download the plugin file
curl -o ~/.oh-my-zsh/custom/plugins/aic/aic.plugin.zsh \
https://raw.githubusercontent.com/YOUR_ORG_OR_USER/aic-plugin/main/aic.plugin.zsh
# 3) Enable the plugin in ~/.zshrc
# Add 'aic' to your plugins list
# plugins=(git aic other-plugins...)
# 4) Reload shell
source ~/.zshrc
# 5) Configure provider and API key by editing the plugin file
nano ~/.oh-my-zsh/custom/plugins/aic/aic.plugin.zsh
# Find the section: "USER CONFIG (edit me)"
# Fill in AIC_PROVIDER_DEFAULT, AIC_API_KEY_DEFAULT, and optionally AIC_BASE_URL_DEFAULT / AIC_MODEL_DEFAULT
# 6) Use the plugin
cd /path/to/your/repo
# Make some changes, then run:
aic- Mistral (default)
- USER CONFIG:
- AIC_PROVIDER_DEFAULT="mistral"
- AIC_API_KEY_DEFAULT="mis_xxx"
- AIC_MODEL_DEFAULT="mistral-small-latest" (optional; default is set automatically)
- USER CONFIG:
- Groq
- USER CONFIG:
- AIC_PROVIDER_DEFAULT="groq"
- AIC_API_KEY_DEFAULT="sk_groq_xxx"
- AIC_MODEL_DEFAULT="llama-3.1-70b-versatile"
- USER CONFIG:
- OpenAI
- USER CONFIG:
- AIC_PROVIDER_DEFAULT="openai"
- AIC_API_KEY_DEFAULT="sk-openai-xxx"
- (set AIC_MODEL_DEFAULT to your chosen model)
- USER CONFIG:
- Custom endpoint
- USER CONFIG:
- AIC_PROVIDER_DEFAULT="custom"
- AIC_API_KEY_DEFAULT="sk_custom_xxx"
- AIC_BASE_URL_DEFAULT="https://your-endpoint.example.com/v1"
- AIC_MODEL_DEFAULT="your-model-name"
- USER CONFIG:
Environment variables still work and override USER CONFIG when set:
- AIC_PROVIDER, AIC_API_KEY, AIC_BASE_URL, AIC_MODEL
- Provider‑specific keys also supported: GROQ_API_KEY, OPENAI_API_KEY, MISTRAL_API_KEY
- Environment variables (AIC_PROVIDER, AIC_API_KEY, AIC_BASE_URL, AIC_MODEL)
- Plugin file USER CONFIG block
- Provider defaults (base URLs and common models)
- For Mistral only:
~/.config/mistral/api_keyas a last resort
- From any directory inside a Git repository, run:
aic- Keyboard shortcut:
Ctrl‑X, A
What it does:
- Validates basic environment (git, curl, optional node/jq)
- Detects repo root and stages all changes
- Builds a diff or a summarized prompt for large changes
- Calls your configured AI provider (Node fetch if available; otherwise curl)
- Shows the proposed commit message for confirmation
- Commits, pulls safely (rebase‑first), resolves conflicts if requested, and pushes
- Set
AIC_NON_INTERACTIVE=1(orAIC_ASSUME_YES=1) to auto‑accept prompts. - In non‑interactive mode:
- Pre‑flight warnings auto‑continue
- Commit confirmation auto‑accepts the AI message
- Push failures do not abort (they log and continue)
- "Not a Git repository"
- Run
aicfrom inside a Git repo. The plugin runs fine from any subdirectory.
- Run
- "API key is not configured"
- Fill in the USER CONFIG block in the plugin file, or set
AIC_API_KEY.
- Fill in the USER CONFIG block in the plugin file, or set
- Provider/Model errors
- Ensure
AIC_MODELis valid for your provider. Try a known working model first.
- Ensure
- No internet
- The plugin falls back to a simple commit message.
- Node vs curl
- Node 18+ is preferred. Without Node, the plugin uses curl‑only fallback.
jqhelps parse responses when available.
- Node 18+ is preferred. Without Node, the plugin uses curl‑only fallback.
- Push fails: "No configured push destination"
- Add a remote
originor ignore in non‑interactive mode.
- Add a remote
- Zsh keybindings not applied
- Bindings use
zle; they apply in interactive Zsh. The command still works without them.
- Bindings use
- Never commit real API keys into version control.
- If you paste a key into the plugin file, keep this file out of version control or store keys via environment variables.
- Consider per‑user config via env vars for shared repos.
- Uses prompt summarization for large changes (line‑based threshold)
- Works with binary/unicode‑heavy diffs via robust handling
- Typical AI call overhead: depends on provider/model
- Removed Python, adoption of multi‑provider OpenAI‑compatible REST
- Node 18+
fetch(preferred) with curl‑only fallback - USER CONFIG block for easy setup in the plugin file
- Non‑interactive mode retained and improved
- Python/mistralai SDK, single‑provider design
MIT License