repomeld 3.0.4 โ†’ 3.0.5

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,32 +1,78 @@
1
1
  # repomeld ๐Ÿ”ฅ
2
2
 
3
- > Meld your entire repo into a single file โ€” perfect for AI context, code reviews & sharing.
3
+ > Turn your entire codebase into a single AI-ready file โ€” in seconds.
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/repomeld.svg)](https://www.npmjs.com/package/repomeld)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
+ Works with:
9
+
10
+ | ChatGPT | Claude | Gemini | Cursor | Windsurf |
11
+ |---------|--------|--------|--------|----------|
12
+ | โœ… | โœ… | โœ… | โœ… | โœ… |
13
+
8
14
  ---
9
15
 
10
- > ## ๐Ÿ’ผ Open to Work
11
- > **The author is available for freelance & full-time work.**
12
- > ๐Ÿ“ง [susheelhbti@gmail.com](mailto:susheelhbti@gmail.com) โ€” reach out anytime!
16
+ ## The Problem
17
+
18
+ AI tools are powerful โ€” but they struggle with large repositories.
19
+
20
+ Copying files manually is:
21
+ - **Slow** โ€” jumping between files, copy-pasting one by one
22
+ - **Error-prone** โ€” missing imports, missing context, wrong versions
23
+ - **Incomplete** โ€” AI sees fragments, not the full picture
24
+
25
+ The result? Vague suggestions. Wrong answers. Wasted time.
13
26
 
14
27
  ---
15
28
 
16
- ## โœจ Features
29
+ ## The Solution
17
30
 
18
- - ๐Ÿš€ **Fast & Efficient** - Async scanning with real-time progress and binary caching
19
- - ๐ŸŽจ **Multiple Styles** - Banner, Markdown, or Minimal output
20
- - ๐Ÿ” **Smart Filtering** - Extension, pattern, and size-based filtering
21
- - ๐Ÿ“ **Gitignore Support** - Respects your .gitignore rules automatically
22
- - ๐Ÿ’พ **Binary Detection** - Intelligent caching for binary file detection
23
- - ๐Ÿ“ฆ **Single File Output** - Perfect for AI context windows
24
- - ๐Ÿ”„ **Auto-Numbering** - Never overwrites existing files
25
- - ๐Ÿ’ฟ **Zip Backup** - Creates auto-numbered backups in `repomeld_zips/` folder
26
- - ๐Ÿ”” **Update Notifications** - Non-intrusive version checking
27
- - ๐ŸŽฏ **Force Include** - Override ignore rules when needed
28
- - ๐Ÿ“Š **Dependency Graph** - Optional Mermaid diagram of file dependencies
29
- - ๐ŸŒ **Cross-Platform** - Works perfectly on Windows, macOS, and Linux
31
+ ```bash
32
+ npx repomeld
33
+ ```
34
+
35
+ repomeld scans your entire repository and produces a single, clean, AI-ready document containing:
36
+
37
+ โœ… Project structure
38
+ โœ… All source code
39
+ โœ… Dependencies and config
40
+ โœ… Optional Mermaid dependency diagrams
41
+ โœ… Clean context โ€” nothing AI doesn't need
42
+
43
+ One file. Paste it. Ask anything.
44
+
45
+ ---
46
+
47
+ ## Demo
48
+
49
+ ```bash
50
+ npx repomeld --style markdown --output context.md
51
+ ```
52
+
53
+ Upload `context.md` to ChatGPT, Claude, or Gemini and ask:
54
+
55
+ > *"Review my project and suggest improvements."*
56
+
57
+ Or drop it into Cursor / Windsurf as project context before starting a session.
58
+
59
+ ---
60
+
61
+ ## Why repomeld Instead of repomix?
62
+
63
+ Many developers discover this category by searching for repomix. Here's how repomeld compares:
64
+
65
+ | Feature | repomeld | repomix |
66
+ |---|---|---|
67
+ | Auto-numbered outputs (never overwrites) | โœ… | โŒ |
68
+ | Automatic backup zip creation | โœ… | โŒ |
69
+ | `repoclean` โ€” one-command artifact cleanup | โœ… | โŒ |
70
+ | Mermaid dependency graph | โœ… | โŒ |
71
+ | Force include support | โœ… | โœ… |
72
+ | Multiple output styles (banner/markdown/minimal) | โœ… | โœ… |
73
+ | Gitignore support | โœ… | โœ… |
74
+ | Binary file detection + caching | โœ… | โœ… |
75
+ | Cross-platform (Windows, macOS, Linux) | โœ… | โœ… |
30
76
 
31
77
  ---
32
78
 
@@ -51,7 +97,25 @@ cd your-project
51
97
  repomeld
52
98
  ```
53
99
 
54
- That's it. repomeld walks your project, respects `.gitignore`, skips binary files, and writes everything into one readable file with optional dependency graphs.
100
+ repomeld walks your project, respects `.gitignore`, skips binary files, and writes everything into one readable file.
101
+
102
+ ---
103
+
104
+ ## โœจ Features
105
+
106
+ - ๐Ÿš€ **Fast & Efficient** - Async scanning with real-time progress and binary caching
107
+ - ๐ŸŽจ **Multiple Styles** - Banner, Markdown, or Minimal output
108
+ - ๐Ÿ” **Smart Filtering** - Extension, pattern, and size-based filtering
109
+ - ๐Ÿ“ **Gitignore Support** - Respects your .gitignore rules automatically
110
+ - ๐Ÿ’พ **Binary Detection** - Intelligent caching for binary file detection
111
+ - ๐Ÿ“ฆ **Single File Output** - Perfect for AI context windows
112
+ - ๐Ÿ”„ **Auto-Numbering** - Never overwrites existing files
113
+ - ๐Ÿ’ฟ **Zip Backup** - Creates auto-numbered backups in `repomeld_zips/` folder
114
+ - ๐Ÿ”” **Update Notifications** - Non-intrusive version checking
115
+ - ๐ŸŽฏ **Force Include** - Override ignore rules when needed
116
+ - ๐Ÿ“Š **Dependency Graph** - Optional Mermaid diagram of file dependencies
117
+ - ๐Ÿงน **repoclean** - One command to delete all repomeld-generated files and zips
118
+ - ๐ŸŒ **Cross-Platform** - Works perfectly on Windows, macOS, and Linux
55
119
 
56
120
  ---
57
121
 
@@ -256,7 +320,83 @@ The zip file contains:
256
320
  To disable backups: `repomeld --no-backup`
257
321
 
258
322
  ---
259
-
323
+
324
+ ## ๐Ÿงน repoclean โ€” Remove All repomeld Artifacts
325
+
326
+ After several runs, your project root can accumulate output files and zip backups. `repoclean` removes all of them in one command.
327
+
328
+ ```bash
329
+ repoclean
330
+ ```
331
+
332
+ It finds and deletes everything repomeld creates:
333
+
334
+ | What gets deleted | Examples |
335
+ |---|---|
336
+ | Output text files | `repomeld_output.txt`, `repomeld_output__2.txt`, ... |
337
+ | Custom-named outputs | `repomeld_myproject.txt` |
338
+ | Backup zip folder | `repomeld_zips/` (entire folder) |
339
+
340
+ ### repoclean Options
341
+
342
+ ```
343
+ Usage: repoclean [options]
344
+
345
+ Options:
346
+ -V, --version Show version number
347
+ -h, --help Show help
348
+ --dry-run Preview what would be deleted โ€” nothing is removed
349
+ -y, --yes Skip confirmation prompt (useful for scripts/CI)
350
+ -d, --dir <path> Clean a specific directory instead of cwd
351
+ ```
352
+
353
+ ### repoclean Examples
354
+
355
+ ```bash
356
+ # Interactive โ€” lists items and asks for confirmation
357
+ repoclean
358
+
359
+ # Preview only โ€” shows what would be deleted without removing anything
360
+ repoclean --dry-run
361
+
362
+ # Skip confirmation (for CI or scripts)
363
+ repoclean --yes
364
+
365
+ # Clean a specific directory
366
+ repoclean --dir /path/to/project
367
+
368
+ # Preview a different directory
369
+ repoclean --dry-run --dir ../other-project
370
+ ```
371
+
372
+ ### Typical repoclean session
373
+
374
+ ```
375
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
376
+ โ•‘ repoclean v3.1.0 โ•‘
377
+ โ•‘ Remove all repomeld-generated files ๐Ÿงน โ•‘
378
+ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
379
+ โ•‘ ๐Ÿ’ผ susheelhbti@gmail.com โ€” Open for work โ•‘
380
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
381
+
382
+ ๐Ÿ“‚ Target : /your/project
383
+
384
+ ๐Ÿ” Found 4 item(s) to remove:
385
+
386
+ ๐Ÿ“„ repomeld_output.txt
387
+ ๐Ÿ“„ repomeld_output__2.txt
388
+ ๐Ÿ“„ repomeld_output__3.txt
389
+ ๐Ÿ“ repomeld_zips\ (entire folder)
390
+
391
+ โš ๏ธ Delete all 4 item(s)? This cannot be undone. [y/N] y
392
+
393
+ โœจ repoclean complete!
394
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
395
+ โœ… Deleted : 4 item(s)
396
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
397
+ ```
398
+
399
+ ---
260
400
 
261
401
  ## Performance Optimizations
262
402
 
@@ -320,9 +460,13 @@ repomeld --include src --style markdown --output analysis.md
320
460
  # Then render the Mermaid graph in the output
321
461
  ```
322
462
 
323
- ---
324
-
463
+ ### ๐Ÿงน Clean Up After AI Sessions
464
+ ```bash
465
+ # After multiple repomeld runs, tidy up in one shot
466
+ repoclean
467
+ ```
325
468
 
469
+ ---
326
470
 
327
471
  ## Development
328
472
 
@@ -340,14 +484,12 @@ npm start -- --dry-run
340
484
  # Link for global testing
341
485
  npm link
342
486
  repomeld --help
487
+ repoclean --help
343
488
 
344
489
  # Run tests
345
490
  npm test
346
491
  ```
347
492
 
348
- ---
349
-
350
-
351
493
  ---
352
494
 
353
495
  ## Contributing
@@ -362,8 +504,6 @@ Contributions are welcome! Please feel free to submit a Pull Request.
362
504
 
363
505
  ---
364
506
 
365
-
366
-
367
507
  ## License
368
508
 
369
509
  MIT ยฉ [Susheel](mailto:susheelhbti@gmail.com)
@@ -378,11 +518,10 @@ MIT ยฉ [Susheel](mailto:susheelhbti@gmail.com)
378
518
 
379
519
  ---
380
520
 
381
- > ## ๐Ÿ’ผ Hire the Author
521
+ > ## ๐Ÿ’ผ Open to Work
382
522
  > Built by a developer available for **freelance and full-time opportunities**.
383
523
  > Got a project? Let's talk โ€” ๐Ÿ“ง **[susheelhbti@gmail.com](mailto:susheelhbti@gmail.com)**
384
524
 
385
525
  ---
386
-
387
-
388
- **Made with โค๏ธ for developers who need better context for AI tools**
526
+
527
+ **Made with โค๏ธ for developers who need better context for AI tools**
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require("path");
4
+ const readline = require("readline");
5
+ const { program } = require("commander");
6
+ const { findRepomeldArtifacts, deleteArtifacts } = require("../src/core/cleaner");
7
+ const { getVersion } = require("../src/utils/version");
8
+
9
+ const { version: VERSION } = getVersion();
10
+
11
+ function printBanner() {
12
+ console.log(`
13
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
14
+ โ•‘ repoclean v${VERSION} โ•‘
15
+ โ•‘ Remove all repomeld-generated files ๐Ÿงน โ•‘
16
+ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
17
+ โ•‘ ๐Ÿ’ผ susheelhbti@gmail.com โ€” Open for work โ•‘
18
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•`);
19
+ }
20
+
21
+ async function confirm(question) {
22
+ const rl = readline.createInterface({
23
+ input: process.stdin,
24
+ output: process.stdout,
25
+ });
26
+ return new Promise((resolve) => {
27
+ rl.question(question, (answer) => {
28
+ rl.close();
29
+ resolve(answer.trim().toLowerCase());
30
+ });
31
+ });
32
+ }
33
+
34
+ program
35
+ .name("repoclean")
36
+ .description("Delete all files and folders created by repomeld")
37
+ .version(VERSION)
38
+ .option("--dry-run", "Preview what would be deleted without actually deleting")
39
+ .option("-y, --yes", "Skip confirmation prompt and delete immediately")
40
+ .option("-d, --dir <path>", "Target directory to clean (defaults to cwd)")
41
+ .action(async (options) => {
42
+ printBanner();
43
+
44
+ const cwd = options.dir ? path.resolve(options.dir) : process.cwd();
45
+ console.log(`\n ๐Ÿ“‚ Target : ${cwd}\n`);
46
+
47
+ let artifacts;
48
+ try {
49
+ artifacts = await findRepomeldArtifacts(cwd);
50
+ } catch (err) {
51
+ console.error(`\nโŒ Error: ${err.message}`);
52
+ process.exit(1);
53
+ }
54
+
55
+ const total = artifacts.files.length + artifacts.dirs.length;
56
+
57
+ if (total === 0) {
58
+ console.log(" โœ… Nothing to clean โ€” no repomeld artifacts found.\n");
59
+ return;
60
+ }
61
+
62
+ // Show what was found
63
+ console.log(` ๐Ÿ” Found ${total} item(s) to remove:\n`);
64
+ for (const f of artifacts.files) {
65
+ console.log(` ๐Ÿ“„ ${path.relative(cwd, f)}`);
66
+ }
67
+ for (const d of artifacts.dirs) {
68
+ console.log(` ๐Ÿ“ ${path.relative(cwd, d)}${path.sep} (entire folder)`);
69
+ }
70
+ console.log();
71
+
72
+ if (options.dryRun) {
73
+ console.log(" ๐Ÿงช Dry run โ€” nothing was deleted.\n");
74
+ return;
75
+ }
76
+
77
+ // Confirm unless --yes supplied
78
+ if (!options.yes) {
79
+ const answer = await confirm(` โš ๏ธ Delete all ${total} item(s)? This cannot be undone. [y/N] `);
80
+ if (answer !== "y" && answer !== "yes") {
81
+ console.log("\n ๐Ÿšซ Aborted. Nothing was deleted.\n");
82
+ return;
83
+ }
84
+ }
85
+
86
+ const { deleted, failed } = await deleteArtifacts(artifacts, false);
87
+
88
+ console.log(`\n โœจ repoclean complete!`);
89
+ console.log(` โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€`);
90
+ console.log(` โœ… Deleted : ${deleted.length} item(s)`);
91
+ if (failed.length) {
92
+ console.log(` โŒ Failed : ${failed.length} item(s)`);
93
+ for (const f of failed) {
94
+ console.log(` โ€ข ${path.relative(cwd, f.path)} โ€” ${f.reason}`);
95
+ }
96
+ }
97
+ console.log(` โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n`);
98
+
99
+ if (failed.length) process.exit(1);
100
+ });
101
+
102
+ program.parse(process.argv);
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "repomeld",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Meld your entire repo into a single file โ€” perfect for AI context & code reviews",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
7
- "repomeld": "bin/cli.js"
7
+ "repomeld": "bin/cli.js",
8
+ "repoclean": "bin/repoclean.js"
8
9
  },
9
10
  "scripts": {
10
11
  "start": "node bin/cli.js",
@@ -0,0 +1,82 @@
1
+ const fs = require("fs").promises;
2
+ const fsSync = require("fs");
3
+ const path = require("path");
4
+
5
+ /**
6
+ * Finds all repomeld-generated files and folders in cwd.
7
+ *
8
+ * repomeld creates:
9
+ * - repomeld_output.txt
10
+ * - repomeld_output__2.txt, repomeld_output__3.txt, ... (any custom --output name too)
11
+ * - repomeld_zips/ (entire folder)
12
+ *
13
+ * The rule: anything whose name starts with "repomeld" (case-insensitive),
14
+ * which is exactly the same REPOMELD_PATTERN already used in fileScanner.js.
15
+ */
16
+ const REPOMELD_PATTERN = /^repomeld/i;
17
+
18
+ async function findRepomeldArtifacts(cwd) {
19
+ const files = [];
20
+ const dirs = [];
21
+
22
+ let entries;
23
+ try {
24
+ entries = await fs.readdir(cwd, { withFileTypes: true });
25
+ } catch (err) {
26
+ throw new Error(`Cannot read directory: ${err.message}`);
27
+ }
28
+
29
+ for (const entry of entries) {
30
+ if (!REPOMELD_PATTERN.test(entry.name)) continue;
31
+
32
+ const fullPath = path.join(cwd, entry.name);
33
+ if (entry.isDirectory()) {
34
+ dirs.push(fullPath);
35
+ } else if (entry.isFile()) {
36
+ files.push(fullPath);
37
+ }
38
+ }
39
+
40
+ return { files, dirs };
41
+ }
42
+
43
+ async function deleteArtifacts({ files, dirs }, dryRun) {
44
+ const deleted = [];
45
+ const failed = [];
46
+
47
+ for (const filePath of files) {
48
+ if (dryRun) {
49
+ deleted.push(filePath);
50
+ continue;
51
+ }
52
+ try {
53
+ await fs.unlink(filePath);
54
+ deleted.push(filePath);
55
+ } catch (err) {
56
+ failed.push({ path: filePath, reason: err.message });
57
+ }
58
+ }
59
+
60
+ for (const dirPath of dirs) {
61
+ if (dryRun) {
62
+ deleted.push(dirPath);
63
+ continue;
64
+ }
65
+ try {
66
+ await fs.rm(dirPath, { recursive: true, force: true });
67
+ deleted.push(dirPath);
68
+ } catch (err) {
69
+ // fs.rm may not exist on Node 14 โ€” fall back to rmdir recursive
70
+ try {
71
+ fsSync.rmdirSync(dirPath, { recursive: true });
72
+ deleted.push(dirPath);
73
+ } catch (err2) {
74
+ failed.push({ path: dirPath, reason: err2.message });
75
+ }
76
+ }
77
+ }
78
+
79
+ return { deleted, failed };
80
+ }
81
+
82
+ module.exports = { findRepomeldArtifacts, deleteArtifacts };