@codemap-ai/cli 0.1.5 → 0.1.8

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,6 +1,6 @@
1
1
  # @codemap-ai/cli
2
2
 
3
- AI-powered code intelligence and coding agent CLI. Provides an MCP server for code exploration, symbol analysis, and refactoring — plus an interactive chat agent powered by LLM gateways.
3
+ AI-powered coding agent CLI. Interactive chat agent powered by LLM gateways, with code exploration, symbol analysis, and refactoring capabilities.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -13,91 +13,6 @@ npm install -g @codemap-ai/cli
13
13
  codemap
14
14
  ```
15
15
 
16
- ## MCP Server Setup
17
-
18
- CodeMap runs as an MCP (Model Context Protocol) server that plugs into AI coding agents. Pick your editor:
19
-
20
- ### Claude Code
21
-
22
- ```bash
23
- claude mcp add codemap-mcp -- npx -y @codemap-ai/cli
24
- ```
25
-
26
- ### Cursor
27
-
28
- Create or edit `.cursor/mcp.json`:
29
-
30
- ```json
31
- {
32
- "mcpServers": {
33
- "codemap-mcp": {
34
- "command": "npx",
35
- "args": ["-y", "@codemap-ai/cli"]
36
- }
37
- }
38
- }
39
- ```
40
-
41
- Then restart Cursor.
42
-
43
- ### Codex
44
-
45
- Add to `~/.codex/config.toml`:
46
-
47
- ```toml
48
- [mcp_servers.codemap]
49
- command = "npx"
50
- args = ["-y", "@codemap-ai/cli"]
51
- ```
52
-
53
- ### Gemini CLI
54
-
55
- Edit `~/.gemini/settings.json`:
56
-
57
- ```json
58
- {
59
- "mcpServers": {
60
- "codemap-mcp": {
61
- "command": "npx",
62
- "args": ["-y", "@codemap-ai/cli"]
63
- }
64
- }
65
- }
66
- ```
67
-
68
- ### GitHub Copilot (VS Code)
69
-
70
- Create or edit `.vscode/mcp.json`:
71
-
72
- ```json
73
- {
74
- "servers": {
75
- "codemap-mcp": {
76
- "command": "npx",
77
- "args": ["-y", "@codemap-ai/cli"]
78
- }
79
- }
80
- }
81
- ```
82
-
83
- Then reload VS Code.
84
-
85
- ### OpenCode
86
-
87
- Edit `opencode.json` in your project root:
88
-
89
- ```json
90
- {
91
- "mcp": {
92
- "codemap-mcp": {
93
- "command": "npx",
94
- "args": ["-y", "@codemap-ai/cli"],
95
- "enabled": true
96
- }
97
- }
98
- }
99
- ```
100
-
101
16
  ## Authentication
102
17
 
103
18
  ```bash
@@ -112,49 +27,57 @@ codemap logout # Clear credentials
112
27
 
113
28
  ```bash
114
29
  codemap # Interactive chat (default)
30
+ codemap chat # Interactive chat (explicit)
115
31
  codemap ask "explain X" # Single prompt, exit
116
32
  codemap route "task" # Show which model handles a task
117
33
  codemap models # List available models
118
34
  codemap doctor # Diagnose gateway config
119
- codemap init-gateway # Create gateway config
35
+ codemap init-gateway # Create gateway config file (--project | --global)
36
+ # --base-url <url> Override gateway base URL
37
+ # --force Overwrite existing config
120
38
  ```
121
39
 
122
40
  ### Workspace
123
41
 
124
42
  ```bash
125
- codemap status # Git, index, auth, project status
126
- codemap local-index # Build/update local code index
127
- codemap local-index --force # Full rebuild
43
+ codemap status # Git, index, auth, project status
44
+ codemap local-index # Build/update local code index
45
+ --force # Full rebuild
46
+ --status # Show index info without rebuilding
128
47
  ```
129
48
 
130
49
  ### Agent Pack (Editor Integration)
131
50
 
