@ai-git/cli 2.8.3 → 2.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +237 -0
  2. package/package.json +6 -6
package/README.md ADDED
@@ -0,0 +1,237 @@
1
+ # AI Git
2
+
3
+ A CLI tool that leverages AI to automatically generate semantically correct, conventional commits compliant git messages.
4
+
5
+ <img width="1351" height="883" alt="Screenshot 2026-01-02 at 03 23 41" src="https://github.com/user-attachments/assets/657cbb28-ac54-435f-9759-a31a762c45a3" />
6
+
7
+ ## Features
8
+
9
+ - 🤖 **AI-Powered** - Analyzes diffs and understands the _intent_ of your changes
10
+ - 📝 **Conventional Commits** - Strictly adheres to [v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) specification
11
+ - 🎨 **Interactive TUI** - Beautiful prompts for staging, editing, and confirming
12
+ - 🪙 **Token Efficient** - Uses [TOON](https://toonformat.dev/) to minimize prompt size and cost
13
+ - 🔌 **Multiple Providers** - Claude Code, Gemini CLI, Codex, OpenRouter, OpenAI, Anthropic, Google AI Studio, Cerebras
14
+ - 🔐 **Secure** - API keys stored in keychain, never in config files
15
+
16
+ ## Installation
17
+
18
+ ### npm (Recommended)
19
+
20
+ ```bash
21
+ npm install -g @ai-git/cli
22
+ ```
23
+
24
+ > Also works with `bun`, `pnpm`, and `yarn`.
25
+
26
+ ### Homebrew (macOS)
27
+
28
+ ```bash
29
+ brew tap sadiksaifi/tap/ai-git
30
+ ```
31
+
32
+ ### Shell Script (macOS/Linux)
33
+
34
+ ```bash
35
+ curl -fsSL https://ai-git.xyz/install | bash
36
+ ```
37
+
38
+ ### Build from Source
39
+
40
+ ```bash
41
+ git clone https://github.com/sadiksaifi/ai-git.git
42
+ cd ai-git
43
+ bun install
44
+ bun run build
45
+ ```
46
+
47
+ ## Quick Start
48
+
49
+ Run `ai-git` in any git repository:
50
+
51
+ ```bash
52
+ ai-git
53
+ ```
54
+
55
+ On first run, you'll be guided through a quick setup wizard to choose your AI provider.
56
+
57
+ Settings are saved to `~/.config/ai-git/config.json`
58
+
59
+ > **Reconfigure:** `ai-git configure`
60
+ > **Self-update:** `ai-git upgrade`
61
+
62
+ ## Usage
63
+
64
+ ### CLI Reference
65
+
66
+ ```sh
67
+ $ ai-git --help
68
+ Usage:
69
+ $ ai-git [command] [options]
70
+
71
+ AI-powered Conventional Commits
72
+
73
+ Commands:
74
+ configure Set up AI provider and model
75
+ upgrade Update ai-git to the latest version
76
+
77
+ Model:
78
+ --provider <id> Use a specific AI provider for this run
79
+ --model <id> Use a specific model for this run
80
+
81
+ Workflow:
82
+ -A, --stage-all Stage all changes before generating
83
+ -C, --commit Commit without confirmation
84
+ -P, --push Push to remote after committing
85
+ -H, --hint <text> Guide the AI with additional context
86
+ -X, --exclude <pattern> Skip files when staging (glob, regex, or path)
87
+ --dangerously-auto-approve Stage, commit, and push without prompts
88
+ --dry-run Preview the prompt without calling the AI
89
+
90
+ Info:
91
+ -v, --version Show version
92
+ -h, --help Show help
93
+ ```
94
+
95
+ ### Examples
96
+
97
+ ```bash
98
+ # Use configured defaults
99
+ ai-git
100
+
101
+ # Override provider for this run
102
+ ai-git --provider gemini-cli --model gemini-3-flash-preview
103
+
104
+ # Use Codex with reasoning effort baked in
105
+ ai-git --provider codex --model gpt-5.3-codex-low
106
+
107
+ # Use OpenRouter
108
+ ai-git --provider openrouter --model anthropic/claude-sonnet-4-6
109
+
110
+ # Exclude files/directories from staging
111
+ ai-git -A --exclude "tests/" --exclude "*.test.ts"
112
+
113
+ # Automated (Be careful!)
114
+ ai-git --dangerously-auto-approve --hint "Refactored authentication module"
115
+
116
+ # Dry run works without installed provider CLI/API key
117
+ ai-git --dry-run -A
118
+ ```
119
+
120
+ ## Supported Providers
121
+
122
+ | Provider | ID | Type | Requirements |
123
+ | :--------------- | :----------------- | :--- | :-------------------------------------------------------------------------------------- |
124
+ | Claude Code | `claude-code` | CLI | [Install CLI](https://claude.com/claude-code) |
125
+ | Gemini CLI | `gemini-cli` | CLI | [Install CLI](https://ai.google.dev/gemini-api/docs/cli) |
126
+ | Codex | `codex` | CLI | [Install CLI](https://developers.openai.com/codex/cli) (`npm install -g @openai/codex`) |
127
+ | OpenRouter | `openrouter` | API | [Get API Key](https://openrouter.ai/keys) |
128
+ | OpenAI | `openai` | API | [Get API Key](https://platform.openai.com/api-keys) |
129
+ | Google AI Studio | `google-ai-studio` | API | [Get API Key](https://aistudio.google.com/app/apikey) |
130
+ | Anthropic | `anthropic` | API | [Get API Key](https://console.anthropic.com/settings/keys) |
131
+ | Cerebras | `cerebras` | API | [Get API Key](https://cloud.cerebras.ai/) |
132
+
133
+ Configure with `ai-git configure`
134
+
135
+ ## Configuration
136
+
137
+ AI Git uses a **three-tier configuration system**:
138
+
139
+ 1. **CLI flags** (highest priority)
140
+ 2. **Project config** (`.ai-git.json`)
141
+ 3. **Global config** (`~/.config/ai-git/config.json`)
142
+
143
+ ### Example Configs
144
+
145
+ ```json
146
+ {
147
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
148
+ "provider": "claude-code",
149
+ "model": "haiku",
150
+ "defaults": {
151
+ "stageAll": false,
152
+ "commit": false,
153
+ "push": false
154
+ }
155
+ }
156
+ ```
157
+
158
+ ```json
159
+ {
160
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
161
+ "provider": "openrouter",
162
+ "model": "anthropic/claude-sonnet-4-6"
163
+ }
164
+ ```
165
+
166
+ > **Tip:** Add the `$schema` property for autocomplete and validation in your editor.
167
+ >
168
+ > **Note:** API keys are stored securely in keychain, not in config files.
169
+
170
+ ## Advanced: Custom Prompts
171
+
172
+ The default prompt works excellently for most projects. Customize only for project-specific needs like ticket systems, monorepo scopes, or team style preferences.
173
+
174
+ ### Customization Options
175
+
176
+ | Field | Description | Example |
177
+ | :---------------- | :----------------------------------------- | :-------------------------------------------------- |
178
+ | `prompt.context` | Project-specific information | `"React Native app. Jira tickets: PROJ-123"` |
179
+ | `prompt.style` | Style/format preferences | `"Always include scope. Keep body under 5 points."` |
180
+ | `prompt.examples` | Custom commit examples (replaces defaults) | Array of commit message strings |
181
+
182
+ ### Example: Monorepo with Scopes
183
+
184
+ ```json
185
+ {
186
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
187
+ "provider": "claude-code",
188
+ "model": "sonnet",
189
+ "prompt": {
190
+ "context": "Monorepo with packages: web, mobile, shared, api, docs, infra.",
191
+ "style": "Always use a scope from the valid list. Reference PR numbers in footer."
192
+ }
193
+ }
194
+ ```
195
+
196
+ ### Example: Custom Commit Format
197
+
198
+ ```json
199
+ {
200
+ "prompt": {
201
+ "examples": [
202
+ "feat(auth): add SSO integration\n\n- implement SAML 2.0 authentication\n- add identity provider configuration\n- support multiple IdP connections\n\nRefs: PROJ-456",
203
+ "fix(api): resolve rate limiting bypass\n\n- add per-user rate limit tracking\n- implement sliding window algorithm\n- add rate limit headers to responses"
204
+ ]
205
+ }
206
+ }
207
+ ```
208
+
209
+ > **Note:** Only provide `examples` if you have very specific formatting requirements.
210
+
211
+ ## Development
212
+
213
+ ```bash
214
+ # Install dependencies
215
+ bun install
216
+
217
+ # Run in development
218
+ bun run dev
219
+
220
+ # Test prompt generation without AI call
221
+ bun run dev --dry-run -A
222
+
223
+ # Disable update-check network calls (useful for tests/CI)
224
+ AI_GIT_DISABLE_UPDATE_CHECK=1 bun test
225
+
226
+ # Type check
227
+ bun run typecheck
228
+
229
+ # Build binary
230
+ bun run build
231
+ ```
232
+
233
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
234
+
235
+ ## License
236
+
237
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-git/cli",
3
- "version": "2.8.3",
3
+ "version": "2.8.5",
4
4
  "description": "AI-powered git commit message generator",
5
5
  "keywords": [
6
6
  "ai",
@@ -27,10 +27,10 @@
27
27
  "postinstall": "node scripts/postinstall.js"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@ai-git/darwin-arm64": "2.8.3",
31
- "@ai-git/darwin-x64": "2.8.3",
32
- "@ai-git/linux-arm64": "2.8.3",
33
- "@ai-git/linux-x64": "2.8.3",
34
- "@ai-git/win32-x64": "2.8.3"
30
+ "@ai-git/darwin-arm64": "2.8.5",
31
+ "@ai-git/darwin-x64": "2.8.5",
32
+ "@ai-git/linux-arm64": "2.8.5",
33
+ "@ai-git/linux-x64": "2.8.5",
34
+ "@ai-git/win32-x64": "2.8.5"
35
35
  }
36
36
  }