orcommit 1.2.10 → 1.2.12

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 +102 -673
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,756 +1,185 @@
1
- # ORCommit - AI Commit Message Generator | Automated Git Commits with OpenAI & Claude
1
+ # ORCommit
2
2
 
3
- <p align="center">
4
- <img src="https://unpkg.com/orcommit@latest/preview.png" alt="ORCommit Banner" width="600">
5
- </p>
6
-
7
- > **AI-powered git automation** for developers: Generate professional commit messages instantly using OpenAI, Claude, or local AI models
3
+ ### AI-powered Git commits with security, standards, and full control
8
4
 
9
5
  <p align="center">
10
- <a href="https://badge.fury.io/js/orcommit"><img src="https://badge.fury.io/js/orcommit.svg" alt="npm version"></a>
11
- <a href="https://github.com/ellerbrock/typescript-badges/"><img src="https://badges.frapsoft.com/typescript/code/typescript.svg?v=101" alt="TypeScript"></a>
12
- <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
6
+ <img src="https://unpkg.com/orcommit@latest/preview.png" alt="ORCommit Banner" width="600" />
13
7
  </p>
14
8
 
15
- **ORCommit** is the ultimate **AI commit message generator** and **git automation CLI tool** for modern developers. Generate meaningful, contextual commit messages using **GPT-4**, **Claude AI**, **OpenRouter**, or **local AI models (Ollama)**. Built with TypeScript, featuring **intelligent diff chunking**, **interactive regeneration**, **custom prompts**, and **multi-provider support**.
16
-
17
- Perfect for developers seeking **automated git commits**, **AI-powered development tools**, and **developer productivity** automation with support for **Conventional Commits** format.
18
-
19
- ## ✨ Key Features - Why Choose ORCommit?
20
-
21
- ### 🤖 **Multi-Provider AI Support**
22
- Generate commit messages with your choice of AI:
23
- - **OpenAI** (GPT-4, GPT-4 Turbo, GPT-3.5)
24
- - **Anthropic Claude** (via OpenRouter)
25
- - **OpenRouter** (access to 200+ AI models)
26
- - **Local AI Models** (Ollama support - free & private)
27
-
28
- ### 🔄 **Interactive Regeneration with Feedback**
29
- Not happy with the generated message? Provide feedback and regenerate:
30
- - Accept, cancel, or improve commit messages
31
- - Two-stage AI processing for higher quality
32
- - Up to 5 regeneration attempts with user guidance
33
- - Smart caching for instant responses
34
-
35
- ### 🎯 **Custom Prompts & Context**
36
- Full control over AI behavior:
37
- - Override default prompts with `--prompt`
38
- - Add project context with `--context`
39
- - Save team-specific prompts to config
40
- - Perfect for corporate standards and coding guidelines
41
-
42
- ### 📦 **Intelligent Diff Processing**
43
- Handles codebases of any size:
44
- - Token-aware chunking for large files
45
- - Smart filtering (100+ patterns for generated files)
46
- - Supports all ecosystems: JS, Python, Rust, Go, .NET, Flutter
47
- - Filters lock files, build outputs, and dependencies
48
-
49
- ### 🚀 **Seamless Git Workflow**
50
- Complete git automation:
51
- - Interactive push prompts with upstream setup
52
- - Git hooks integration for automated commits
53
- - Conventional Commits format support
54
- - Emoji support (Gitmoji compatible)
55
- - Breaking change detection
56
-
57
- ### ⚡ **Lightning Fast Performance**
58
- Optimized for speed:
59
- - Two-level caching (memory + disk)
60
- - Concurrent API processing
61
- - Exponential backoff for rate limits
62
- - Instant cached responses
63
-
64
- ### 🔒 **Enterprise-Ready Security**
65
- Built with security in mind:
66
- - **NEW: Professional secret scanning with Gitleaks** - detects 100+ secret patterns (AWS, GitHub, OpenAI, etc.)
67
- - **Automatic secret blocking** - prevents commits containing API keys, passwords, and tokens
68
- - **Strict dependency directory blocking** (`node_modules/`, `vendor/`) - cannot be overridden
69
- - Secure API key storage (600 permissions)
70
- - No logging of sensitive data
71
- - Environment variable support
72
- - Smart detection of package manager files and build artifacts
73
-
74
- ### 🎨 **Beautiful Developer Experience**
75
- Polished UI/UX:
76
- - Elegant progress indicators
77
- - Clear success/failure states
78
- - Timing information
79
- - Structured phase-based output
80
- - Verbose mode for debugging
81
-
82
- ### ✅ **Production-Ready Quality**
83
- Thoroughly tested and reliable:
84
- - **78 comprehensive tests** (100% passing)
85
- - Full unit and integration test coverage
86
- - TypeScript strict mode enabled
87
- - Clean commit message generation (removes AI noise)
88
- - Intelligent whitespace filtering
89
- - Robust error handling
90
-
91
- ## 🚀 Installation
92
-
93
- Install globally via npm:
9
+ > Generate **accurate, conventional, and secure** git commit messages using **OpenAI, Claude, OpenRouter, or local models (Ollama)**.
94
10
 