132
51
  ```bash
133
- codemap init-agent-pack --target claude # Install rules for Claude Code
134
- codemap init-agent-pack --target all # Install for all supported editors
135
- codemap doctor-agent-pack # Check installation health
136
- codemap onboarding --target cursor # Print setup guide
52
+ codemap init-agent-pack # Install CodeMap agent rules into an editor
53
+ --target <editor> # claude | cursor | codex | gemini | opencode | copilot | all
54
+ --root <dir> # Workspace root (default: cwd)
55
+ --dry-run # Preview without writing
56
+
57
+ codemap doctor-agent-pack # Check agent pack installation health
58
+ --target <editor> # Editor to check (default: auto-detect)
59
+ --root <dir> # Workspace root
60
+
61
+ codemap agent-pack-path # Print the agent pack plugin root path
62
+
63
+ codemap clean-agent-pack-backups # Remove backup files left by upgrades
64
+ --root <dir> # Workspace root
65
+ --dry-run # Preview without deleting
66
+
67
+ codemap onboarding # Print setup guide for an editor
68
+ --target <editor> # claude | cursor | codex | gemini | opencode | copilot | all
137
69
  ```
138
70
 
139
- ## MCP Tools
140
-
141
- When running as an MCP server, CodeMap exposes these tools to your AI agent:
142
-
143
- | Tool | Description |
144
- |---|---|
145
- | `explore_task` | Broad task exploration returns likely files, entrypoints, symbols, risks |
146
- | `search_codebase` | Find files, symbols, exports by keyword or semantic query |
147
- | `get_file` | Read file with outline, symbol bodies, or blast radius analysis |
148
- | `symbol` | Inspect a symbol — context, usages, callers, similar |
149
- | `find_related_files` | Multi-signal ranking of files related to a query or file |
150
- | `get_project_map` | Browse file tree |
151
- | `get_project_insights` | Codebase health: orphans, cycles, top files by dependency |
152
- | `diff` | Git diff — working tree or between refs |
153
- | `move_symbols` | Move symbols between files, auto-update imports |
154
- | `rename_symbol` | Rename symbol codebase-wide |
155
- | `reimport` | Trigger cloud re-indexing |
156
- | `refresh_local_index` | Refresh local SQLite index |
157
- | `web_search` / `web_fetch` | Search and fetch web documentation |
71
+ ### Claude Code Hooks
72
+
73
+ These are called automatically by Claude Code hook config, not by hand:
74
+
75
+ ```bash
76
+ codemap session-hint # Emit index status hint on session start
77
+ codemap pre-edit # Emit blast radius hint before a file edit
78
+ codemap pre-read # Emit index hint before a file read
79
+ codemap pre-bash # Emit search hint before a bash command
80
+ ```
158
81
 
159
82
  ## Gateway Configuration
160
83
 
@@ -164,13 +87,16 @@ CodeMap uses an LLM gateway for chat and agent features. Configure via environme
164
87
  CODEMAP_LLM_GATEWAY_BASE_URL=http://localhost:4000/v1
165
88
  CODEMAP_LLM_GATEWAY_API_KEY=your-key
166
89
  CODEMAP_LLM_GATEWAY_DEFAULT_PROFILE=coder
