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 CHANGED
@@ -4,7 +4,7 @@
4
4
  [![MIT License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
5
5
  [![npm downloads](https://img.shields.io/npm/dm/carto-md)](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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carto-md",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "The context layer for AI-native development.",
5
5
  "bin": {
6
6
  "carto": "src/cli/index.js"
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 };