execdiff-git-ai 1.0.0__tar.gz → 1.0.1__tar.gz
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.
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/PKG-INFO +123 -84
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/README.md +116 -77
- execdiff_git_ai-1.0.1/execdiff_git_ai/agent.py +315 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai/cli.py +8 -8
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai.egg-info/PKG-INFO +123 -84
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai.egg-info/SOURCES.txt +1 -0
- execdiff_git_ai-1.0.1/execdiff_git_ai.egg-info/requires.txt +1 -0
- execdiff_git_ai-1.0.1/pyproject.toml +43 -0
- execdiff_git_ai-1.0.0/execdiff_git_ai/agent.py +0 -328
- execdiff_git_ai-1.0.0/pyproject.toml +0 -41
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/LICENSE +0 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai/__init__.py +0 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai.egg-info/dependency_links.txt +0 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai.egg-info/entry_points.txt +0 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/execdiff_git_ai.egg-info/top_level.txt +0 -0
- {execdiff_git_ai-1.0.0 → execdiff_git_ai-1.0.1}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: execdiff-git-ai
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: AI Impact Assessment for git changes - understand what your AI copilot changed before you commit.
|
|
5
5
|
Author-email: Anup Moncy <n93181165@gmail.com>
|
|
6
6
|
License: Apache License
|
|
7
7
|
Version 2.0, January 2004
|
|
@@ -21,10 +21,10 @@ License: Apache License
|
|
|
21
21
|
See the License for the specific language governing permissions and
|
|
22
22
|
limitations under the License.
|
|
23
23
|
|
|
24
|
-
Project-URL: Homepage, https://github.com/
|
|
25
|
-
Project-URL: Bug Tracker, https://github.com/
|
|
26
|
-
Project-URL: Documentation, https://github.com/
|
|
27
|
-
Keywords: git,ai,copilot,code-analysis,diff,impact-assessment
|
|
24
|
+
Project-URL: Homepage, https://github.com/anupmoncy/execdiff-git-ai
|
|
25
|
+
Project-URL: Bug Tracker, https://github.com/anupmoncy/execdiff-git-ai/issues
|
|
26
|
+
Project-URL: Documentation, https://github.com/anupmoncy/execdiff-git-ai#readme
|
|
27
|
+
Keywords: git,ai,copilot,code-analysis,diff,impact-assessment
|
|
28
28
|
Classifier: Development Status :: 4 - Beta
|
|
29
29
|
Classifier: Intended Audience :: Developers
|
|
30
30
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -35,10 +35,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
35
35
|
Classifier: Programming Language :: Python :: 3.11
|
|
36
36
|
Classifier: Programming Language :: Python :: 3.12
|
|
37
37
|
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
38
|
-
Classifier: Topic :: Software Development :: Quality Assurance
|
|
39
38
|
Requires-Python: >=3.8
|
|
40
39
|
Description-Content-Type: text/markdown
|
|
41
40
|
License-File: LICENSE
|
|
41
|
+
Requires-Dist: requests>=2.25.0
|
|
42
42
|
Dynamic: license-file
|
|
43
43
|
|
|
44
44
|
# ExecDiff Git AI
|
|
@@ -47,7 +47,7 @@ AI Impact Assessment for git changes - understand what your AI copilot changed b
|
|
|
47
47
|
|
|
48
48
|
## Overview
|
|
49
49
|
|
|
50
|
-
ExecDiff Git AI is a Python CLI tool that helps developers understand the scope and implications of code changes made by AI coding assistants (like GitHub Copilot, Cursor, or Replit AI) by analyzing git diffs and extracting modified symbols (functions, classes, variables). It can optionally use a local LLM (Ollama) to assess the
|
|
50
|
+
ExecDiff Git AI is a Python CLI tool that helps developers understand the scope and implications of code changes made by AI coding assistants (like GitHub Copilot, Cursor, or Replit AI) by analyzing git diffs and extracting modified symbols (functions, classes, variables). It can optionally use a local LLM (Ollama) to assess the business impact of each change.
|
|
51
51
|
|
|
52
52
|
## Privacy
|
|
53
53
|
|
|
@@ -56,24 +56,23 @@ ExecDiff Git AI runs **entirely locally**.
|
|
|
56
56
|
- ✅ No code is uploaded
|
|
57
57
|
- ✅ No cloud calls required
|
|
58
58
|
- ✅ No telemetry
|
|
59
|
-
- ✅ Works offline with local LLM (Ollama)
|
|
59
|
+
- ✅ Works offline with optional local LLM (Ollama)
|
|
60
60
|
- ✅ All analysis happens on your machine
|
|
61
61
|
|
|
62
62
|
## Features
|
|
63
63
|
|
|
64
64
|
- **Local-first**: Runs entirely on your machine with no cloud calls or telemetry
|
|
65
65
|
- **Impact Assessment**: Detects specific changes to functions, classes, and variables and provides human-readable summaries
|
|
66
|
-
- **
|
|
66
|
+
- **Two modes**: Fast analysis (non-AI) or deep AI-powered analysis (optional)
|
|
67
67
|
- **CLI-first**: `execdiff-git scan` and `execdiff-git scan-ai`
|
|
68
68
|
- **Works offline**, no telemetry
|
|
69
69
|
|
|
70
70
|
## Installation
|
|
71
71
|
|
|
72
|
-
### Prerequisites
|
|
72
|
+
### Prerequisites (Required)
|
|
73
73
|
|
|
74
74
|
- Python 3.8+
|
|
75
75
|
- Git
|
|
76
|
-
- Ollama (optional, for AI risk assessment)
|
|
77
76
|
|
|
78
77
|
### Initial Setup
|
|
79
78
|
|
|
@@ -83,8 +82,12 @@ Install from PyPI:
|
|
|
83
82
|
pip install execdiff-git-ai
|
|
84
83
|
```
|
|
85
84
|
|
|
85
|
+
That's it! You can now use the non-AI mode immediately.
|
|
86
|
+
|
|
86
87
|
## How to Use
|
|
87
88
|
|
|
89
|
+
### Quick Start (No AI Required)
|
|
90
|
+
|
|
88
91
|
1. **Make your code change** (or let your AI copilot make changes)
|
|
89
92
|
|
|
90
93
|
2. **Stage your changes with git**
|
|
@@ -95,32 +98,89 @@ pip install execdiff-git-ai
|
|
|
95
98
|
git add -N .
|
|
96
99
|
```
|
|
97
100
|
|
|
98
|
-
3. **Run the assessment
|
|
101
|
+
3. **Run the assessment**
|
|
99
102
|
|
|
100
103
|
```bash
|
|
101
104
|
execdiff-git scan
|
|
102
105
|
```
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
**Note**: For newly created files, you must run `git add -N .` (intent-to-add) so that `execdiff-git scan` can detect them. This is a git limitation for diff tools.
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## AI-Powered Assessment (Optional)
|
|
112
|
+
|
|
113
|
+
**AI mode is completely optional.** The non-AI mode works great for most use cases.
|
|
114
|
+
|
|
115
|
+
### Requirements for AI Mode
|
|
116
|
+
|
|
117
|
+
| Component | Size | Description |
|
|
118
|
+
|-----------|------|-------------|
|
|
119
|
+
| **Ollama** | ~50MB | Local AI runtime (one-time install) |
|
|
120
|
+
| **tinyllama model** | ~637MB | Smallest AI model (one-time download) |
|
|
121
|
+
|
|
122
|
+
**Total: ~700MB one-time download**
|
|
123
|
+
|
|
124
|
+
- ✅ 100% local - no data sent to cloud
|
|
125
|
+
- ✅ Works offline after initial setup
|
|
126
|
+
- ✅ User permission required before any downloads
|
|
127
|
+
|
|
128
|
+
### How AI Mode Works
|
|
129
|
+
|
|
130
|
+
When you run `execdiff-git scan-ai`:
|
|
131
|
+
|
|
132
|
+
1. **Ollama check** - Checks if Ollama is installed
|
|
133
|
+
2. **Model check** - Checks if AI model is available
|
|
134
|
+
3. **User permission** - Asks before downloading anything
|
|
135
|
+
4. **Auto-start** - Starts Ollama server automatically
|
|
136
|
+
5. **Analysis** - Runs local AI analysis on your changes
|
|
137
|
+
6. **Auto-stop** - Stops Ollama server when done
|
|
138
|
+
|
|
139
|
+
### Install Ollama (One-Time)
|
|
140
|
+
|
|
141
|
+
**macOS:**
|
|
142
|
+
```bash
|
|
143
|
+
brew install ollama
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**macOS/Linux:**
|
|
147
|
+
```bash
|
|
148
|
+
curl -fsSL https://ollama.ai/install.sh | sh
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Or download from:** https://ollama.ai/
|
|
152
|
+
|
|
153
|
+
### Use AI Mode
|
|
154
|
+
|
|
155
|
+
Simply run:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
execdiff-git scan-ai
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If the AI model is not installed, you'll be asked:
|
|
109
162
|
|
|
110
|
-
|
|
163
|
+
```
|
|
164
|
+
⚠️ Model 'tinyllama' (~637MB) is not installed locally.
|
|
165
|
+
✅ Everything stays local - no data is sent to the cloud.
|
|
166
|
+
|
|
167
|
+
Download 'tinyllama' now? (yes/no):
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Say "yes" to download, or "no" to skip AI analysis.**
|
|
171
|
+
|
|
172
|
+
---
|
|
111
173
|
|
|
112
174
|
## Usage
|
|
113
175
|
|
|
114
176
|
### Basic Commands
|
|
115
177
|
|
|
116
|
-
|
|
117
|
-
|
|
178
|
+
**Non-AI mode (fast, always available, no setup):**
|
|
118
179
|
```bash
|
|
119
180
|
execdiff-git scan
|
|
120
181
|
```
|
|
121
182
|
|
|
122
|
-
|
|
123
|
-
|
|
183
|
+
**AI mode (optional, requires Ollama ~700MB total):**
|
|
124
184
|
```bash
|
|
125
185
|
execdiff-git scan-ai
|
|
126
186
|
```
|
|
@@ -135,44 +195,21 @@ execdiff-git scan-ai
|
|
|
135
195
|
==============================
|
|
136
196
|
File +Lines -Lines
|
|
137
197
|
------------------------------------------------
|
|
138
|
-
|
|
139
|
-
checkout.py 7 1
|
|
140
|
-
email/notifications.py 5 0
|
|
141
|
-
|
|
142
|
-
--------------------------------
|
|
198
|
+
test_feature.py 14 0
|
|
143
199
|
|
|
144
200
|
================================================================================
|
|
145
201
|
📋 Impact Summary
|
|
146
202
|
================================================================================
|
|
147
203
|
Symbol Change Type Impact
|
|
148
204
|
--------------------------------------------------------
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
send_order_email function added LOW
|
|
205
|
+
authenticate_user function added LOW
|
|
206
|
+
create_session function added LOW
|
|
207
|
+
validate_token function added LOW
|
|
153
208
|
|
|
154
209
|
✅ Assessment complete!
|
|
155
210
|
```
|
|
156
211
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
Ollama enables intelligent risk scoring. Install and configure:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# macOS / Linux
|
|
163
|
-
curl -fsSL https://ollama.ai/install.sh | sh
|
|
164
|
-
|
|
165
|
-
# Or use Homebrew (macOS)
|
|
166
|
-
brew install ollama
|
|
167
|
-
|
|
168
|
-
# Pull the model
|
|
169
|
-
ollama pull llama2
|
|
170
|
-
|
|
171
|
-
# Start the server (runs on localhost:11434)
|
|
172
|
-
ollama serve
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
With Ollama running, you'll also get AI-powered impact assessment:
|
|
212
|
+
**AI Mode (with Ollama):**
|
|
176
213
|
|
|
177
214
|
```
|
|
178
215
|
==============================
|
|
@@ -180,72 +217,74 @@ With Ollama running, you'll also get AI-powered impact assessment:
|
|
|
180
217
|
==============================
|
|
181
218
|
File +Lines -Lines
|
|
182
219
|
------------------------------------------------
|
|
183
|
-
|
|
184
|
-
checkout.py 7 1
|
|
185
|
-
email/notifications.py 5 0
|
|
186
|
-
|
|
187
|
-
--------------------------------
|
|
220
|
+
test_feature.py 14 0
|
|
188
221
|
|
|
189
222
|
================================================================================
|
|
190
223
|
📋 Impact Summary
|
|
191
224
|
================================================================================
|
|
192
225
|
Symbol Change Type Impact
|
|
193
226
|
--------------------------------------------------------
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
send_order_email function added LOW
|
|
227
|
+
authenticate_user function added LOW
|
|
228
|
+
create_session function added LOW
|
|
229
|
+
validate_token function added LOW
|
|
198
230
|
|
|
199
231
|
================================================================================
|
|
200
232
|
🤖 AI Impact Assessment
|
|
201
233
|
================================================================================
|
|
202
234
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
235
|
+
🚀 Starting Ollama server...
|
|
236
|
+
⏳ Waiting for Ollama server to start...
|
|
237
|
+
✅ Ollama server is ready!
|
|
238
|
+
🧠 Analyzing with AI (tinyllama, 100% local)...
|
|
207
239
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
Detailed Analysis:
|
|
211
|
-
|
|
212
|
-
File: shopping_cart.py - Symbol: add_to_cart
|
|
240
|
+
Symbol: authenticate_user
|
|
213
241
|
Impact: MEDIUM
|
|
214
|
-
Summary:
|
|
242
|
+
Summary: Added user authentication logic. This affects user access and security.
|
|
215
243
|
|
|
216
|
-
|
|
244
|
+
Symbol: create_session
|
|
217
245
|
Impact: LOW
|
|
218
|
-
Summary:
|
|
246
|
+
Summary: Added session creation. Improves user experience and session management.
|
|
219
247
|
|
|
220
|
-
|
|
221
|
-
Impact: HIGH
|
|
222
|
-
Summary: Checkout flow changed to support Apple Pay, Google Pay, PayPal, and credit cards, and to update order completion steps.
|
|
223
|
-
|
|
224
|
-
File: email/notifications.py - Symbol: send_order_email
|
|
248
|
+
Symbol: validate_token
|
|
225
249
|
Impact: LOW
|
|
226
|
-
Summary:
|
|
250
|
+
Summary: Added token validation. Enhances security by validating session tokens.
|
|
227
251
|
|
|
228
|
-
|
|
229
|
-
Please review carefully before deploying to production.
|
|
252
|
+
🛑 Ollama server stopped
|
|
230
253
|
|
|
231
254
|
✅ Assessment complete!
|
|
232
255
|
```
|
|
233
256
|
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Comparison: Non-AI vs AI Mode
|
|
260
|
+
|
|
261
|
+
| Feature | Non-AI Mode | AI Mode |
|
|
262
|
+
|---------|-------------|---------|
|
|
263
|
+
| **Setup** | None | Ollama + model (~700MB) |
|
|
264
|
+
| **Speed** | Instant | 5-30 seconds |
|
|
265
|
+
| **Analysis** | Symbol detection | Business-facing summaries |
|
|
266
|
+
| **Privacy** | 100% local | 100% local |
|
|
267
|
+
| **Offline** | Yes | Yes (after setup) |
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
234
271
|
## How It Works
|
|
235
272
|
|
|
236
|
-
1. **Reads git diff** - Gets all staged
|
|
273
|
+
1. **Reads git diff** - Gets all staged changes (`git diff --cached`)
|
|
237
274
|
2. **Extracts symbols** - Finds functions, classes, and variables
|
|
238
275
|
3. **Detects change type** - Identifies what kind of change was made
|
|
239
|
-
4. **Assesses impact** - Uses local AI (Ollama) or heuristics
|
|
240
|
-
5. **Generates
|
|
276
|
+
4. **Assesses impact** - Uses local AI (Ollama) if available, or quick heuristics
|
|
277
|
+
5. **Generates business summary** - Specific, non-technical impact summary (AI mode only)
|
|
241
278
|
6. **Advisory warnings** - Critical impact changes trigger warnings (AI mode only)
|
|
242
279
|
|
|
280
|
+
---
|
|
281
|
+
|
|
243
282
|
## Development
|
|
244
283
|
|
|
245
284
|
Install in editable mode:
|
|
246
285
|
|
|
247
286
|
```bash
|
|
248
|
-
git clone https://github.com/
|
|
287
|
+
git clone https://github.com/anupmoncy/execdiff-git-ai.git
|
|
249
288
|
cd execdiff-git-ai
|
|
250
289
|
pip install -e .
|
|
251
290
|
```
|
|
@@ -266,7 +305,7 @@ from execdiff_git_ai.agent import run_agent, run_agent_with_ai
|
|
|
266
305
|
# Non-AI mode (default)
|
|
267
306
|
run_agent()
|
|
268
307
|
|
|
269
|
-
# AI-powered mode (optional,
|
|
308
|
+
# AI-powered mode (optional, automatically manages Ollama)
|
|
270
309
|
run_agent_with_ai()
|
|
271
310
|
```
|
|
272
311
|
|
|
@@ -4,7 +4,7 @@ AI Impact Assessment for git changes - understand what your AI copilot changed b
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
ExecDiff Git AI is a Python CLI tool that helps developers understand the scope and implications of code changes made by AI coding assistants (like GitHub Copilot, Cursor, or Replit AI) by analyzing git diffs and extracting modified symbols (functions, classes, variables). It can optionally use a local LLM (Ollama) to assess the
|
|
7
|
+
ExecDiff Git AI is a Python CLI tool that helps developers understand the scope and implications of code changes made by AI coding assistants (like GitHub Copilot, Cursor, or Replit AI) by analyzing git diffs and extracting modified symbols (functions, classes, variables). It can optionally use a local LLM (Ollama) to assess the business impact of each change.
|
|
8
8
|
|
|
9
9
|
## Privacy
|
|
10
10
|
|
|
@@ -13,24 +13,23 @@ ExecDiff Git AI runs **entirely locally**.
|
|
|
13
13
|
- ✅ No code is uploaded
|
|
14
14
|
- ✅ No cloud calls required
|
|
15
15
|
- ✅ No telemetry
|
|
16
|
-
- ✅ Works offline with local LLM (Ollama)
|
|
16
|
+
- ✅ Works offline with optional local LLM (Ollama)
|
|
17
17
|
- ✅ All analysis happens on your machine
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
21
|
- **Local-first**: Runs entirely on your machine with no cloud calls or telemetry
|
|
22
22
|
- **Impact Assessment**: Detects specific changes to functions, classes, and variables and provides human-readable summaries
|
|
23
|
-
- **
|
|
23
|
+
- **Two modes**: Fast analysis (non-AI) or deep AI-powered analysis (optional)
|
|
24
24
|
- **CLI-first**: `execdiff-git scan` and `execdiff-git scan-ai`
|
|
25
25
|
- **Works offline**, no telemetry
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
|
-
### Prerequisites
|
|
29
|
+
### Prerequisites (Required)
|
|
30
30
|
|
|
31
31
|
- Python 3.8+
|
|
32
32
|
- Git
|
|
33
|
-
- Ollama (optional, for AI risk assessment)
|
|
34
33
|
|
|
35
34
|
### Initial Setup
|
|
36
35
|
|
|
@@ -40,8 +39,12 @@ Install from PyPI:
|
|
|
40
39
|
pip install execdiff-git-ai
|
|
41
40
|
```
|
|
42
41
|
|
|
42
|
+
That's it! You can now use the non-AI mode immediately.
|
|
43
|
+
|
|
43
44
|
## How to Use
|
|
44
45
|
|
|
46
|
+
### Quick Start (No AI Required)
|
|
47
|
+
|
|
45
48
|
1. **Make your code change** (or let your AI copilot make changes)
|
|
46
49
|
|
|
47
50
|
2. **Stage your changes with git**
|
|
@@ -52,32 +55,89 @@ pip install execdiff-git-ai
|
|
|
52
55
|
git add -N .
|
|
53
56
|
```
|
|
54
57
|
|
|
55
|
-
3. **Run the assessment
|
|
58
|
+
3. **Run the assessment**
|
|
56
59
|
|
|
57
60
|
```bash
|
|
58
61
|
execdiff-git scan
|
|
59
62
|
```
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
**Note**: For newly created files, you must run `git add -N .` (intent-to-add) so that `execdiff-git scan` can detect them. This is a git limitation for diff tools.
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## AI-Powered Assessment (Optional)
|
|
69
|
+
|
|
70
|
+
**AI mode is completely optional.** The non-AI mode works great for most use cases.
|
|
71
|
+
|
|
72
|
+
### Requirements for AI Mode
|
|
73
|
+
|
|
74
|
+
| Component | Size | Description |
|
|
75
|
+
|-----------|------|-------------|
|
|
76
|
+
| **Ollama** | ~50MB | Local AI runtime (one-time install) |
|
|
77
|
+
| **tinyllama model** | ~637MB | Smallest AI model (one-time download) |
|
|
78
|
+
|
|
79
|
+
**Total: ~700MB one-time download**
|
|
80
|
+
|
|
81
|
+
- ✅ 100% local - no data sent to cloud
|
|
82
|
+
- ✅ Works offline after initial setup
|
|
83
|
+
- ✅ User permission required before any downloads
|
|
84
|
+
|
|
85
|
+
### How AI Mode Works
|
|
86
|
+
|
|
87
|
+
When you run `execdiff-git scan-ai`:
|
|
88
|
+
|
|
89
|
+
1. **Ollama check** - Checks if Ollama is installed
|
|
90
|
+
2. **Model check** - Checks if AI model is available
|
|
91
|
+
3. **User permission** - Asks before downloading anything
|
|
92
|
+
4. **Auto-start** - Starts Ollama server automatically
|
|
93
|
+
5. **Analysis** - Runs local AI analysis on your changes
|
|
94
|
+
6. **Auto-stop** - Stops Ollama server when done
|
|
95
|
+
|
|
96
|
+
### Install Ollama (One-Time)
|
|
97
|
+
|
|
98
|
+
**macOS:**
|
|
99
|
+
```bash
|
|
100
|
+
brew install ollama
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**macOS/Linux:**
|
|
104
|
+
```bash
|
|
105
|
+
curl -fsSL https://ollama.ai/install.sh | sh
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Or download from:** https://ollama.ai/
|
|
109
|
+
|
|
110
|
+
### Use AI Mode
|
|
111
|
+
|
|
112
|
+
Simply run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
execdiff-git scan-ai
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
If the AI model is not installed, you'll be asked:
|
|
66
119
|
|
|
67
|
-
|
|
120
|
+
```
|
|
121
|
+
⚠️ Model 'tinyllama' (~637MB) is not installed locally.
|
|
122
|
+
✅ Everything stays local - no data is sent to the cloud.
|
|
123
|
+
|
|
124
|
+
Download 'tinyllama' now? (yes/no):
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Say "yes" to download, or "no" to skip AI analysis.**
|
|
128
|
+
|
|
129
|
+
---
|
|
68
130
|
|
|
69
131
|
## Usage
|
|
70
132
|
|
|
71
133
|
### Basic Commands
|
|
72
134
|
|
|
73
|
-
|
|
74
|
-
|
|
135
|
+
**Non-AI mode (fast, always available, no setup):**
|
|
75
136
|
```bash
|
|
76
137
|
execdiff-git scan
|
|
77
138
|
```
|
|
78
139
|
|
|
79
|
-
|
|
80
|
-
|
|
140
|
+
**AI mode (optional, requires Ollama ~700MB total):**
|
|
81
141
|
```bash
|
|
82
142
|
execdiff-git scan-ai
|
|
83
143
|
```
|
|
@@ -92,44 +152,21 @@ execdiff-git scan-ai
|
|
|
92
152
|
==============================
|
|
93
153
|
File +Lines -Lines
|
|
94
154
|
------------------------------------------------
|
|
95
|
-
|
|
96
|
-
checkout.py 7 1
|
|
97
|
-
email/notifications.py 5 0
|
|
98
|
-
|
|
99
|
-
--------------------------------
|
|
155
|
+
test_feature.py 14 0
|
|
100
156
|
|
|
101
157
|
================================================================================
|
|
102
158
|
📋 Impact Summary
|
|
103
159
|
================================================================================
|
|
104
160
|
Symbol Change Type Impact
|
|
105
161
|
--------------------------------------------------------
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
send_order_email function added LOW
|
|
162
|
+
authenticate_user function added LOW
|
|
163
|
+
create_session function added LOW
|
|
164
|
+
validate_token function added LOW
|
|
110
165
|
|
|
111
166
|
✅ Assessment complete!
|
|
112
167
|
```
|
|
113
168
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
Ollama enables intelligent risk scoring. Install and configure:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# macOS / Linux
|
|
120
|
-
curl -fsSL https://ollama.ai/install.sh | sh
|
|
121
|
-
|
|
122
|
-
# Or use Homebrew (macOS)
|
|
123
|
-
brew install ollama
|
|
124
|
-
|
|
125
|
-
# Pull the model
|
|
126
|
-
ollama pull llama2
|
|
127
|
-
|
|
128
|
-
# Start the server (runs on localhost:11434)
|
|
129
|
-
ollama serve
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
With Ollama running, you'll also get AI-powered impact assessment:
|
|
169
|
+
**AI Mode (with Ollama):**
|
|
133
170
|
|
|
134
171
|
```
|
|
135
172
|
==============================
|
|
@@ -137,72 +174,74 @@ With Ollama running, you'll also get AI-powered impact assessment:
|
|
|
137
174
|
==============================
|
|
138
175
|
File +Lines -Lines
|
|
139
176
|
------------------------------------------------
|
|
140
|
-
|
|
141
|
-
checkout.py 7 1
|
|
142
|
-
email/notifications.py 5 0
|
|
143
|
-
|
|
144
|
-
--------------------------------
|
|
177
|
+
test_feature.py 14 0
|
|
145
178
|
|
|
146
179
|
================================================================================
|
|
147
180
|
📋 Impact Summary
|
|
148
181
|
================================================================================
|
|
149
182
|
Symbol Change Type Impact
|
|
150
183
|
--------------------------------------------------------
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
send_order_email function added LOW
|
|
184
|
+
authenticate_user function added LOW
|
|
185
|
+
create_session function added LOW
|
|
186
|
+
validate_token function added LOW
|
|
155
187
|
|
|
156
188
|
================================================================================
|
|
157
189
|
🤖 AI Impact Assessment
|
|
158
190
|
================================================================================
|
|
159
191
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
192
|
+
🚀 Starting Ollama server...
|
|
193
|
+
⏳ Waiting for Ollama server to start...
|
|
194
|
+
✅ Ollama server is ready!
|
|
195
|
+
🧠 Analyzing with AI (tinyllama, 100% local)...
|
|
164
196
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
Detailed Analysis:
|
|
168
|
-
|
|
169
|
-
File: shopping_cart.py - Symbol: add_to_cart
|
|
197
|
+
Symbol: authenticate_user
|
|
170
198
|
Impact: MEDIUM
|
|
171
|
-
Summary:
|
|
199
|
+
Summary: Added user authentication logic. This affects user access and security.
|
|
172
200
|
|
|
173
|
-
|
|
201
|
+
Symbol: create_session
|
|
174
202
|
Impact: LOW
|
|
175
|
-
Summary:
|
|
203
|
+
Summary: Added session creation. Improves user experience and session management.
|
|
176
204
|
|
|
177
|
-
|
|
178
|
-
Impact: HIGH
|
|
179
|
-
Summary: Checkout flow changed to support Apple Pay, Google Pay, PayPal, and credit cards, and to update order completion steps.
|
|
180
|
-
|
|
181
|
-
File: email/notifications.py - Symbol: send_order_email
|
|
205
|
+
Symbol: validate_token
|
|
182
206
|
Impact: LOW
|
|
183
|
-
Summary:
|
|
207
|
+
Summary: Added token validation. Enhances security by validating session tokens.
|
|
184
208
|
|
|
185
|
-
|
|
186
|
-
Please review carefully before deploying to production.
|
|
209
|
+
🛑 Ollama server stopped
|
|
187
210
|
|
|
188
211
|
✅ Assessment complete!
|
|
189
212
|
```
|
|
190
213
|
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Comparison: Non-AI vs AI Mode
|
|
217
|
+
|
|
218
|
+
| Feature | Non-AI Mode | AI Mode |
|
|
219
|
+
|---------|-------------|---------|
|
|
220
|
+
| **Setup** | None | Ollama + model (~700MB) |
|
|
221
|
+
| **Speed** | Instant | 5-30 seconds |
|
|
222
|
+
| **Analysis** | Symbol detection | Business-facing summaries |
|
|
223
|
+
| **Privacy** | 100% local | 100% local |
|
|
224
|
+
| **Offline** | Yes | Yes (after setup) |
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
191
228
|
## How It Works
|
|
192
229
|
|
|
193
|
-
1. **Reads git diff** - Gets all staged
|
|
230
|
+
1. **Reads git diff** - Gets all staged changes (`git diff --cached`)
|
|
194
231
|
2. **Extracts symbols** - Finds functions, classes, and variables
|
|
195
232
|
3. **Detects change type** - Identifies what kind of change was made
|
|
196
|
-
4. **Assesses impact** - Uses local AI (Ollama) or heuristics
|
|
197
|
-
5. **Generates
|
|
233
|
+
4. **Assesses impact** - Uses local AI (Ollama) if available, or quick heuristics
|
|
234
|
+
5. **Generates business summary** - Specific, non-technical impact summary (AI mode only)
|
|
198
235
|
6. **Advisory warnings** - Critical impact changes trigger warnings (AI mode only)
|
|
199
236
|
|
|
237
|
+
---
|
|
238
|
+
|
|
200
239
|
## Development
|
|
201
240
|
|
|
202
241
|
Install in editable mode:
|
|
203
242
|
|
|
204
243
|
```bash
|
|
205
|
-
git clone https://github.com/
|
|
244
|
+
git clone https://github.com/anupmoncy/execdiff-git-ai.git
|
|
206
245
|
cd execdiff-git-ai
|
|
207
246
|
pip install -e .
|
|
208
247
|
```
|
|
@@ -223,7 +262,7 @@ from execdiff_git_ai.agent import run_agent, run_agent_with_ai
|
|
|
223
262
|
# Non-AI mode (default)
|
|
224
263
|
run_agent()
|
|
225
264
|
|
|
226
|
-
# AI-powered mode (optional,
|
|
265
|
+
# AI-powered mode (optional, automatically manages Ollama)
|
|
227
266
|
run_agent_with_ai()
|
|
228
267
|
```
|
|
229
268
|
|