95
11
  ```bash
96
- npm install -g orcommit
12
+ git add .
13
+ orc commit
97
14
  ```
98
15
 
99
- Or use directly with npx:
16
+ Conventional Commits
17
+ ✔ Secret scanning (Gitleaks)
18
+ ✔ Cloud & local AI
19
+ ✔ Zero-config to start
100
20
 
101
- ```bash
102
- npx orcommit
103
- ```
104
-
105
- ## 📖 Quick Start - Get Started in 3 Steps
21
+ <p align="center">
22
+ <a href="https://badge.fury.io/js/orcommit"><img src="https://badge.fury.io/js/orcommit.svg" alt="npm version"></a>
23
+ <a href="https://github.com/ellerbrock/typescript-badges/"><img src="https://badges.frapsoft.com/typescript/code/typescript.svg?v=101" alt="TypeScript"></a>
24
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
25
+ </p>
106
26
 
107
- ### 1️⃣ **Install ORCommit**
108
- ```bash
109
- # Global installation (recommended)
110
- npm install -g orcommit
27
+ ---
111
28
 
112
- # Or use directly without installing
113
- npx orcommit
114
- ```
29
+ ## TL;DR
115
30
 
116
- ### 2️⃣ **Configure Your AI Provider**
117
- ```bash
118
- # Option 1: OpenRouter (recommended - access to 200+ models)
119
- orc config set openrouter your-api-key-here
31
+ **ORCommit** is a production-grade CLI that:
120
32
 
121
- # Option 2: OpenAI (GPT-4, GPT-3.5)
122
- orc config set openai your-openai-key-here
33
+ * analyzes your staged git diff
34
+ * generates a high-quality commit message via LLMs
35
+ * enforces Conventional Commits
36
+ * blocks secrets and dependency folders **before** commit
37
+ * works with both **cloud and local** AI models
123
38
 
124
- # Option 3: Use local AI models (free & private)
125
- # Install Ollama first: https://ollama.ai
126
- orc config model openrouter ollama/mistral
127
- ```
39
+ If you care about **clean history, security, and standards** — this tool is for you.
128
40
 
129
- ### 3️⃣ **Generate Your First AI Commit**
130
- ```bash
131
- # Stage your changes
132
- git add .
41
+ ---
133
42
 
134
- # Generate and commit (interactive mode)
135
- orc commit
43
+ ## Key Features
136
44
 
137
- # Or auto-commit without confirmation
138
- orc commit --yes
45
+ ### 🤖 AI Providers
139
46
 
140
- # With custom context for better results
141
- orc commit --context "Critical security fix for authentication"
142
- ```
47
+ * OpenAI (GPT‑4, GPT‑3.5)
48
+ * Claude via OpenRouter (200+ models)
49
+ * Local models via **Ollama** (offline & private)
143
50
 
144
- **That's it!** The AI will analyze your code changes and generate a professional commit message automatically.
51
+ ### 🧠 Smart Commit Generation
145
52
 
146
- ## 🛠 Commands
53
+ * Token-aware diff chunking (large repos supported)
54
+ * Interactive regeneration with feedback
55
+ * Custom prompts & project context
56
+ * Conventional Commits by default
147
57
 
148
- ### `orc commit` (default)
149
- Generate and create a commit message for staged changes.
58
+ ### 🔐 Security by Default
150
59
 
151
- **Options:**
60
+ * Secret scanning via **Gitleaks** (100+ patterns)
61
+ * Blocks API keys, tokens, private keys
62
+ * Prevents committing `node_modules/`, `vendor/`, etc.
63
+ * Secure API key storage (600 permissions)
152
64
 
