codeflow-hook 1.4.0 → 2.0.1
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.
- package/README.md +80 -399
- package/bin/codeflow-hook.js +183 -3
- package/lib/cli-integration/dist/index.d.ts +128 -0
- package/lib/cli-integration/dist/index.js +585 -0
- package/lib/cli-integration/dist/pipelineConfigs.d.ts +60 -0
- package/lib/cli-integration/dist/pipelineConfigs.js +549 -0
- package/lib/cli-integration/dist/simulationEngine.d.ts +86 -0
- package/lib/cli-integration/dist/simulationEngine.js +475 -0
- package/lib/cli-integration/dist/types.d.ts +156 -0
- package/lib/cli-integration/dist/types.js +15 -0
- package/lib/cli-integration/src/index.ts +748 -0
- package/lib/cli-integration/src/pipelineConfigs.ts +579 -0
- package/lib/cli-integration/src/simulationEngine.ts +622 -0
- package/lib/cli-integration/src/types.ts +175 -0
- package/package.json +13 -5
package/README.md
CHANGED
|
@@ -1,116 +1,36 @@
|
|
|
1
|
-
# Codeflow
|
|
1
|
+
# Codeflow Hook
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**AI-Powered Code Analysis and Git Hook Management**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A lightweight command-line tool that provides AI-driven code analysis, automated git hook installation, and intelligent code review capabilities. This standalone CLI tool analyzes your local code changes using advanced AI models (Gemini, OpenAI GPT, or Claude) and helps maintain code quality through automated pre-commit and pre-push checks.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**✨ Standalone Package**: This CLI tool works independently and can be installed globally via npm. No additional setup or enterprise infrastructure required.
|
|
8
8
|
|
|
9
|
-
## 🚀
|
|
9
|
+
## 🚀 Features
|
|
10
10
|
|
|
11
|
-
### **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
11
|
+
### **AI-Powered Code Analysis**
|
|
12
|
+
- **Local Code Diff Analysis**: Analyze git diffs using Gemini, OpenAI GPT, or Claude AI models
|
|
13
|
+
- **Quality Assessment**: Get 1-10 quality ratings with detailed feedback on code changes
|
|
14
|
+
- **Security Detection**: Identify potential security vulnerabilities in code changes
|
|
15
|
+
- **Performance Insights**: Receive suggestions for performance optimizations
|
|
16
16
|
|
|
17
|
-
### **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
17
|
+
### **Git Hook Automation**
|
|
18
|
+
- **Pre-commit Hooks**: Automatic analysis of staged changes before commits
|
|
19
|
+
- **Pre-push Hooks**: Comprehensive code review simulation before pushing to remote
|
|
20
|
+
- **Quality Gates**: Prevent problematic commits and pushes based on AI analysis
|
|
21
|
+
- **Customizable Thresholds**: Configure when to block commits based on quality scores
|
|
22
22
|
|
|
23
|
-
### **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
23
|
+
### **Local Knowledge Base (RAG)**
|
|
24
|
+
- **Project Context Indexing**: Build searchable knowledge base from your project files
|
|
25
|
+
- **Context-Aware Analysis**: AI analysis considers your project's documentation and code patterns
|
|
26
|
+
- **Offline Capability**: Works without internet for local analysis (with indexed knowledge)
|
|
27
|
+
- **Incremental Updates**: Automatically update knowledge base as project evolves
|
|
28
28
|
|
|
29
|
-
### **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
|
|
35
|
-
### **Governance Safety Framework (GSF)**
|
|
36
|
-
- **Autonomous Permissions**: Dynamic access control based on context and risk
|
|
37
|
-
- **Real-time Compliance**: Continuous regulatory and policy validation
|
|
38
|
-
- **Emergency Controls**: System-wide safety mechanisms and overrides
|
|
39
|
-
- **Human-in-the-Loop**: Graduated approval workflows for different risk levels
|
|
40
|
-
|
|
41
|
-
### **Distributed Execution Engine (DEE)**
|
|
42
|
-
- **Repository Federation**: Coordinate operations across multiple repositories
|
|
43
|
-
- **Workflow Orchestration**: Complex process execution with dependency management
|
|
44
|
-
- **State Synchronization**: Federated data consistency across the enterprise
|
|
45
|
-
- **Resource Optimization**: Intelligent load balancing and execution management
|
|
46
|
-
|
|
47
|
-
## 🏗️ Architecture Overview
|
|
48
|
-
|
|
49
|
-
The CLI serves as your interface to the Codeflow Commander Nexus Gateway — a distributed, autonomous engineering platform designed for enterprise-scale operation.
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
┌─────────────────────────────────────────────────────────┐
|
|
53
|
-
│ MULTI-MODAL INTERFACE LAYER (MMIL) │
|
|
54
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
55
|
-
│ │ Conversational │ │ Design→Code │ │ IDE │ │
|
|
56
|
-
│ │ Interfaces │ │ Pipeline │ │ Integrations│ │
|
|
57
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
58
|
-
└─────────────────────────────────────────────────────────┘
|
|
59
|
-
│
|
|
60
|
-
▼
|
|
61
|
-
┌─────────────────────────────────────────────────────────┐
|
|
62
|
-
│ AUTONOMOUS AGENT NETWORK (AAN) - ORCHESTRATOR │
|
|
63
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
64
|
-
│ │ Workflow Agents │ │ Maintenance │ │ Self-Heal │ │
|
|
65
|
-
│ │ │ │ Bots │ │ Agents │ │
|
|
66
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
67
|
-
└─────────────────────────────────────────────────────────┘
|
|
68
|
-
│
|
|
69
|
-
▼
|
|
70
|
-
┌─────────────────────────────────────────────────────────┐
|
|
71
|
-
│ GOVERNANCE & SAFETY FRAMEWORK - RISK CONTROL │
|
|
72
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
73
|
-
│ │ Permission │ │ Audit & │ │ Emergency │ │
|
|
74
|
-
│ │ Engine │ │ Compliance │ │ Controls │ │
|
|
75
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
76
|
-
└─────────────────────────────────────────────────────────┘
|
|
77
|
-
│
|
|
78
|
-
▼
|
|
79
|
-
┌─────────────────────────────────────────────────────────┐
|
|
80
|
-
│ ENTERPRISE KNOWLEDGE GRAPH (EKG) - INTELLIGENCE │
|
|
81
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
82
|
-
│ │ Cross-Repo │ │ Semantic │ │ Expert │ │
|
|
83
|
-
│ │ Dependencies │ │ Mapping │ │ Discovery │ │
|
|
84
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
85
|
-
└─────────────────────────────────────────────────────────┘
|
|
86
|
-
│
|
|
87
|
-
▼
|
|
88
|
-
┌─────────────────────────────────────────────────────────┐
|
|
89
|
-
│ PREDICTIVE INTELLIGENCE ENGINE (PIE) - FORECASTING │
|
|
90
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
91
|
-
│ │ Tech Debt │ │ Performance │ │ Risk │ │
|
|
92
|
-
│ │ Forecasting │ │ Prediction │ │ Analytics │ │
|
|
93
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
94
|
-
└─────────────────────────────────────────────────────────┘
|
|
95
|
-
│
|
|
96
|
-
▼
|
|
97
|
-
┌─────────────────────────────────────────────────────────┐
|
|
98
|
-
│ DISTRIBUTED EXECUTION ENGINE (DEE) - RUNTIME │
|
|
99
|
-
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
|
|
100
|
-
│ │ Repository │ │ Workflow │ │ State │ │
|
|
101
|
-
│ │ Federation │ │ Orchestration │ │ Sync │ │
|
|
102
|
-
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
|
|
103
|
-
└─────────────────────────────────────────────────────────┘
|
|
104
|
-
│
|
|
105
|
-
▼
|
|
106
|
-
┌─────────────────────────────────────────────────────────┐
|
|
107
|
-
│ EXTERNAL SYSTEMS INTEGRATION │
|
|
108
|
-
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
|
|
109
|
-
│ │GitHub│ │GitLab│ │JIRA │ │Slack│ │Jenkins│ │
|
|
110
|
-
│ │Actions│ │ │ │ │ │ │ │ │ │
|
|
111
|
-
│ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ │
|
|
112
|
-
└─────────────────────────────────────────────────────────┘
|
|
113
|
-
```
|
|
29
|
+
### **Multi-Provider AI Support**
|
|
30
|
+
- **Google Gemini**: Default AI provider with latest models (1.5 Pro, 1.5 Flash, Pro)
|
|
31
|
+
- **OpenAI GPT**: Support for GPT-4, GPT-4 Turbo, GPT-3.5 Turbo
|
|
32
|
+
- **Anthropic Claude**: Integration with Claude 3 Opus, Sonnet, and Haiku
|
|
33
|
+
- **Custom Endpoints**: Connect to self-hosted or custom AI model endpoints
|
|
114
34
|
|
|
115
35
|
## 📦 Installation
|
|
116
36
|
|
|
@@ -126,279 +46,69 @@ npm install -g codeflow-hook
|
|
|
126
46
|
npm install --save-dev codeflow-hook
|
|
127
47
|
```
|
|
128
48
|
|
|
129
|
-
## ⚙️
|
|
49
|
+
## ⚙️ Quick Start
|
|
130
50
|
|
|
131
51
|
### 1. Configure AI Provider
|
|
132
52
|
|
|
133
53
|
Choose your AI provider and configure with your API key:
|
|
134
54
|
|
|
135
|
-
**Gemini (default):**
|
|
136
55
|
```bash
|
|
56
|
+
# Gemini (default, recommended)
|
|
137
57
|
codeflow-hook config -p gemini -k YOUR_GEMINI_API_KEY
|
|
138
|
-
```
|
|
139
|
-
*You'll be prompted to select a model: `gemini-1.5-pro-latest`, `gemini-1.5-flash-latest`, or `gemini-pro`*
|
|
140
58
|
|
|
141
|
-
|
|
142
|
-
```bash
|
|
59
|
+
# OpenAI
|
|
143
60
|
codeflow-hook config -p openai -k YOUR_OPENAI_API_KEY
|
|
144
|
-
```
|
|
145
|
-
*You'll be prompted to select a model: `gpt-4o`, `gpt-4-turbo`, `gpt-4`, or `gpt-3.5-turbo`*
|
|
146
61
|
|
|
147
|
-
|
|
148
|
-
```bash
|
|
62
|
+
# Claude/Anthropic
|
|
149
63
|
codeflow-hook config -p claude -k YOUR_CLAUDE_API_KEY
|
|
150
64
|
```
|
|
151
|
-
*You'll be prompted to select a model: `claude-3-opus-20240229`, `claude-3-sonnet-20240229`, or `claude-3-haiku-20240307`*
|
|
152
|
-
|
|
153
|
-
**Custom model/URL:**
|
|
154
|
-
```bash
|
|
155
|
-
codeflow-hook config -p openai -k YOUR_API_KEY -m gpt-3.5-turbo -u https://your-custom-endpoint.com
|
|
156
|
-
```
|
|
157
65
|
|
|
158
66
|
### 2. Install Git Hooks
|
|
159
67
|
|
|
160
|
-
In your project directory:
|
|
161
|
-
|
|
162
68
|
```bash
|
|
163
69
|
codeflow-hook install
|
|
164
70
|
```
|
|
165
71
|
|
|
166
|
-
|
|
167
|
-
- `pre-commit`: AI analysis of staged changes
|
|
168
|
-
- `pre-push`: Full CI/CD simulation (tests + AI review)
|
|
169
|
-
|
|
170
|
-
### 3. Index Project Knowledge (RAG Setup)
|
|
171
|
-
|
|
172
|
-
Build a local knowledge base for context-aware analysis:
|
|
72
|
+
### 3. Start Analyzing Code
|
|
173
73
|
|
|
174
74
|
```bash
|
|
175
|
-
#
|
|
176
|
-
codeflow-hook
|
|
177
|
-
|
|
178
|
-
# Dry run to see what files would be indexed
|
|
179
|
-
codeflow-hook index --dry-run
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
The knowledge base is stored in `.codeflow/index/` and includes:
|
|
183
|
-
- README.md and documentation files
|
|
184
|
-
- Source code files (.ts, .tsx, .js, .jsx, .json)
|
|
185
|
-
- Configuration files (package.json, jest.config.*, etc.)
|
|
186
|
-
- Architecture and design documents
|
|
187
|
-
|
|
188
|
-
### 4. Check Status
|
|
75
|
+
# Analyze your current changes
|
|
76
|
+
git diff | codeflow-hook analyze-diff
|
|
189
77
|
|
|
190
|
-
|
|
191
|
-
|
|
78
|
+
# Or let the hooks run automatically on commit/push
|
|
79
|
+
git add .
|
|
80
|
+
git commit -m "feat: add new feature"
|
|
192
81
|
```
|
|
193
82
|
|
|
194
83
|
## 🛠️ Commands
|
|
195
84
|
|
|
196
85
|
### Core Commands
|
|
197
86
|
|
|
198
|
-
**Index Project Knowledge**:
|
|
199
87
|
```bash
|
|
200
|
-
#
|
|
201
|
-
codeflow-hook
|
|
202
|
-
|
|
203
|
-
#
|
|
204
|
-
codeflow-hook
|
|
88
|
+
codeflow-hook config # Configure AI provider settings
|
|
89
|
+
codeflow-hook install # Install git hooks
|
|
90
|
+
codeflow-hook analyze-diff # Analyze code changes
|
|
91
|
+
codeflow-hook index # Build local knowledge base
|
|
92
|
+
codeflow-hook status # Check installation status
|
|
205
93
|
```
|
|
206
94
|
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# Analyze staged changes
|
|
210
|
-
git diff --staged | codeflow-hook analyze-diff
|
|
211
|
-
|
|
212
|
-
# Disable RAG context (faster but less precise)
|
|
213
|
-
git diff | codeflow-hook analyze-diff --no-rag
|
|
214
|
-
|
|
215
|
-
# Use legacy monolithic analysis
|
|
216
|
-
git diff | codeflow-hook analyze-diff --legacy
|
|
217
|
-
```
|
|
95
|
+
### Usage Examples
|
|
218
96
|
|
|
219
|
-
**Configuration & Setup**:
|
|
220
97
|
```bash
|
|
221
|
-
# Configure
|
|
222
|
-
codeflow-hook config -p gemini -k
|
|
98
|
+
# Configure with Gemini (default)
|
|
99
|
+
codeflow-hook config -p gemini -k your-api-key
|
|
223
100
|
|
|
224
|
-
# Install
|
|
101
|
+
# Install hooks in current project
|
|
225
102
|
codeflow-hook install
|
|
226
103
|
|
|
227
|
-
#
|
|
228
|
-
codeflow-hook
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Advanced Options
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
# Use legacy mode for backwards compatibility
|
|
235
|
-
codeflow-hook analyze-diff --legacy
|
|
236
|
-
|
|
237
|
-
# Skip RAG for faster analysis
|
|
238
|
-
codeflow-hook analyze-diff --no-rag
|
|
239
|
-
|
|
240
|
-
# Custom hooks directory
|
|
241
|
-
codeflow-hook install --hooks-dir .custom-hooks
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### View Help
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
codeflow-hook --help # Main help
|
|
248
|
-
codeflow-hook index --help # Index command help
|
|
249
|
-
codeflow-hook analyze-diff --help # Analysis options
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## 🔄 How It Works
|
|
253
|
-
|
|
254
|
-
### Pre-commit Hook
|
|
255
|
-
- Analyzes staged changes only
|
|
256
|
-
- Provides quick feedback on code quality
|
|
257
|
-
- Prevents problematic commits
|
|
258
|
-
|
|
259
|
-
### Pre-push Hook
|
|
260
|
-
- Runs full test suite
|
|
261
|
-
- Performs comprehensive AI code review
|
|
262
|
-
- Simulates deployment pipeline
|
|
263
|
-
- Blocks pushes with failing checks
|
|
264
|
-
|
|
265
|
-
### AI Analysis Features
|
|
266
|
-
- Code quality assessment
|
|
267
|
-
- Security vulnerability detection
|
|
268
|
-
- Performance optimization suggestions
|
|
269
|
-
- Best practice recommendations
|
|
270
|
-
- Maintainability evaluation
|
|
271
|
-
|
|
272
|
-
## 🔬 Enterprise Technology Stack
|
|
273
|
-
|
|
274
|
-
### **Multi-Modal AI Integration**
|
|
275
|
-
The Nexus Gateway integrates multiple AI modalities for comprehensive engineering intelligence:
|
|
276
|
-
|
|
277
|
-
**🤖 Conversational Interface Layer**: Natural language processing for requirement analysis and complex code generation
|
|
278
|
-
**🎨 Design-to-Code Pipeline**: Computer vision and ML models for design artifact ingestion
|
|
279
|
-
**📊 Predictive Analytics Engine**: Time-series analysis and machine learning for trend forecasting
|
|
280
|
-
**🔍 Semantic Code Analysis**: Advanced NLP for code understanding and pattern recognition
|
|
281
|
-
|
|
282
|
-
### **Autonomous Agent Architecture**
|
|
283
|
-
The core platform intelligence is delivered through specialized agent networks:
|
|
284
|
-
|
|
285
|
-
**🎯 Workflow Execution Agents**:
|
|
286
|
-
- Ticket-to-PR automation with full engineering lifecycle management
|
|
287
|
-
- Self-healing operations with automated issue detection and remediation
|
|
288
|
-
- Dependency management with intelligent version conflict resolution
|
|
289
|
-
|
|
290
|
-
**🔬 Observational Intelligence Agents**:
|
|
291
|
-
- Predictive maintenance scheduling based on code analysis patterns
|
|
292
|
-
- Performance regression detection using historical benchmarking
|
|
293
|
-
- Risk assessment with real-time compliance monitoring
|
|
294
|
-
|
|
295
|
-
**🤝 Collaborative Learning Agents**:
|
|
296
|
-
- Cross-repository knowledge synthesis and pattern mining
|
|
297
|
-
- Expert identification through contribution analysis
|
|
298
|
-
- Team productivity optimization through workflow analysis
|
|
299
|
-
|
|
300
|
-
### **Federated Data Architecture**
|
|
301
|
-
Enterprise-scale data management across distributed repositories:
|
|
302
|
-
|
|
303
|
-
**🌐 Enterprise Knowledge Graph (EKG)**:
|
|
304
|
-
- Multi-modal data integration (code, documentation, metrics, design artifacts)
|
|
305
|
-
- Semantic relationship mapping across the entire organization
|
|
306
|
-
- Real-time knowledge updates with conflict-free replication
|
|
307
|
-
|
|
308
|
-
**📈 Predictive Intelligence Engine (PIE)**:
|
|
309
|
-
- Time-series analytics for development velocity and quality trends
|
|
310
|
-
- Anomaly detection using unsupervised learning algorithms
|
|
311
|
-
- Forecasting models trained on enterprise development data
|
|
312
|
-
|
|
313
|
-
### **Distributed Execution Framework**
|
|
314
|
-
Coordination of autonomous operations across multiple systems:
|
|
315
|
-
|
|
316
|
-
**⚡ Distributed Execution Engine (DEE)**:
|
|
317
|
-
- Multi-repository workflow orchestration with dependency management
|
|
318
|
-
- Resource optimization through intelligent load balancing
|
|
319
|
-
- Federated state management with eventual consistency guarantees
|
|
320
|
-
|
|
321
|
-
**🔐 Governance Safety Framework (GSF)**:
|
|
322
|
-
- Risk-based permission evaluation with dynamic access controls
|
|
323
|
-
- Multi-level audit trails with blockchain-verified immutability
|
|
324
|
-
- Emergency stop mechanisms with graduated escalation protocols
|
|
325
|
-
|
|
326
|
-
### **Structured Intelligence Output Format**
|
|
327
|
-
Enterprise reporting with actionable insights and automated workflows:
|
|
328
|
-
|
|
329
|
-
```
|
|
330
|
-
🏢 Enterprise Code Review Summary:
|
|
331
|
-
🔒 Organization-wide Security risks: 2
|
|
332
|
-
🏗️ Architecture Optimization opportunities: 7
|
|
333
|
-
📝 Cross-repository Maintainability issues: 15
|
|
334
|
-
🎯 Predictive Maintenance alerts: 3
|
|
335
|
-
|
|
336
|
-
📊 Trend Analysis:
|
|
337
|
-
📈 Code quality velocity: +12% (improving)
|
|
338
|
-
📉 Tech debt accumulation: -8% (reducing)
|
|
339
|
-
🎲 Risk exposure index: LOW (confidence: 94%)
|
|
340
|
-
|
|
341
|
-
📋 Recommended Actions:
|
|
342
|
-
🔧 Automated fixes available for 23 issues
|
|
343
|
-
🚀 Cross-repository refactor suggested for auth module
|
|
344
|
-
📅 Maintenance window scheduled for Q4 dependency updates
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### **Multi-Repository Analysis Benefits**
|
|
348
|
-
- **Scale**: Analyzes thousands of repositories simultaneously
|
|
349
|
-
- **Intelligence**: Learns organizational patterns and standards
|
|
350
|
-
- **Automation**: Initiates cross-cutting improvements autonomously
|
|
351
|
-
- **Governance**: Ensures compliance across all engineering activities
|
|
352
|
-
- **Prediction**: Forecasts development bottlenecks before they occur
|
|
353
|
-
|
|
354
|
-
## 💡 Usage Examples
|
|
355
|
-
|
|
356
|
-
### Standard Development Workflow
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
# Stage your changes
|
|
360
|
-
git add .
|
|
361
|
-
|
|
362
|
-
# Pre-commit hook automatically runs AI analysis
|
|
363
|
-
git commit -m "feat: add new authentication"
|
|
364
|
-
|
|
365
|
-
# Pre-push hook runs tests and full AI review
|
|
366
|
-
git push origin main
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Manual Analysis
|
|
370
|
-
|
|
371
|
-
```bash
|
|
372
|
-
# Analyze uncommitted changes
|
|
373
|
-
git diff | codeflow-hook analyze-diff
|
|
374
|
-
|
|
375
|
-
# Analyze specific files
|
|
376
|
-
git diff path/to/file.js | codeflow-hook analyze-diff
|
|
377
|
-
|
|
378
|
-
# Analyze between commits
|
|
379
|
-
git diff HEAD~1 HEAD | codeflow-hook analyze-diff
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
## 🎯 AI Analysis Output
|
|
383
|
-
|
|
384
|
-
The tool provides:
|
|
385
|
-
|
|
386
|
-
- **Rating**: 1-10 quality score with color coding
|
|
387
|
-
- **Summary**: Brief assessment of changes
|
|
388
|
-
- **Issues**: Specific problems with solutions
|
|
389
|
-
- **Recommendations**: Improvement suggestions
|
|
390
|
-
|
|
391
|
-
Example output:
|
|
392
|
-
```
|
|
393
|
-
⭐ **Rating:** 9/10
|
|
394
|
-
📝 **Summary:** Clean implementation with good separation of concerns
|
|
104
|
+
# Analyze staged changes
|
|
105
|
+
git diff --staged | codeflow-hook analyze-diff
|
|
395
106
|
|
|
396
|
-
|
|
397
|
-
-
|
|
107
|
+
# Build project knowledge base
|
|
108
|
+
codeflow-hook index
|
|
398
109
|
|
|
399
|
-
|
|
400
|
-
-
|
|
401
|
-
- Consider extracting common logic to a utility function
|
|
110
|
+
# Check everything is working
|
|
111
|
+
codeflow-hook status
|
|
402
112
|
```
|
|
403
113
|
|
|
404
114
|
## 🔧 Configuration
|
|
@@ -409,31 +119,28 @@ Configuration is stored in `~/.codeflow-hook/config.json`:
|
|
|
409
119
|
{
|
|
410
120
|
"provider": "gemini",
|
|
411
121
|
"apiKey": "your-api-key",
|
|
412
|
-
"
|
|
413
|
-
"model": "gemini-pro"
|
|
122
|
+
"model": "gemini-1.5-pro-latest"
|
|
414
123
|
}
|
|
415
124
|
```
|
|
416
125
|
|
|
417
126
|
### Supported AI Providers
|
|
418
127
|
|
|
419
|
-
- **Gemini**: `provider: "gemini"` -
|
|
128
|
+
- **Gemini**: `provider: "gemini"` - Google AI (recommended)
|
|
420
129
|
- **OpenAI**: `provider: "openai"` - GPT models
|
|
421
130
|
- **Claude**: `provider: "claude"` - Anthropic models
|
|
422
131
|
|
|
423
|
-
Each provider has optimized prompts and supports custom endpoints.
|
|
424
|
-
|
|
425
132
|
## 📋 Requirements
|
|
426
133
|
|
|
427
134
|
- Node.js 16+
|
|
428
135
|
- Git repository
|
|
429
|
-
-
|
|
136
|
+
- AI API key (Gemini, OpenAI, or Claude)
|
|
430
137
|
|
|
431
|
-
## 🔒 Security
|
|
138
|
+
## 🔒 Security & Privacy
|
|
432
139
|
|
|
433
|
-
-
|
|
434
|
-
-
|
|
435
|
-
- No
|
|
436
|
-
-
|
|
140
|
+
- **Local Processing**: All code analysis happens on your machine
|
|
141
|
+
- **API Keys Stored Locally**: Keys are stored in `~/.codeflow-hook/config.json`
|
|
142
|
+
- **No Data Collection**: Code diffs are only sent to your configured AI provider
|
|
143
|
+
- **No Telemetry**: No usage data is collected or transmitted
|
|
437
144
|
|
|
438
145
|
## 🐛 Troubleshooting
|
|
439
146
|
|
|
@@ -447,72 +154,46 @@ codeflow-hook config -k YOUR_API_KEY
|
|
|
447
154
|
**Hooks not running**
|
|
448
155
|
```bash
|
|
449
156
|
codeflow-hook install
|
|
450
|
-
#
|
|
451
|
-
chmod +x .git/hooks/pre-commit .git/hooks/pre-push
|
|
157
|
+
# On Windows, ensure hooks are executable
|
|
452
158
|
```
|
|
453
159
|
|
|
454
160
|
**API errors**
|
|
455
|
-
- Verify your API key is valid
|
|
456
|
-
- Check
|
|
457
|
-
-
|
|
161
|
+
- Verify your API key is valid and has quota remaining
|
|
162
|
+
- Check your internet connection
|
|
163
|
+
- Try a different AI provider
|
|
458
164
|
|
|
459
165
|
### Manual Hook Setup
|
|
460
166
|
|
|
461
167
|
If automatic installation fails:
|
|
462
168
|
|
|
463
|
-
1. Create `.git/hooks/pre-commit
|
|
464
|
-
|
|
465
|
-
|
|
169
|
+
1. Create `.git/hooks/pre-commit`:
|
|
170
|
+
```bash
|
|
171
|
+
#!/bin/sh
|
|
172
|
+
codeflow-hook analyze-diff
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
2. Make it executable:
|
|
176
|
+
```bash
|
|
177
|
+
chmod +x .git/hooks/pre-commit
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 📄 License
|
|
181
|
+
|
|
182
|
+
MIT License
|
|
466
183
|
|
|
467
184
|
## 🤝 Contributing
|
|
468
185
|
|
|
469
186
|
1. Fork the repository
|
|
470
187
|
2. Create a feature branch
|
|
471
188
|
3. Make your changes
|
|
472
|
-
4.
|
|
189
|
+
4. Test thoroughly
|
|
473
190
|
5. Submit a pull request
|
|
474
191
|
|
|
475
|
-
## 📄 License
|
|
476
|
-
|
|
477
|
-
MIT License - see LICENSE file for details
|
|
478
|
-
|
|
479
|
-
## 🎉 Acknowledgments
|
|
480
|
-
|
|
481
|
-
Built with ❤️ using enterprise-grade technologies:
|
|
482
|
-
|
|
483
|
-
### **Core Intelligence Stack**
|
|
484
|
-
- **Multi-Modal AI Integration**: Google Gemini, OpenAI GPT-4, Anthropic Claude
|
|
485
|
-
- **Distributed Graph Database**: Neo4j Enterprise for Knowledge Graph operations
|
|
486
|
-
- **Federated Learning Infrastructure**: PyTorch and TensorFlow for ML model training
|
|
487
|
-
- **Container Orchestration**: Kubernetes for enterprise-scale deployment
|
|
488
|
-
|
|
489
|
-
### **Development & CLI Framework**
|
|
490
|
-
- **Commander.js**: Professional CLI experience and command orchestration
|
|
491
|
-
- **Chalk & Ora**: Advanced terminal rendering with progress indicators
|
|
492
|
-
- **Axios**: Enterprise HTTP client with retry logic and circuit breakers
|
|
493
|
-
- **Node.js & TypeScript**: Type-safe, scalable runtime environment
|
|
494
|
-
|
|
495
|
-
### **Enterprise Integrations**
|
|
496
|
-
- **Git Platforms**: Native GitHub, GitLab, and Bitbucket integration
|
|
497
|
-
- **Project Management**: JIRA, Linear, and Azure DevOps workflows
|
|
498
|
-
- **Communication**: Slack, Microsoft Teams, and Discord integrations
|
|
499
|
-
- **Monitoring**: Datadog, New Relic, and Prometheus telemetry
|
|
500
|
-
|
|
501
|
-
### **Security & Governance**
|
|
502
|
-
- **Audit Framework**: Blockchain-verified audit trails
|
|
503
|
-
- **Access Management**: OAuth 2.0, SAML, and LDAP integration
|
|
504
|
-
- **Encryption**: End-to-end encryption with key management
|
|
505
|
-
- **Compliance**: SOC 2, GDPR, and enterprise security standards
|
|
506
|
-
|
|
507
192
|
---
|
|
508
193
|
|
|
509
|
-
**🚀
|
|
194
|
+
**🚀 Enhance your development workflow with AI-powered code analysis!**
|
|
510
195
|
|
|
511
|
-
Join the autonomous engineering revolution with Codeflow Commander Nexus Gateway — where AI meets enterprise-scale software development.
|
|
512
|
-
|
|
513
|
-
**Install today and experience organization-wide autonomous engineering:**
|
|
514
196
|
```bash
|
|
515
197
|
npm install -g codeflow-hook
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
**Visit [codeflow-commander-nexus-gateway](https://github.com/Sharv619/codeflow-commander---nexus-gateway) to explore the full platform.**
|
|
198
|
+
codeflow-hook config -k YOUR_API_KEY
|
|
199
|
+
codeflow-hook install
|