@senoldogann/context-manager 0.1.3 → 0.1.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 +8 -1
- package/bin/ccm.js +69 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,14 @@ This is the Node.js wrapper for the **Cognitive Codebase Matrix (CCM)**. It allo
|
|
|
6
6
|
|
|
7
7
|
## 🚀 Quick Start
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### 1. Auto-Configure your Editor
|
|
10
|
+
The easiest way to get started. This will automatically add CCM to your Claude or Antigravity configuration:
|
|
11
|
+
```bash
|
|
12
|
+
npx @senoldogann/context-manager install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Index your Project
|
|
16
|
+
Run the indexer in your project root:
|
|
10
17
|
```bash
|
|
11
18
|
npx @senoldogann/context-manager index --path .
|
|
12
19
|
```
|
package/bin/ccm.js
CHANGED
|
@@ -6,10 +6,75 @@ const fs = require('fs');
|
|
|
6
6
|
const os = require('os');
|
|
7
7
|
const https = require('https');
|
|
8
8
|
|
|
9
|
-
const VERSION = '0.1.
|
|
9
|
+
const VERSION = '0.1.5';
|
|
10
10
|
const REPO = 'senoldogann/LLM-Context-Manager';
|
|
11
11
|
const BIN_DIR = path.join(os.homedir(), '.ccm', 'bin');
|
|
12
12
|
|
|
13
|
+
async function installMcp() {
|
|
14
|
+
const configPaths = [];
|
|
15
|
+
const home = os.homedir();
|
|
16
|
+
|
|
17
|
+
if (os.platform() === 'darwin') {
|
|
18
|
+
// MacOS Paths
|
|
19
|
+
configPaths.push(path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'));
|
|
20
|
+
configPaths.push(path.join(home, '.gemini', 'antigravity', 'mcp_config.json'));
|
|
21
|
+
// VS Code Extensions (Cline & Roo Code)
|
|
22
|
+
configPaths.push(path.join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'));
|
|
23
|
+
configPaths.push(path.join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'));
|
|
24
|
+
} else if (os.platform() === 'win32') {
|
|
25
|
+
// Windows Paths
|
|
26
|
+
const appData = process.env.APPDATA || '';
|
|
27
|
+
configPaths.push(path.join(appData, 'Claude', 'claude_desktop_config.json'));
|
|
28
|
+
// VS Code Extensions on Windows
|
|
29
|
+
configPaths.push(path.join(process.env.USERPROFILE || '', 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'));
|
|
30
|
+
} else if (os.platform() === 'linux') {
|
|
31
|
+
// Linux Paths
|
|
32
|
+
configPaths.push(path.join(home, '.config', 'Claude', 'claude_desktop_config.json'));
|
|
33
|
+
configPaths.push(path.join(home, '.config', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const mcpConfig = {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "@senoldogann/context-manager", "mcp"],
|
|
39
|
+
"env": {
|
|
40
|
+
"RUST_LOG": "info"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
let installedCount = 0;
|
|
45
|
+
for (const configPath of configPaths) {
|
|
46
|
+
const dir = path.dirname(configPath);
|
|
47
|
+
if (fs.existsSync(dir)) {
|
|
48
|
+
let config = { mcpServers: {} };
|
|
49
|
+
if (fs.existsSync(configPath)) {
|
|
50
|
+
try {
|
|
51
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
52
|
+
config = JSON.parse(content);
|
|
53
|
+
// Backup
|
|
54
|
+
fs.copyFileSync(configPath, `${configPath}.bak`);
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.warn(`[CCM] Could not parse ${configPath}, creating backup and starting fresh section.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
61
|
+
config.mcpServers["context-manager"] = mcpConfig;
|
|
62
|
+
|
|
63
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
64
|
+
console.log(`[CCM] ✓ Successfully updated: ${configPath}`);
|
|
65
|
+
installedCount++;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (installedCount === 0) {
|
|
70
|
+
console.log("[CCM] No supported MCP config directories found.");
|
|
71
|
+
console.log("[CCM] Please add this to your mcp_config.json manually:");
|
|
72
|
+
console.log(JSON.stringify({ "context-manager": mcpConfig }, null, 2));
|
|
73
|
+
} else {
|
|
74
|
+
console.log("[CCM] Installation complete! Restart your AI editor to see the changes.");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
13
78
|
async function getBinary() {
|
|
14
79
|
const platform = os.platform(); // darwin, linux, win32
|
|
15
80
|
const arch = os.arch(); // x64, arm64
|
|
@@ -33,6 +98,9 @@ async function getBinary() {
|
|
|
33
98
|
// Handle: npx @ccm/context-manager mcp
|
|
34
99
|
commandName = 'ccm-mcp';
|
|
35
100
|
process.argv.splice(2, 1); // Remove 'mcp' from args to be passed to binary
|
|
101
|
+
} else if (process.argv[2] === 'install') {
|
|
102
|
+
await installMcp();
|
|
103
|
+
process.exit(0);
|
|
36
104
|
}
|
|
37
105
|
|
|
38
106
|
const binFilename = `${commandName}-${target}`;
|