@senoldogann/context-manager 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. package/README.md +8 -1
  2. package/bin/ccm.js +55 -1
  3. 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
- Run the indexer via `npx`:
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,61 @@ const fs = require('fs');
6
6
  const os = require('os');
7
7
  const https = require('https');
8
8
 
9
- const VERSION = '0.1.2';
9
+ const VERSION = '0.1.4';
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
+ if (os.platform() === 'darwin') {
16
+ configPaths.push(path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'));
17
+ configPaths.push(path.join(os.homedir(), '.gemini', 'antigravity', 'mcp_config.json'));
18
+ } else if (os.platform() === 'win32') {
19
+ configPaths.push(path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'));
20
+ }
21
+
22
+ const mcpConfig = {
23
+ "command": "npx",
24
+ "args": ["-y", "@senoldogann/context-manager", "mcp"],
25
+ "env": {
26
+ "RUST_LOG": "info"
27
+ }
28
+ };
29
+
30
+ let installedCount = 0;
31
+ for (const configPath of configPaths) {
32
+ const dir = path.dirname(configPath);
33
+ if (fs.existsSync(dir)) {
34
+ let config = { mcpServers: {} };
35
+ if (fs.existsSync(configPath)) {
36
+ try {
37
+ const content = fs.readFileSync(configPath, 'utf8');
38
+ config = JSON.parse(content);
39
+ // Backup
40
+ fs.copyFileSync(configPath, `${configPath}.bak`);
41
+ } catch (e) {
42
+ console.warn(`[CCM] Could not parse ${configPath}, creating backup and starting fresh section.`);
43
+ }
44
+ }
45
+
46
+ if (!config.mcpServers) config.mcpServers = {};
47
+ config.mcpServers["context-manager"] = mcpConfig;
48
+
49
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
50
+ console.log(`[CCM] ✓ Successfully updated: ${configPath}`);
51
+ installedCount++;
52
+ }
53
+ }
54
+
55
+ if (installedCount === 0) {
56
+ console.log("[CCM] No supported MCP config directories found.");
57
+ console.log("[CCM] Please add this to your mcp_config.json manually:");
58
+ console.log(JSON.stringify({ "context-manager": mcpConfig }, null, 2));
59
+ } else {
60
+ console.log("[CCM] Installation complete! Restart your AI editor to see the changes.");
61
+ }
62
+ }
63
+
13
64
  async function getBinary() {
14
65
  const platform = os.platform(); // darwin, linux, win32
15
66
  const arch = os.arch(); // x64, arm64
@@ -33,6 +84,9 @@ async function getBinary() {
33
84
  // Handle: npx @ccm/context-manager mcp
34
85
  commandName = 'ccm-mcp';
35
86
  process.argv.splice(2, 1); // Remove 'mcp' from args to be passed to binary
87
+ } else if (process.argv[2] === 'install') {
88
+ await installMcp();
89
+ process.exit(0);
36
90
  }
37
91
 
38
92
  const binFilename = `${commandName}-${target}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senoldogann/context-manager",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "LLM Context Manager MCP Server & CLI wrapper using npx",
5
5
  "main": "bin/ccm.js",
6
6
  "bin": {