@ai-git/cli 2.8.3 → 2.8.4

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 +238 -0
  2. package/package.json +6 -6
package/README.md ADDED
@@ -0,0 +1,238 @@
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
30
+ brew install ai-git
31
+ ```
32
+
33
+ ### Shell Script (macOS/Linux)
34
+
35
+ ```bash
36
+ curl -fsSL https://ai-git.xyz/install | bash
37
+ ```
38
+
39
+ ### Build from Source
40
+
41
+ ```bash
42
+ git clone https://github.com/sadiksaifi/ai-git.git
43
+ cd ai-git
44
+ bun install
45
+ bun run build
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ Run `ai-git` in any git repository:
51
+
52
+ ```bash
53
+ ai-git
54
+ ```
55
+
56
+ On first run, you'll be guided through a quick setup wizard to choose your AI provider.
57
+
58
+ Settings are saved to `~/.config/ai-git/config.json`
59
+
60
+ > **Reconfigure:** `ai-git configure`
61
+ > **Self-update:** `ai-git upgrade`
62
+
63
+ ## Usage
64
+
65
+ ### CLI Reference
66
+
67
+ ```sh
68
+ $ ai-git --help
69
+ Usage:
70
+ $ ai-git [command] [options]
71
+
72
+ AI-powered Conventional Commits
73
+
74
+ Commands:
75
+ configure Set up AI provider and model
76
+ upgrade Update ai-git to the latest version
77
+
78
+ Model:
79
+ --provider <id> Use a specific AI provider for this run
80
+ --model <id> Use a specific model for this run
81
+
82
+ Workflow:
83
+ -A, --stage-all Stage all changes before generating
84
+ -C, --commit Commit without confirmation
85
+ -P, --push Push to remote after committing
86
+ -H, --hint <text> Guide the AI with additional context
87
+ -X, --exclude <pattern> Skip files when staging (glob, regex, or path)
88
+ --dangerously-auto-approve Stage, commit, and push without prompts
89
+ --dry-run Preview the prompt without calling the AI
90
+
91
+ Info:
92
+ -v, --version Show version
93
+ -h, --help Show help
94
+ ```
95
+
96
+ ### Examples
97
+
98
+ ```bash
99
+ # Use configured defaults
100
+ ai-git
101
+
102
+ # Override provider for this run
103
+ ai-git --provider gemini-cli --model gemini-3-flash-preview
104
+
105
+ # Use Codex with reasoning effort baked in
106
+ ai-git --provider codex --model gpt-5.3-codex-low
107
+
108
+ # Use OpenRouter
109
+ ai-git --provider openrouter --model anthropic/claude-sonnet-4-6
110
+
111
+ # Exclude files/directories from staging
112
+ ai-git -A --exclude "tests/" --exclude "*.test.ts"
113
+
114
+ # Automated (Be careful!)
115
+ ai-git --dangerously-auto-approve --hint "Refactored authentication module"
116
+
117
+ # Dry run works without installed provider CLI/API key
118
+ ai-git --dry-run -A
119
+ ```
120
+
121
+ ## Supported Providers
122
+
123
+ | Provider | ID | Type | Requirements |
124
+ | :--------------- | :----------------- | :--- | :-------------------------------------------------------------------------------------- |
125
+ | Claude Code | `claude-code` | CLI | [Install CLI](https://claude.com/claude-code) |
126
+ | Gemini CLI | `gemini-cli` | CLI | [Install CLI](https://ai.google.dev/gemini-api/docs/cli) |
127
+ | Codex | `codex` | CLI | [Install CLI](https://developers.openai.com/codex/cli) (`npm install -g @openai/codex`) |
128
+ | OpenRouter | `openrouter` | API | [Get API Key](https://openrouter.ai/keys) |
129
+ | OpenAI | `openai` | API | [Get API Key](https://platform.openai.com/api-keys) |
130
+ | Google AI Studio | `google-ai-studio` | API | [Get API Key](https://aistudio.google.com/app/apikey) |
131
+ | Anthropic | `anthropic` | API | [Get API Key](https://console.anthropic.com/settings/keys) |
132
+ | Cerebras | `cerebras` | API | [Get API Key](https://cloud.cerebras.ai/) |
133
+
134
+ Configure with `ai-git configure`
135
+
136
+ ## Configuration
137
+
138
+ AI Git uses a **three-tier configuration system**:
139
+
140
+ 1. **CLI flags** (highest priority)
141
+ 2. **Project config** (`.ai-git.json`)
142
+ 3. **Global config** (`~/.config/ai-git/config.json`)
143
+
144
+ ### Example Configs
145
+
146
+ ```json
147
+ {
148
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
149
+ "provider": "claude-code",
150
+ "model": "haiku",
151
+ "defaults": {
152
+ "stageAll": false,
153
+ "commit": false,
154
+ "push": false
155
+ }
156
+ }
157
+ ```
158
+
159
+ ```json
160
+ {
161
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
162
+ "provider": "openrouter",
163
+ "model": "anthropic/claude-sonnet-4-6"
164
+ }
165
+ ```
166
+
167
+ > **Tip:** Add the `$schema` property for autocomplete and validation in your editor.
168
+ >
169
+ > **Note:** API keys are stored securely in keychain, not in config files.
170
+
171
+ ## Advanced: Custom Prompts
172
+
173
+ The default prompt works excellently for most projects. Customize only for project-specific needs like ticket systems, monorepo scopes, or team style preferences.
174
+
175
+ ### Customization Options
176
+
177
+ | Field | Description | Example |
178
+ | :---------------- | :----------------------------------------- | :-------------------------------------------------- |
179
+ | `prompt.context` | Project-specific information | `"React Native app. Jira tickets: PROJ-123"` |
180
+ | `prompt.style` | Style/format preferences | `"Always include scope. Keep body under 5 points."` |
181
+ | `prompt.examples` | Custom commit examples (replaces defaults) | Array of commit message strings |
182
+
183
+ ### Example: Monorepo with Scopes
184
+
185
+ ```json
186
+ {
187
+ "$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
188
+ "provider": "claude-code",
189
+ "model": "sonnet",
190
+ "prompt": {
191
+ "context": "Monorepo with packages: web, mobile, shared, api, docs, infra.",
192
+ "style": "Always use a scope from the valid list. Reference PR numbers in footer."
193
+ }
194
+ }
195
+ ```
196
+
197
+ ### Example: Custom Commit Format
198
+
199
+ ```json
200
+ {
201
+ "prompt": {
202
+ "examples": [
203
+ "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",
204
+ "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"
205
+ ]
206
+ }
207
+ }
208
+ ```
209
+
210
+ > **Note:** Only provide `examples` if you have very specific formatting requirements.
211
+
212
+ ## Development
213
+
214
+ ```bash
215
+ # Install dependencies
216
+ bun install
217
+
218
+ # Run in development
219
+ bun run dev
220
+
221
+ # Test prompt generation without AI call
222
+ bun run dev --dry-run -A
223
+
224
+ # Disable update-check network calls (useful for tests/CI)
225
+ AI_GIT_DISABLE_UPDATE_CHECK=1 bun test
226
+
227
+ # Type check
228
+ bun run typecheck
229
+
230
+ # Build binary
231
+ bun run build
232
+ ```
233
+
234
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
235
+
236
+ ## License
237
+
238
+ [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.4",
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.4",
31
+ "@ai-git/darwin-x64": "2.8.4",
32
+ "@ai-git/linux-arm64": "2.8.4",
33
+ "@ai-git/linux-x64": "2.8.4",
34
+ "@ai-git/win32-x64": "2.8.4"
35
35
  }
36
36
  }