carto-md 1.0.16 → 1.0.17
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 +1 -1
- package/package.json +1 -1
- package/src/cli/index.js +3 -0
- package/src/cli/remove.js +37 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/carto-md)
|
|
6
6
|
|
|
7
|
-
**Your code changes. AGENTS.md updates. Every AI always knows.**
|
|
7
|
+
**Maps your codebase so AI stops guessing. Your code changes. AGENTS.md updates. Every AI always knows.**
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g carto-md
|
package/package.json
CHANGED
package/src/cli/index.js
CHANGED
|
@@ -12,6 +12,7 @@ Commands:
|
|
|
12
12
|
watch Read .carto/config.json, start file watcher
|
|
13
13
|
sync Read .carto/config.json, run one sync, exit
|
|
14
14
|
impact <file> Show which files and routes are affected by changing a file
|
|
15
|
+
remove Remove AGENTS.md and .carto/ from this project
|
|
15
16
|
|
|
16
17
|
Options:
|
|
17
18
|
--help, -h Show this help message
|
|
@@ -46,6 +47,8 @@ if (command === 'init') {
|
|
|
46
47
|
} else if (command === 'impact') {
|
|
47
48
|
const fileArg = process.argv[3];
|
|
48
49
|
require('./impact').run(process.cwd(), fileArg);
|
|
50
|
+
} else if (command === 'remove') {
|
|
51
|
+
require('./remove').run(process.cwd());
|
|
49
52
|
} else {
|
|
50
53
|
console.error(`[CARTO] Unknown command: ${command}`);
|
|
51
54
|
printUsage();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
function run(projectRoot) {
|
|
5
|
+
const agentsPath = path.join(projectRoot, 'AGENTS.md');
|
|
6
|
+
const cartoDir = path.join(projectRoot, '.carto');
|
|
7
|
+
|
|
8
|
+
const agentsExists = fs.existsSync(agentsPath);
|
|
9
|
+
const cartoDirExists = fs.existsSync(cartoDir);
|
|
10
|
+
|
|
11
|
+
if (!agentsExists && !cartoDirExists) {
|
|
12
|
+
console.log('[CARTO] Nothing to remove — Carto is not initialized in this project.');
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (agentsExists) {
|
|
17
|
+
try {
|
|
18
|
+
fs.unlinkSync(agentsPath);
|
|
19
|
+
console.log('[CARTO] Removed AGENTS.md');
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error(`[CARTO] Failed to remove AGENTS.md: ${err.message}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (cartoDirExists) {
|
|
26
|
+
try {
|
|
27
|
+
fs.rmSync(cartoDir, { recursive: true, force: true });
|
|
28
|
+
console.log('[CARTO] Removed .carto/');
|
|
29
|
+
} catch (err) {
|
|
30
|
+
console.error(`[CARTO] Failed to remove .carto/: ${err.message}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log('[CARTO] Carto removed from this project.');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
module.exports = { run };
|