153
- **Basic Options:**
154
- - `-y, --yes` - Skip confirmation and auto-commit
155
- - `-d, --dry-run` - Generate message without creating commit
156
- - `-v, --verbose` - Enable verbose logging
157
- - `-w, --watch` - Watch for changes and auto-generate commits
65
+ ### ⚙️ Git-Native Workflow
158
66
 
159
- **AI Customization (NEW):**
160
- - `--prompt <text>` - Override default AI prompt completely
161
- - `--context <text>` - Add additional context to the prompt
67
+ * Breaking change detection
68
+ * Optional push after commit
69
+ * Git hooks support
162
70
 
163
- **Commit Format:**
164
- - `-s, --scope <scope>` - Specify commit scope (e.g., auth, ui, api)
165
- - `-t, --type <type>` - Specify commit type (feat, fix, docs, etc.)
166
- - `-b, --breaking` - Mark as breaking change
167
- - `--emoji` - Include appropriate emoji in commit message
168
- - `--one-line` - Generate single-line commit message
169
- - `--description-length <length>` - Maximum description length
71
+ ### ⚡ Fast & Reliable
170
72
 
171
- **Provider & Processing:**
172
- - `-p, --provider <provider>` - Specify AI provider (openrouter|openai)
173
- - `--max-files <count>` - Maximum number of files to analyze
174
- - `--ignore-generated` - Ignore auto-generated files (default: true)
175
- - `--ignore-whitespace` - Ignore whitespace-only changes (default: true)
73
+ * Memory + disk cache
74
+ * Parallel API calls
75
+ * Strict TypeScript + comprehensive tests
176
76
 
177
- **Caching:**
178
- - `--no-cache` - Disable caching for this commit
179
- - `--clear-cache` - Clear cache before generating
77
+ ---
180
78
 
181
- **Git Integration:**
182
- - `--push` - Push changes to remote after commit
183
- - `--auto-push` - Automatically push all future commits
79
+ ## 🚀 Quick Start
184
80
 
185
- **Examples:**
186
81
  ```bash
187
- # Basic usage - interactive with regeneration support
188
- orc commit
189
-
190
- # Auto-confirm and push to remote
191
- orc commit --yes --push
192
-
193
- # Custom prompt for specific style
194
- orc commit --prompt "Generate a detailed technical commit message with examples"
195
-
196
- # Add context for better AI understanding
197
- orc commit --context "This fixes a critical security vulnerability in JWT validation"
198
-
199
- # Combine context with custom settings
200
- orc commit --context "Refactoring for performance" --type refactor --scope api
201
-
202
- # Generate with emoji and conventional commits
203
- orc commit --emoji --one-line --type feat --scope ui
204
-
205
- # Breaking change with detailed description
206
- orc commit --breaking --type feat --description-length 100
82
+ npm install -g orcommit
83
+ orc config set openrouter YOUR_API_KEY
207
84
 
208
- # Dry run to preview AI-generated message
209
- orc commit --dry-run --verbose
85
+ git add .
86
+ orc commit
87
+ ```
210
88
 
211
- # Use specific AI provider (OpenAI instead of default)
212
- orc commit --provider openai --clear-cache
89
+ That’s it.
213
90
 
214
- # Large codebase optimization
215
- orc commit --max-files 10 --no-cache --ignore-generated
216
- ```
91
+ ---
217
92
 
218
- ### `orc config`
219
- Manage configuration settings and customize AI behavior.
93
+ ## 🛠 Common Commands
220
94
 
221
- **Subcommands:**
222
95
  ```bash
223
- # Set API key for AI providers
224
- orc config set openrouter sk-your-key-here
225
- orc config set openai sk-your-openai-key
96
+ orc commit # interactive commit
97
+ orc commit --yes # auto-confirm
98
+ orc commit --context "..." # extra context
99
+ orc commit --emoji # gitmoji
100
+ orc commit --breaking # breaking change
101
+ orc commit --dry-run # preview only
102
+ ```
226
103
 
227
- # Set default AI model
228
- orc config model openrouter anthropic/claude-3-haiku:beta
229
- orc config model openrouter openai/gpt-4-turbo
230
- orc config model openai gpt-4
104
+ 👉 Full CLI reference: `docs/cli.md`
231
105
 
232
- # Custom prompts (NEW) - persist across sessions
233
- orc config prompt "Generate concise commit messages following our team standards"
234
- orc config prompt # Clear custom prompt (revert to default)
106
+ ---
235
107
 
236
- # View configuration
237
- orc config get
238
- orc config get openrouter
108
+ ## 🔐 Security Highlights
239
109
 
240
- # Show config file path
241
- orc config path
242
- ```
110
+ ORCommit includes **mandatory security checks**:
243
111
 
