codemerge-cli 1.2.0 → 1.2.2

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 CHANGED
@@ -1,72 +1,893 @@
1
- # CodeMerge
2
-
3
- AI-focused code and data preparation utility.
4
-
5
- ## Bootstrap (Create New Project)
6
-
7
- To create a new CodeMerge project from scratch:
8
-
9
- ```bash
10
- # Using bootstrap script
11
- node bootstrap.js [target-directory] [--force]
12
-
13
- # Examples
14
- node bootstrap.js
15
- node bootstrap.js ./my-project
16
- node bootstrap.js . --force
17
- ```
18
-
19
- ## Installation
20
-
21
- ```bash
22
- npm install -g codemerge
23
- ```
24
-
25
- ## Quick Start
26
-
27
- ```bash
28
- # Merge current directory
29
- codemerge use
30
-
31
- # Merge specific directory
32
- codemerge use ./src
33
-
34
- # Custom output
35
- codemerge use --output ai-digest.txt
36
-
37
- # With filters
38
- codemerge use --ignore "*.log,*.test.ts"
39
- codemerge use --include "**/*.ts,**/*.js"
40
- ```
41
-
42
- ## Configuration
43
-
44
- Create `codemerge.json` in your project root:
45
-
46
- ```json
47
- {
48
- "outputPath": "ai-digest.txt",
49
- "ignorePatterns": ["node_modules/**", "dist/**"],
50
- "includePatterns": ["**/*.ts", "**/*.js"]
51
- }
52
- ```
53
-
54
- ## Development
55
-
56
- ```bash
57
- # Install dependencies
58
- npm install
59
-
60
- # Build
61
- npm run build
62
-
63
- # Development mode
64
- npm run dev
65
-
66
- # Run locally
67
- npm start use
68
- ```
69
-
70
- ## License
71
-
72
- MIT
1
+ # CodeMerge CLI
2
+
3
+ AI-focused code and data preparation utility. Merge multiple files into a single output optimized for AI context windows, with HTTP API for dynamic content generation.
4
+
5
+ ## 📋 Table of Contents
6
+
7
+ - [Overview](#overview)
8
+ - [Installation](#installation)
9
+ - [Quick Start](#quick-start)
10
+ - [Commands](#commands)
11
+ - [Configuration](#configuration)
12
+ - [HTTP Server & API](#http-server--api)
13
+ - [Use Cases](#use-cases)
14
+ - [Advanced Usage](#advanced-usage)
15
+ - [Troubleshooting](#troubleshooting)
16
+
17
+ ---
18
+
19
+ ## 🎯 Overview
20
+
21
+ CodeMerge is a CLI tool that:
22
+
23
+ - **Merges** multiple code files into a single, structured text file
24
+ - **Optimizes** output for AI tools (ChatGPT, Claude, etc.)
25
+ - **Respects** .gitignore patterns and custom ignore rules
26
+ - **Watches** for file changes and auto-regenerates
27
+ - **Serves** content via HTTP API for dynamic access
28
+ - **Provides** project structure visualization in JSON
29
+ - **Enables** selective file merging via API
30
+
31
+ Perfect for:
32
+ - Preparing codebases for AI analysis
33
+ - Generating context for code reviews
34
+ - Creating documentation snapshots
35
+ - Sharing project structure with AI assistants
36
+ - Building AI-powered developer tools
37
+
38
+ ---
39
+
40
+ ## 📦 Installation
41
+
42
+ ### Global Installation (Recommended)
43
+
44
+ ```bash
45
+ npm install -g codemerge-cli
46
+ ```
47
+
48
+ ### Local Project Installation
49
+
50
+ ```bash
51
+ npm install --save-dev codemerge-cli
52
+ ```
53
+
54
+ ### Requirements
55
+
56
+ - Node.js >= 16.0.0
57
+
58
+ ---
59
+
60
+ ## 🚀 Quick Start
61
+
62
+ ### 1. Initialize Project
63
+
64
+ ```bash
65
+ # Initialize in current directory
66
+ codemerge init
67
+
68
+ # Initialize in specific directory
69
+ codemerge init ./my-project
70
+
71
+ # Force overwrite existing config
72
+ codemerge init --force
73
+ ```
74
+
75
+ This creates:
76
+ - `codemerge.json` - Configuration file
77
+ - Updates `.gitignore` - Adds output file
78
+
79
+ ### 2. Merge Files
80
+
81
+ ```bash
82
+ # Merge current directory
83
+ codemerge use
84
+
85
+ # Merge specific directory
86
+ codemerge use ./src
87
+
88
+ # Custom output file
89
+ codemerge use --output my-code.txt
90
+
91
+ # Watch for changes
92
+ codemerge use --watch
93
+ ```
94
+
95
+ ### 3. Start HTTP Server
96
+
97
+ ```bash
98
+ # Start server on default port (9876)
99
+ codemerge watch
100
+
101
+ # Custom port
102
+ codemerge watch --port 3000
103
+
104
+ # Custom output and filters
105
+ codemerge watch --output api-code.txt --ignore "*.test.ts"
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 🎮 Commands
111
+
112
+ ### `codemerge init`
113
+
114
+ Initialize CodeMerge in a project.
115
+
116
+ ```bash
117
+ codemerge init [path] [options]
118
+ ```
119
+
120
+ **Arguments:**
121
+ - `path` - Target directory (default: `.`)
122
+
123
+ **Options:**
124
+ - `-f, --force` - Overwrite existing configuration
125
+
126
+ **What it does:**
127
+ - Creates `codemerge.json` with default settings
128
+ - Detects project name from `package.json`
129
+ - Adds output file to `.gitignore`
130
+ - Sets up recommended ignore patterns
131
+
132
+ **Example:**
133
+ ```bash
134
+ codemerge init ./backend --force
135
+ ```
136
+
137
+ ---
138
+
139
+ ### `codemerge use`
140
+
141
+ Merge code files into a single output.
142
+
143
+ ```bash
144
+ codemerge use [path] [options]
145
+ ```
146
+
147
+ **Arguments:**
148
+ - `path` - Input directory to scan (default: `.`)
149
+
150
+ **Options:**
151
+ - `-o, --output <path>` - Custom output file path
152
+ - `-w, --watch` - Watch for file changes
153
+ - `--ignore <patterns>` - Additional ignore patterns (comma-separated)
154
+ - `--include <patterns>` - Include patterns (comma-separated)
155
+
156
+ **Examples:**
157
+
158
+ ```bash
159
+ # Basic merge
160
+ codemerge use
161
+
162
+ # Merge src folder only
163
+ codemerge use ./src
164
+
165
+ # Custom output
166
+ codemerge use --output ai-context.txt
167
+
168
+ # Watch mode
169
+ codemerge use --watch
170
+
171
+ # Custom filters
172
+ codemerge use --ignore "*.test.ts,*.spec.js" --include "**/*.ts,**/*.js"
173
+
174
+ # Combine options
175
+ codemerge use ./src --output src-merged.txt --watch
176
+ ```
177
+
178
+ **Output Format:**
179
+
180
+ ```
181
+ # Code Merge Output
182
+ Generated at: 2026-01-07T01:02:50.588Z
183
+ Source path: .
184
+ Files processed: 21
185
+ Total lines: 1596
186
+ Total characters: 45777
187
+
188
+ File types:
189
+ - ts: 17 files (1442 lines)
190
+ - json: 2 files (80 lines)
191
+ - js: 1 files (2 lines)
192
+
193
+ Project structure & file index:
194
+ ./
195
+ lib/
196
+ - cli.ts (75 lines)
197
+ core/
198
+ - codeMerger.ts (273 lines)
199
+
200
+ ================================================================================
201
+
202
+ STARTOFFILE: lib/cli.ts
203
+ ----------------------------------------
204
+ [file content here]
205
+ ----------------------------------------
206
+ ENDOFFILE: lib/cli.ts
207
+ ```
208
+
209
+ ---
210
+
211
+ ### `codemerge watch`
212
+
213
+ Start HTTP server with file watching.
214
+
215
+ ```bash
216
+ codemerge watch [path] [options]
217
+ ```
218
+
219
+ **Arguments:**
220
+ - `path` - Input directory to scan (default: `.`)
221
+
222
+ **Options:**
223
+ - `-o, --output <path>` - Output file path
224
+ - `-p, --port <number>` - Server port (default: `9876`)
225
+ - `--ignore <patterns>` - Additional ignore patterns
226
+ - `--include <patterns>` - Include patterns
227
+
228
+ **Examples:**
229
+
230
+ ```bash
231
+ # Start server on default port
232
+ codemerge watch
233
+
234
+ # Custom port
235
+ codemerge watch --port 8080
236
+
237
+ # Watch specific directory
238
+ codemerge watch ./src --port 3000
239
+
240
+ # With filters
241
+ codemerge watch --ignore "*.test.ts" --include "**/*.ts,**/*.tsx"
242
+ ```
243
+
244
+ **Server Endpoints:**
245
+ - `GET /health` - Server health status
246
+ - `GET /content` - Full merged content
247
+ - `GET /structure` - Project structure JSON
248
+ - `POST /selective-content` - Merge selected files
249
+ - `POST /upsert` - Create/update files
250
+
251
+ See [HTTP Server & API](#http-server--api) for details.
252
+
253
+ ---
254
+
255
+ ### `codemerge help`
256
+
257
+ Display help information.
258
+
259
+ ```bash
260
+ codemerge help [command]
261
+ ```
262
+
263
+ **Examples:**
264
+
265
+ ```bash
266
+ # General help
267
+ codemerge help
268
+
269
+ # Command-specific help
270
+ codemerge help init
271
+ codemerge help use
272
+ codemerge help watch
273
+ ```
274
+
275
+ ---
276
+
277
+ ### `codemerge version`
278
+
279
+ Display version information.
280
+
281
+ ```bash
282
+ codemerge version
283
+ ```
284
+
285
+ ---
286
+
287
+ ## ⚙️ Configuration
288
+
289
+ ### Configuration File: `codemerge.json`
290
+
291
+ ```json
292
+ {
293
+ "projectName": "my-project",
294
+ "outputPath": "merged-output.txt",
295
+ "port": 9876,
296
+ "useGitignore": true,
297
+ "ignorePatterns": [
298
+ "node_modules/**",
299
+ ".git/**",
300
+ "dist/**",
301
+ "build/**",
302
+ "**/*.log",
303
+ "coverage/**"
304
+ ],
305
+ "includePatterns": [
306
+ "**/*.ts",
307
+ "**/*.js",
308
+ "**/*.tsx",
309
+ "**/*.jsx",
310
+ "**/*.json",
311
+ "**/*.md"
312
+ ]
313
+ }
314
+ ```
315
+
316
+ ### Configuration Options
317
+
318
+ | Option | Type | Default | Description |
319
+ |--------|------|---------|-------------|
320
+ | `projectName` | `string` | Auto-detected | Project name |
321
+ | `outputPath` | `string` | `merged-output.txt` | Output file path |
322
+ | `port` | `number` | `9876` | HTTP server port |
323
+ | `useGitignore` | `boolean` | `true` | Respect .gitignore rules |
324
+ | `ignorePatterns` | `string[]` | See below | Files/folders to ignore |
325
+ | `includePatterns` | `string[]` | See below | Files to include |
326
+
327
+ ### Default Ignore Patterns
328
+
329
+ ```javascript
330
+ [
331
+ 'node_modules/**',
332
+ '.git/**',
333
+ 'dist/**',
334
+ 'build/**',
335
+ 'coverage/**',
336
+ '**/*.log',
337
+ 'package-lock.json',
338
+ 'yarn.lock',
339
+ '.env',
340
+ '**/.DS_Store'
341
+ ]
342
+ ```
343
+
344
+ ### Default Include Patterns
345
+
346
+ ```javascript
347
+ [
348
+ '**/*.ts',
349
+ '**/*.js',
350
+ '**/*.tsx',
351
+ '**/*.jsx',
352
+ '**/*.json',
353
+ '**/*.md'
354
+ ]
355
+ ```
356
+
357
+ ### Alternative: package.json Configuration
358
+
359
+ You can also configure in `package.json`:
360
+
361
+ ```json
362
+ {
363
+ "name": "my-project",
364
+ "codemergeConfig": {
365
+ "outputPath": "ai-digest.txt",
366
+ "ignorePatterns": ["**/*.test.ts"],
367
+ "includePatterns": ["src/**/*.ts"]
368
+ }
369
+ }
370
+ ```
371
+
372
+ ---
373
+
374
+ ## 🌐 HTTP Server & API
375
+
376
+ ### Starting the Server
377
+
378
+ ```bash
379
+ codemerge watch --port 9876
380
+ ```
381
+
382
+ ### API Endpoints
383
+
384
+ #### 1. Health Check
385
+
386
+ **GET** `/health`
387
+
388
+ Check server status.
389
+
390
+ **Response:**
391
+ ```json
392
+ {
393
+ "status": "ok",
394
+ "project": "my-project",
395
+ "endpoints": {
396
+ "merge": "/content",
397
+ "structure": "/structure",
398
+ "selectiveContent": "/selective-content",
399
+ "upsert": "/upsert",
400
+ "health": "/health"
401
+ },
402
+ "mergeReady": true
403
+ }
404
+ ```
405
+
406
+ **Example:**
407
+ ```bash
408
+ curl http://localhost:9876/health
409
+ ```
410
+
411
+ ---
412
+
413
+ #### 2. Get Merged Content
414
+
415
+ **GET** `/content`
416
+
417
+ Get full merged content of all files.
418
+
419
+ **Response:**
420
+ ```
421
+ # Code Merge Output
422
+ Generated at: 2026-01-07T01:02:50.588Z
423
+ ...
424
+ [merged content]
425
+ ```
426
+
427
+ **Example:**
428
+ ```bash
429
+ curl http://localhost:9876/content > output.txt
430
+ ```
431
+
432
+ ---
433
+
434
+ #### 3. Get Project Structure
435
+
436
+ **GET** `/structure`
437
+
438
+ Get project structure as JSON tree.
439
+
440
+ **Response:**
441
+ ```json
442
+ {
443
+ "root": {
444
+ "name": ".",
445
+ "type": "directory",
446
+ "path": ".",
447
+ "children": [
448
+ {
449
+ "name": "package.json",
450
+ "type": "file",
451
+ "path": "package.json",
452
+ "lines": 55
453
+ },
454
+ {
455
+ "name": "src",
456
+ "type": "directory",
457
+ "path": "src",
458
+ "children": [
459
+ {
460
+ "name": "index.ts",
461
+ "type": "file",
462
+ "path": "src/index.ts",
463
+ "lines": 120
464
+ }
465
+ ]
466
+ }
467
+ ]
468
+ },
469
+ "totalFiles": 21,
470
+ "totalDirectories": 8,
471
+ "fileTypes": {
472
+ "ts": 17,
473
+ "json": 2,
474
+ "js": 1,
475
+ "md": 1
476
+ }
477
+ }
478
+ ```
479
+
480
+ **Example:**
481
+ ```bash
482
+ curl http://localhost:9876/structure | jq
483
+ ```
484
+
485
+ **Frontend Integration:**
486
+ ```javascript
487
+ async function getProjectStructure() {
488
+ const response = await fetch('http://localhost:9876/structure');
489
+ const structure = await response.json();
490
+ return structure;
491
+ }
492
+ ```
493
+
494
+ ---
495
+
496
+ #### 4. Get Selective Content
497
+
498
+ **POST** `/selective-content`
499
+
500
+ Merge only selected files/folders.
501
+
502
+ **Request Body:**
503
+ ```json
504
+ {
505
+ "selectedPaths": [
506
+ "src/core/codeMerger.ts",
507
+ "src/types",
508
+ "package.json"
509
+ ]
510
+ }
511
+ ```
512
+
513
+ **Response:**
514
+ ```
515
+ # Code Merge Output
516
+ Generated at: 2026-01-07T01:02:50.588Z
517
+ Files processed: 5
518
+ ...
519
+ [merged content of selected files]
520
+ ```
521
+
522
+ **Example:**
523
+ ```bash
524
+ curl -X POST http://localhost:9876/selective-content \
525
+ -H "Content-Type: application/json" \
526
+ -d '{
527
+ "selectedPaths": [
528
+ "src/core",
529
+ "package.json"
530
+ ]
531
+ }' > selected-output.txt
532
+ ```
533
+
534
+ **Frontend Integration:**
535
+ ```javascript
536
+ async function getSelectiveContent(selectedPaths) {
537
+ const response = await fetch('http://localhost:9876/selective-content', {
538
+ method: 'POST',
539
+ headers: { 'Content-Type': 'application/json' },
540
+ body: JSON.stringify({ selectedPaths })
541
+ });
542
+ return await response.text();
543
+ }
544
+
545
+ // Usage
546
+ const content = await getSelectiveContent([
547
+ 'src/core/codeMerger.ts',
548
+ 'src/types'
549
+ ]);
550
+ ```
551
+
552
+ **Note:** When you select a folder, all files within it are automatically included.
553
+
554
+ ---
555
+
556
+ #### 5. Upsert Files
557
+
558
+ **POST** `/upsert`
559
+
560
+ Create or update files in the project.
561
+
562
+ **Request Body:**
563
+ ```json
564
+ {
565
+ "basePath": "./",
566
+ "files": [
567
+ {
568
+ "path": "src/new-file.ts",
569
+ "content": "export const hello = 'world';"
570
+ },
571
+ {
572
+ "path": "README.md",
573
+ "content": "# Updated content"
574
+ }
575
+ ]
576
+ }
577
+ ```
578
+
579
+ **Response:**
580
+ ```json
581
+ {
582
+ "success": true,
583
+ "filesProcessed": 2,
584
+ "errors": [],
585
+ "results": [
586
+ {
587
+ "path": "src/new-file.ts",
588
+ "action": "created",
589
+ "success": true
590
+ },
591
+ {
592
+ "path": "README.md",
593
+ "action": "updated",
594
+ "success": true
595
+ }
596
+ ]
597
+ }
598
+ ```
599
+
600
+ **Example:**
601
+ ```bash
602
+ curl -X POST http://localhost:9876/upsert \
603
+ -H "Content-Type: application/json" \
604
+ -d '{
605
+ "files": [
606
+ {
607
+ "path": "src/hello.ts",
608
+ "content": "console.log(\"Hello\");"
609
+ }
610
+ ]
611
+ }'
612
+ ```
613
+
614
+ ---
615
+
616
+ ## 💡 Use Cases
617
+
618
+ ### 1. AI Code Analysis
619
+
620
+ Prepare your entire codebase for AI analysis:
621
+
622
+ ```bash
623
+ # Generate merged file
624
+ codemerge use --output for-ai.txt
625
+
626
+ # Copy content and paste into ChatGPT/Claude
627
+ cat for-ai.txt | pbcopy # macOS
628
+ cat for-ai.txt | xclip # Linux
629
+ ```
630
+
631
+ ### 2. Code Review Context
632
+
633
+ Generate context for code reviews:
634
+
635
+ ```bash
636
+ # Merge only source files
637
+ codemerge use ./src --output review-context.txt --ignore "*.test.ts,*.spec.js"
638
+ ```
639
+
640
+ ### 3. Documentation Generation
641
+
642
+ Create documentation snapshots:
643
+
644
+ ```bash
645
+ # Include docs and source
646
+ codemerge use --include "**/*.md,**/*.ts" --output docs-snapshot.txt
647
+ ```
648
+
649
+ ### 4. AI-Powered Developer Tools
650
+
651
+ Build tools that need dynamic project access:
652
+
653
+ ```javascript
654
+ // Get project structure
655
+ const structure = await fetch('http://localhost:9876/structure').then(r => r.json());
656
+
657
+ // Let user select files in UI
658
+ const selectedPaths = userSelection;
659
+
660
+ // Get only selected content
661
+ const content = await fetch('http://localhost:9876/selective-content', {
662
+ method: 'POST',
663
+ headers: { 'Content-Type': 'application/json' },
664
+ body: JSON.stringify({ selectedPaths })
665
+ }).then(r => r.text());
666
+
667
+ // Send to AI
668
+ await sendToAI(content);
669
+ ```
670
+
671
+ ### 5. Continuous Context Updates
672
+
673
+ Watch mode for real-time updates:
674
+
675
+ ```bash
676
+ # Terminal 1: Watch and serve
677
+ codemerge watch --port 3000
678
+
679
+ # Terminal 2: Your app constantly fetches latest
680
+ while true; do
681
+ curl http://localhost:3000/content > latest.txt
682
+ sleep 5
683
+ done
684
+ ```
685
+
686
+ ### 6. Multi-Project Monitoring
687
+
688
+ Monitor multiple projects:
689
+
690
+ ```bash
691
+ # Project 1
692
+ cd ~/project1 && codemerge watch --port 9001
693
+
694
+ # Project 2
695
+ cd ~/project2 && codemerge watch --port 9002
696
+
697
+ # Project 3
698
+ cd ~/project3 && codemerge watch --port 9003
699
+ ```
700
+
701
+ ---
702
+
703
+ ## 🔧 Advanced Usage
704
+
705
+ ### Custom Patterns
706
+
707
+ #### Include TypeScript Only
708
+ ```bash
709
+ codemerge use --include "**/*.ts,**/*.tsx"
710
+ ```
711
+
712
+ #### Exclude Tests and Configs
713
+ ```bash
714
+ codemerge use --ignore "**/*.test.ts,**/*.spec.js,**/*.config.js"
715
+ ```
716
+
717
+ #### Specific Directories
718
+ ```bash
719
+ codemerge use --include "src/**/*.ts,lib/**/*.ts"
720
+ ```
721
+
722
+ ### Combining Options
723
+
724
+ ```bash
725
+ codemerge use \
726
+ ./backend \
727
+ --output backend-code.txt \
728
+ --watch \
729
+ --ignore "**/*.test.ts,**/migrations/**" \
730
+ --include "**/*.ts,**/*.js"
731
+ ```
732
+
733
+ ### Environment-Specific Configs
734
+
735
+ Create multiple config files:
736
+
737
+ **codemerge.dev.json:**
738
+ ```json
739
+ {
740
+ "outputPath": "dev-merged.txt",
741
+ "includePatterns": ["**/*.ts", "**/*.tsx"]
742
+ }
743
+ ```
744
+
745
+ **codemerge.prod.json:**
746
+ ```json
747
+ {
748
+ "outputPath": "prod-merged.txt",
749
+ "ignorePatterns": ["**/*.test.ts", "**/*.dev.ts"]
750
+ }
751
+ ```
752
+
753
+ Use with symbolic links:
754
+ ```bash
755
+ ln -sf codemerge.dev.json codemerge.json
756
+ codemerge use
757
+ ```
758
+
759
+ ### Scripting
760
+
761
+ **package.json:**
762
+ ```json
763
+ {
764
+ "scripts": {
765
+ "merge": "codemerge use",
766
+ "merge:watch": "codemerge use --watch",
767
+ "serve": "codemerge watch --port 3000",
768
+ "merge:src": "codemerge use ./src --output src-only.txt"
769
+ }
770
+ }
771
+ ```
772
+
773
+ ```bash
774
+ npm run merge
775
+ npm run serve
776
+ ```
777
+
778
+ ### CI/CD Integration
779
+
780
+ **GitHub Actions:**
781
+ ```yaml
782
+ - name: Generate Code Context
783
+ run: |
784
+ npm install -g codemerge-cli
785
+ codemerge use --output code-context.txt
786
+
787
+ - name: Upload Artifact
788
+ uses: actions/upload-artifact@v2
789
+ with:
790
+ name: code-context
791
+ path: code-context.txt
792
+ ```
793
+
794
+ ---
795
+
796
+ ## 🐛 Troubleshooting
797
+
798
+ ### Port Already in Use
799
+
800
+ ```
801
+ Error: Port 9876 is already in use
802
+ ```
803
+
804
+ **Solution:**
805
+ ```bash
806
+ # Use different port
807
+ codemerge watch --port 8080
808
+
809
+ # Or find and kill the process
810
+ lsof -ti:9876 | xargs kill -9
811
+ ```
812
+
813
+ ### Large Output Files
814
+
815
+ If output is too large:
816
+
817
+ ```bash
818
+ # Limit to specific directories
819
+ codemerge use ./src ./lib
820
+
821
+ # Exclude verbose files
822
+ codemerge use --ignore "**/*.json,**/*.lock,**/*.min.js"
823
+
824
+ # Include only specific types
825
+ codemerge use --include "**/*.ts"
826
+ ```
827
+
828
+ ### Files Not Being Merged
829
+
830
+ **Check .gitignore:**
831
+ ```bash
832
+ # Disable gitignore checking
833
+ # Edit codemerge.json:
834
+ {
835
+ "useGitignore": false
836
+ }
837
+ ```
838
+
839
+ **Check patterns:**
840
+ ```bash
841
+ # Add debug logging (in code)
842
+ console.log('Include patterns:', includePatterns);
843
+ console.log('Ignore patterns:', ignorePatterns);
844
+ ```
845
+
846
+ ### Watch Not Detecting Changes
847
+
848
+ **Increase delay:**
849
+ Edit `codemerge.json`:
850
+ ```json
851
+ {
852
+ "watchDelay": 3000
853
+ }
854
+ ```
855
+
856
+ **Check file permissions:**
857
+ ```bash
858
+ ls -la | grep codemerge
859
+ ```
860
+
861
+ ### Binary Files in Output
862
+
863
+ Binary files are automatically excluded. If you see them:
864
+
865
+ ```bash
866
+ # Explicitly ignore
867
+ codemerge use --ignore "**/*.png,**/*.jpg,**/*.pdf"
868
+ ```
869
+
870
+ ---
871
+
872
+ ## 📚 Additional Resources
873
+
874
+ - **GitHub:** [github.com/odutradev/codemerge-cli](https://github.com/odutradev/codemerge-cli)
875
+ - **Issues:** [Report bugs](https://github.com/odutradev/codemerge-cli/issues)
876
+ - **NPM:** [npmjs.com/package/codemerge-cli](https://www.npmjs.com/package/codemerge-cli)
877
+
878
+ ---
879
+
880
+ ## 📝 License
881
+
882
+ MIT License - feel free to use in your projects!
883
+
884
+ ---
885
+
886
+ ## 🤝 Contributing
887
+
888
+ Contributions welcome! Please:
889
+
890
+ 1. Fork the repository
891
+ 2. Create a feature branch
892
+ 3. Make your changes
893
+ 4. Submit a pull request