90
+ CODEMAP_LLM_GATEWAY_CODER_MODEL=model-name
91
+ CODEMAP_LLM_GATEWAY_PLANNER_MODEL=model-name
92
+ CODEMAP_LLM_GATEWAY_REVIEWER_MODEL=model-name
167
93
  ```
168
94
 
169
95
  Or create a config file at `.codemap/llm-gateway.json` (project) or `~/.codemap/llm-gateway.json` (user).
170
96
 
171
97
  ## Requirements
172
98
 
173
- - Node.js 18+
99
+ - Node.js 22+
174
100
  - Git (for repository features)
175
101
 
176
102
  ## License
@@ -1,7 +1,7 @@
1
1
  import{createRequire as __cmr}from"node:module";import{fileURLToPath as __f2p}from"node:url";import{dirname as __dn}from"node:path";var require=__cmr(import.meta.url);var __filename=__f2p(import.meta.url);var __dirname=__dn(__filename);
2
2
  import {
3
3
  fetchResourceContext
4
- } from "./chunk-MF6QRGI5.js";
4
+ } from "./chunk-7NZT33JN.js";
5
5
  import {
6
6
  executeCommand,
7
7
  getCachedContext,
@@ -10,7 +10,7 @@ import {
10
10
  loadThreadIntoUI,
11
11
  runShell,
12
12
  warmupFileSearch
13
- } from "./chunk-EUHYFJ32.js";
13
+ } from "./chunk-XBXR7XCX.js";
14
14
  import {
15
15
  buildLocalIndex,
16
16
  getMastraCurrentModelId,
@@ -26,13 +26,13 @@ import {
26
26
  switchMastraThread,
27
27
  tryGetCurrentWorkspaceInfo,
28
28
  warmupHarness
29
- } from "./chunk-GGIXJZYK.js";
29
+ } from "./chunk-57JG7UZE.js";
30
30
  import {
31
31
  C_ERROR,
32
32
  C_SUCCESS,
33
33
  RESET
34
34
  } from "./chunk-YRXVMFXS.js";
35
- import "./chunk-AXGGL47C.js";
35
+ import "./chunk-4F6G2Q7W.js";
36
36
 
37
37
  // src/cli-agent/chat/ui/chat-terminal.ts
38
38
  import path2 from "path";
@@ -998,7 +998,7 @@ var ChatTerminal = class {
998
998
  // ─── Start ───────────────────────────────────────────────
999
999
  async start() {
1000
1000
  if (!this.options.apiToken && this.options.mcpConfig) {
1001
- const { showLoginScreen } = await import("./login-screen-2DJBDM47.js");
1001
+ const { showLoginScreen } = await import("./login-screen-3EAZNNE2.js");
1002
1002
  const result = await showLoginScreen(this.options.mcpConfig);
1003
1003
  if (result === "exit") return;
1004
1004
  }
@@ -1020,12 +1020,15 @@ var ChatTerminal = class {
1020
1020
  });
1021
1021
  this.store.dispatch({ synthRunning: true });
1022
1022
  this.bus.scheduleRefresh();
1023
- loadOrSynthesizeAll(this.options.provider, this.store.getState().config.model).catch(() => {
1023
+ loadOrSynthesizeAll(
1024
+ this.options.provider,
1025
+ this.store.getState().config.model
1026
+ ).catch(() => {
1024
1027
  }).finally(() => {
1025
1028
  this.store.dispatch({ synthRunning: false });
1026
1029
  this.bus.scheduleRefresh();
1027
1030
  });
1028
- const { startPiTuiApp } = await import("./pi-tui-app-DCD7TEN5.js");
1031
+ const { startPiTuiApp } = await import("./pi-tui-app-QZCEQTPW.js");
1029
1032
  await startPiTuiApp(this);
1030
1033
  }
1031
1034
  // ─── Session management ───────────────────────────────────
@@ -1343,7 +1346,11 @@ var ChatTerminal = class {
1343
1346
  );
1344
1347
  if (!this.isActiveTask(taskId, taskAbort)) return;
1345
1348
  this.store.dispatch({
1346
- task: { ...this.store.getState().task, phase: "thinking", effort: classification.effort }
1349
+ task: {
1350
+ ...this.store.getState().task,
1351
+ phase: "thinking",
1352
+ effort: classification.effort
1353
+ }
1347
1354
  });
1348
1355
  this.bus.scheduleRefresh();
1349
1356
  }
@@ -1354,7 +1361,10 @@ var ChatTerminal = class {
1354
1361
  });
1355
1362
  } else {
1356
1363
  this.store.dispatch({
1357
- task: { ...this.store.getState().task, effort: classification.effort }
1364
+ task: {
1365
+ ...this.store.getState().task,
1366
+ effort: classification.effort
1367
+ }
1358
1368
  });
1359
1369
  }
1360
1370
  const [sessionResourceCtx, sessionProjectCtx] = await Promise.all([
@@ -1390,7 +1400,12 @@ var ChatTerminal = class {
1390
1400
  if (!this.isActiveTask(taskId, taskAbort)) return;
1391
1401
  resetStreaming();
1392
1402
  this.store.dispatch({
1393
- task: { ...this.store.getState().task, phase, model, effort: "high" }
1403
+ task: {
1404
+ ...this.store.getState().task,
1405
+ phase,
1406
+ model,
1407
+ effort: "high"
1408
+ }
1394
1409
  });
1395
1410
  this.bus.scheduleRefresh();
1396
1411
  },