244
- ### `orc cache`
245
- Manage intelligent caching system.
112
+ * 🔍 Secret scanning via **Gitleaks**
113
+ * 🚫 Blocks API keys, tokens, private keys
114
+ * 🚫 Prevents committing dependency folders
246
115
 
247
- ```bash
248
- # Show cache statistics
249
- orc cache stats
116
+ These checks run **before** commit creation and cannot be bypassed accidentally.
250
117
 
251
- # Clear all cached data
252
- orc cache clear
118
+ 👉 Details: `docs/security.md`
253
119
 
254
- # Clean up expired entries
255
- orc cache cleanup
256
- ```
120
+ ---
257
121
 
258
- ### `orc test`
259
- Test API connection for configured providers.
122
+ ## 💡 Who Is ORCommit For?
260
123
 
261
- ```bash
262
- # Test default provider
263
- orc test
124
+ * **Teams** — enforce commit standards automatically
125
+ * **Open Source** — keep contribution quality high
126
+ * **Enterprise** — prevent leaks and ensure compliance
264
127
 
265
- # Test specific provider
266
- orc test openrouter
267
- orc test openai
268
- ```
128
+ ---
269
129
 
270
130
  ## ⚙️ Configuration
271
131
 
272
- Configuration is stored in `~/.config/orcommit.json` with secure 600 permissions.
273
-
274
- ### Default Configuration
132
+ Config is stored at `~/.config/orcommit.json` (permissions `600`).
275
133
 
276
134
  ```json
277
135
  {
278
- "providers": {
279
- "openrouter": {
280
- "baseUrl": "https://openrouter.ai/api/v1",
281
- "timeout": 60000
282
- },
283
- "openai": {
284
- "baseUrl": "https://api.openai.com/v1",
285
- "timeout": 60000
286
- }
287
- },
288
136
  "preferences": {
289
137
  "defaultProvider": "openrouter",
290
- "maxTokens": 500,
291
- "temperature": 0.6,
292
- "autoConfirm": false,
293
- "language": "en",
294
- "commitFormat": "conventional"
138
+ "commitFormat": "conventional",
139
+ "temperature": 0.6
295
140
  }
296
141
  }
297
142
  ```
298
143
 
299
- ### Supported Commit Types
300
-
301
- When using `--type` option, these conventional commit types are supported:
302
-
303
- - `feat` - New features
304
- - `fix` - Bug fixes
305
- - `docs` - Documentation changes
306
- - `style` - Code style changes (formatting, etc.)
307
- - `refactor` - Code refactoring
308
- - `test` - Adding or updating tests
309
- - `chore` - Maintenance tasks
310
- - `perf` - Performance improvements
311
- - `ci` - CI/CD changes
312
- - `build` - Build system changes
313
- - `revert` - Reverting previous commits
314
-
315
- ## 💡 Use Cases - Who Benefits from ORCommit?
316
-
317
- ### 👨‍💻 **Individual Developers**
318
- - Save time writing commit messages
319
- - Maintain consistent commit history
320
- - Learn best practices from AI-generated messages
321
- - Never forget to document important changes
322
-
323
- ### 👥 **Development Teams**
324
- - Enforce team commit message standards with custom prompts
325
- - Ensure conventional commits compliance
326
- - Improve code review efficiency
327
- - Track changes across large codebases
328
-
329
- ### 🏢 **Enterprise & Agencies**
330
- - Maintain corporate coding standards
331
- - Audit trail for compliance
332
- - Multi-language project support
333
- - Integration with existing git workflows
334
-
335
- ### 🎓 **Students & Learning**
336
- - Learn git best practices
337
- - Understand what makes a good commit message
338
- - Practice conventional commits format
339
- - Build portfolio with professional commits
340
-
341
- ### 🚀 **Open Source Projects**
342
- - Maintain consistent contribution quality
343
- - Help new contributors write better commits
344
- - Save maintainer time on commit message reviews
345
- - Support for multiple languages and formats
346
-
347
- ## 🏗 Architecture & Technology Stack
348
-
349
- Built with modern TypeScript and cutting-edge AI technology:
350
-
351
- ### Core Modules
352
-
353
- - **CLI Module**: Command-line interface using Commander.js with @clack/prompts
354
- - **Config Module**: Secure configuration management with file permissions (600)
355
- - **Git Module**: Advanced Git repository interaction with intelligent diff parsing
356
- - **API Module**: Robust HTTP client with exponential backoff and concurrency control
357
- - **Logger Module**: Elegant progress indicators with timing and structured output
358
- - **Tokenizer Module**: Token-aware chunking using tiktoken for accurate processing
359
- - **Cache Module**: Two-level caching (memory + disk) with TTL and cleanup
360
- - **Diff Filter Module**: Smart filtering of generated files and irrelevant changes
361
- - **Core Orchestrator**: Main coordination with phase-based processing
362
-
363
- ### Key Features
364
-
365
- - **Token-Based Chunking**: Uses tiktoken to respect actual model token limits
366
- - **Intelligent Caching**: Memory + disk caching with automatic cleanup and TTL
367
- - **Smart Filtering**: Automatically filters out generated files, lock files, and whitespace-only changes
368
- - **Interactive Push**: Prompts user for push with automatic upstream configuration
369
- - **Elegant UI**: Phase-based progress with emojis, timing, and structured output
370
- - **Robust Error Handling**: Comprehensive error types with timeout protection
371
- - **Type Safety**: Full TypeScript coverage with strict mode enabled
372
- - **Production Ready**: Extensive test suite with unit and integration tests
373
-
374
- ## 🔧 Advanced Usage
375
-
376
- ### Environment Variables
377
-
378
- You can set API keys via environment variables:
379
-
380
- ```bash
381
- export OPENROUTER_API_KEY="your-key-here"
382
- export OPENAI_API_KEY="your-openai-key"
383
- ```
384
-
385
- ### Smart File Processing
386
-
387
- The tool intelligently processes large codebases:
388
-
389
- **Token-Aware Chunking:**
390
- - Uses tiktoken for accurate token counting
391
- - Respects model-specific token limits (GPT-4: 8K, Claude: 100K)
392
- - Preserves context at logical boundaries (files, functions)
393
- - Dynamic chunk sizing based on available tokens
394
-
395
- **Intelligent Filtering:**
396
- - Auto-detects and skips generated files (dist/, build/, .lock files)
397
- - Filters out whitespace-only changes
398
- - Relevancy scoring to focus on meaningful changes
399
- - Configurable file size limits (default: 1MB per file)
400
-
401
- **Performance:**
402
- - Memory + disk caching for instant repeated requests
403
- - Concurrent API processing (up to 3 parallel requests)
404
- - Exponential backoff for rate limit handling
405
-
406
- ### Custom Models
407
-
408
- Configure specific models for each provider:
409
-
410
- ```bash
411
- # ORCommit models
412
- orc config model openrouter anthropic/claude-3-haiku:beta
413
- orc config model openrouter openai/gpt-4-turbo-preview
414
-
415
- # OpenAI models
416
- orc config model openai gpt-4
417
- orc config model openai gpt-3.5-turbo
418
- ```
419
-
420
- ### Interactive Experience
421
-
422
- **Elegant Progress Display:**
423
- ```
424
- 🔍 Analyzing changes...
425
- ✓ Found 15 staged files
426
- ✓ Ready to analyze 12 files
427
-
428
- 🤖 Generating commit message...
429
- ✓ Commit message generated (1.2s)
430
-
431
- 💾 Creating commit...
432
- ✓ Commit created
433
- ✓ Commit: feat(ui): add interactive push prompts
434
-
435
- Do you want to push to remote? › Yes
436
- 🚀 Pushing to remote...
437
- ✓ Pushed to main (2.1s)
438
- ✓ Changes pushed successfully
439
- ```
440
-
441
- **Smart Push Integration:**
442
- - Interactive prompts for push decisions
443
- - Automatic upstream branch setup
444
- - Support for multiple remotes
445
- - Graceful handling of push failures
446
-
447
- ## 🧪 Development
448
-
449
- ### Setup
450
-
451
- ```bash
452
- git clone <repository>
453
- cd orcommit
454
- npm install
455
- ```
456
-
457
- ### Available Scripts
458
-
459
- ```bash
460
- npm run build # Build TypeScript
461
- npm run dev # Run in development mode
462
- npm run test # Run tests
463
- npm run test:watch # Run tests in watch mode
464
- npm run lint # Run ESLint
465
- npm run format # Format code with Prettier
466
- ```
467
-
468
- ### Testing
469
-
470
- The project includes comprehensive tests:
471
-
472
- ```bash
473
- # Run all tests
474
- npm test
475
-
476
- # Run with coverage
477
- npm run test:coverage
478
-
479
- # Run specific test file
480
- npm test -- utils.test.ts
481
- ```
482
-
483
- ## 📋 Requirements
484
-
485
- - Node.js >= 16.0.0
486
- - Git repository
487
- - ORCommit or OpenAI API key
488
-
489
- ## 🔐 Security
490
-
491
- ### API Key Security
492
- - API keys are stored with 600 file permissions (owner read/write only)
493
- - No API keys are logged or exposed in error messages
494
- - Secure HTTP client with proper timeout and retry handling
495
-
496
- ### Secret Scanning Protection (NEW in v1.2.0)
497
-
498
- **ORCommit automatically scans all commits for secrets using the professional Gitleaks engine:**
499
-
500
- **Detects 100+ secret patterns including:**
501
- - ✅ AWS Access Keys & Secret Keys
502
- - ✅ GitHub Personal Access Tokens
503
- - ✅ OpenAI API Keys
504
- - ✅ Google Cloud API Keys
505
- - ✅ Stripe API Keys
506
- - ✅ Slack Tokens
507
- - ✅ Private Keys (RSA, SSH, EC, PGP)
508
- - ✅ Database Connection Strings
509
- - ✅ JWT Tokens
510
- - ✅ Generic API Keys & Secrets
511
-
512
- **Protection Features:**
513
- - ✅ **Automatic scanning** - runs on every commit before message generation
514
- - ✅ **Critical blocking** - dangerous secrets (AWS, GitHub, etc.) block commits immediately
515
- - ✅ **Warning prompts** - generic secrets show warnings and ask for confirmation
516
- - ✅ **Zero configuration** - works out of the box with sensible defaults
517
- - ✅ **Fast performance** - scans only staged changes (< 1s for typical commits)
518
-
519
- **Example of blocked commit:**
520
- ```bash
521
- $ git add src/config.ts
522
- $ orc commit
523
-
524
- 🔍 Analyzing changes...
525
- ⚠️ Scanning for secrets with Gitleaks...
526
-
527
- 🚨 BLOCKED: Secrets detected in staged files!
528
-
529
- Critical secrets found:
530
-
531
- src/config.ts:
532
- Line 42:15
533
- Detected a GitHub Personal Access Token, potentially giving access to repositories.
534
- Found: ghp_**********************qrst
535
- Rule: github-pat
536
-
537
- To fix this issue:
538
- 1. Remove secrets from code
539
- 2. Use environment variables instead
540
- 3. Add affected files to .gitignore
541
- 4. Create .gitleaksignore file to suppress false positives
542
-
543
- ✖ Commit blocked: Critical secrets detected
544
- ```
545
-
546
- **Bypass Options (use with caution!):**
144
+ Environment variables are also supported:
547
145
 
548
- **1. Skip scanning with CLI flag:**
549
146
  ```bash
550
- orc commit --no-secret-scan
147
+ export OPENROUTER_API_KEY="your-key"
148
+ export OPENAI_API_KEY="your-key"
551
149
  ```
552
150
 
553
- **2. Suppress specific false positives:**
554
-
555
- Create `.gitleaksignore` to ignore specific findings:
556
- ```
557
- # .gitleaksignore
558
- test-fixtures/fake-key.js:1
559
- docs/examples/api-example.ts:*
560
- *.test.ts:*
561
- ```
562
-
563
- **Technical Details:**
564
- - Powered by [Gitleaks](https://github.com/gitleaks/gitleaks) v8.27+
565
- - Binary auto-downloaded on first run (~15MB, cached)
566
- - Scans only staged changes (not entire repository)
567
- - If Gitleaks unavailable, scanning skipped with warning
568
-
569
- ### Dependency Directory Protection (NEW in v1.1.6)
570
-
571
- **ORCommit automatically blocks commits containing dependency directories:**
572
-
573
- - `node_modules/` - npm/yarn/pnpm dependencies
574
- - `vendor/` - Composer/Go dependencies
575
- - `bower_components/` - Bower dependencies
576
- - `.pnpm/` - pnpm store
577
-
578
- **This protection:**
579
- - ✅ **Always active** - cannot be disabled even with `--yes` flag
580
- - ✅ **Prevents repository bloat** - saves gigabytes of space
581
- - ✅ **Avoids merge conflicts** - keeps your team's git history clean
582
- - ✅ **Follows best practices** - dependencies should never be committed
583
-
584
- **Example of blocked commit:**
585
- ```bash
586
- $ git add .
587
- $ orc commit
588
-
589
- 🚨 BLOCKED: Cannot commit dependency directories
590
-
591
- The following were detected in staging area:
592
- • node_modules directory detected
593
-
594
- To fix this issue:
595
- 1. Unstage unwanted files: git reset HEAD node_modules/
596
- 2. Update your .gitignore file
597
- 3. Stage only the files you want to commit
598
- ```
599
-
600
- **Why this matters:**
601
- Accidentally committing `node_modules/` is one of the most common Git mistakes. It can:
602
- - Increase repository size by gigabytes
603
- - Cause merge conflicts in team environments
604
- - Slow down git operations significantly
605
- - Expose outdated or vulnerable dependencies
606
- - Violate industry best practices
607
-
608
- **Recommended .gitignore:**
609
- ```gitignore
610
- # Dependencies
611
- node_modules/
612
- .pnpm/
613
- bower_components/
614
- vendor/
615
-
616
- # Build outputs
617
- dist/
618
- build/
619
- .next/
620
- .nuxt/
621
- ```
622
-
623
- ## 🐛 Troubleshooting
624
-
625
- ### Common Issues
626
-
627
- **"🚨 BLOCKED: Secrets detected in staged files!"** (NEW in v1.2.0)
628
- - This is a security feature powered by Gitleaks
629
- - **Solution 1:** Remove the secret from your code and use environment variables
630
- - **Solution 2:** If it's a false positive, create `.gitleaksignore` file:
631
- ```
632
- # Format: file_path:line_number or file_path:*
633
- test-fixtures/example.js:42
634
- docs/api-example.ts:*
635
- ```
636
- - **Solution 3:** Skip secret scanning (not recommended!):
637
- ```bash
638
- orc commit --no-secret-scan
639
- ```
640
- - **Solution 4:** Verify if the detected pattern is actually a secret
641
- - **Note:** Critical secrets (AWS, GitHub, etc.) always block commits (by design)
642
- - **Why:** Prevents accidental exposure of credentials that could lead to security breaches
643
-
644
- **"🚨 BLOCKED: Cannot commit dependency directories"** (NEW in v1.1.6)
645
- - This is a safety feature, not an error
646
- - **Solution 1:** Unstage the directories: `git reset HEAD node_modules/ vendor/`
647
- - **Solution 2:** Add them to `.gitignore` and stage only source files
648
- - **Note:** This block cannot be overridden with `--yes` (by design)
649
- - **Why:** Committing dependencies is a common mistake that bloats repositories
650
-
651
- **"Not in a git repository"**
652
- - Ensure you're running the command inside a Git repository
653
-
654
- **"No staged changes found"**
655
- - Use `git add` to stage files before generating commits
656
- - Check if files are in .gitignore
657
-
658
- **"API key not configured"**
659
- - Set your API key: `orc config set openrouter your-key`
660
- - Verify with: `orc config get`
661
-
662
- **"All changes were filtered out"**
663
- - Check if only generated files were changed
664
- - Try with `--ignore-generated=false` to include all files
665
- - Use `--verbose` to see what was filtered
666
-
667
- **"Operation timed out"**
668
- - Large repositories may take time - operations auto-timeout at 30s
669
- - Try with `--max-files 10` to limit scope
670
- - Check your internet connection and API key validity
671
-
672
- **"Push failed"**
673
- - Ensure you have push permissions to the repository
674
- - Check if upstream branch is configured: `git branch -vv`
675
- - Try manual push first: `git push`
676
-
677
- ### Debug Mode
678
-
679
- Use verbose logging for detailed information:
151
+ ---
680
152
 
681
- ```bash
682
- orc commit --verbose
683
- ```
153
+ ## 📚 Documentation
684
154
 
685
- ## 📄 License
155
+ * CLI Reference → `docs/cli.md`
156
+ * Security Model → `docs/security.md`
157
+ * Architecture → `docs/architecture.md`
158
+ * Advanced Usage → `docs/advanced.md`
686
159
 
687
- MIT License - see [LICENSE](LICENSE) file for details.
160
+ ---
688
161
 
689
162
  ## 🤝 Contributing
690
163
 
691
164
  1. Fork the repository
692
165
  2. Create a feature branch
693
- 3. Make your changes
694
- 4. Add tests
695
- 5. Submit a pull request
696
-
697
- ## 📞 Support
698
-
699
- - GitHub Issues: [Report bugs or request features](https://github.com/markolofsen/openrouter-commit/issues)
700
- - Documentation: [Additional guides and examples](./docs/)
701
-
702
- ## 🙏 Acknowledgments
703
-
704
- - [OpenRouter](https://openrouter.ai/) for providing access to multiple AI models
705
- - [OpenAI](https://openai.com/) for their powerful language models
706
- - The open-source community for the excellent tools and libraries used in this project
166
+ 3. Add tests
167
+ 4. Submit a pull request
707
168
 
708
169
  ---
709
170
 
710
- ## 🏢 Built by Reforms.ai - AI SaaS Development Experts
711
-
712
- **ORCommit** is developed and maintained by **[Reforms.ai](https://reforms.ai)**, a leading AI SaaS development company specializing in cutting-edge AI-powered solutions for modern development workflows.
171
+ ## 🏢 About the Maintainers
713
172
 
714
- ### 🚀 About Reforms.ai
173
+ ORCommit is built and maintained by **[Reforms.ai](https://reforms.ai)** — a team specializing in AI-powered developer tools.
715
174
 
716
- Reforms.ai is a technology company focused on building innovative AI-powered tools and SaaS solutions that enhance developer productivity and streamline software development processes. Our mission is to make AI accessible and practical for developers worldwide.
175
+ Commercial support, consulting, and custom AI integrations are available.
717
176
 
718
- ### 🛠️ Our Solutions
719
-
720
- In addition to ORCommit, we develop:
721
-
722
- - **[Django CFG](https://github.com/markolofsen/django-cfg)** - Advanced configuration management for Django projects with environment-based settings, type safety, and validation
723
- - **AI-powered development tools** - Automation solutions for modern dev workflows
724
- - **Custom AI integrations** - Tailored AI solutions for enterprise clients
725
- - **SaaS platforms** - Scalable cloud-based applications with AI capabilities
726
-
727
- ### 🤝 Work With Us
728
-
729
- Reforms.ai offers:
730
- - **Custom AI Development** - Build AI-powered features for your products
731
- - **SaaS Consulting** - Architecture, scaling, and best practices
732
- - **AI Integration Services** - Integrate OpenAI, Claude, and other AI providers
733
- - **Developer Tools** - Open-source and commercial solutions for developers
734
-
735
- **Interested in AI-powered solutions for your business?**
736
- Visit [reforms.ai](https://reforms.ai) or contact us for custom development, consulting, or partnership opportunities.
737
-
738
- ### 🌟 Support Our Work
177
+ ---
739
178
 
740
- If you find ORCommit useful, consider:
741
- - ⭐ Starring the repository
742
- - 🐛 Reporting bugs and suggesting features
743
- - 💬 Sharing with other developers
744
- - 🤝 Contributing to the project
745
- - 💼 Hiring us for custom AI development
179
+ ## 📄 License
746
180
 
747
- **Connect with us:**
748
- - Website: [https://reforms.ai](https://reforms.ai)
749
- - GitHub: [@markolofsen](https://github.com/markolofsen)
750
- - Email: contact@reforms.ai
181
+ MIT License — see [LICENSE](LICENSE).
751
182
 
752
183
  ---
753
184
 
754
- **Built with ❤️ by [Reforms.ai](https://reforms.ai) using TypeScript, Commander.js, and cutting-edge AI technology.**
755
-
756
- *Empowering developers with intelligent automation since 2024.*
185
+ Built with ❤️ using TypeScript and modern AI tooling.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcommit",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "AI-powered commit message generator - Automated git commits using OpenAI, Claude, and OpenRouter APIs with intelligent diff processing, custom prompts, and interactive regeneration",
5
5
  "keywords": [
6
6
  "git",