@codemap-ai/cli 0.1.0 → 0.1.1
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 +178 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# @codemap-ai/cli
|
|
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.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Run directly with npx (no install needed)
|
|
9
|
+
npx -y @codemap-ai/cli
|
|
10
|
+
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g @codemap-ai/cli
|
|
13
|
+
codemap
|
|
14
|
+
```
|
|
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
|
+
## Authentication
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
codemap login # Opens browser for CodeMap auth
|
|
105
|
+
codemap whoami # Check current user
|
|
106
|
+
codemap logout # Clear credentials
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## CLI Commands
|
|
110
|
+
|
|
111
|
+
### Chat & Gateway
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
codemap # Interactive chat (default)
|
|
115
|
+
codemap ask "explain X" # Single prompt, exit
|
|
116
|
+
codemap route "task" # Show which model handles a task
|
|
117
|
+
codemap models # List available models
|
|
118
|
+
codemap doctor # Diagnose gateway config
|
|
119
|
+
codemap init-gateway # Create gateway config
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Workspace
|
|
123
|
+
|
|
124
|
+
```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
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Agent Pack (Editor Integration)
|
|
131
|
+
|
|
132
|
+
```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
|
|
137
|
+
```
|
|
138
|
+
|
|
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 |
|
|
158
|
+
|
|
159
|
+
## Gateway Configuration
|
|
160
|
+
|
|
161
|
+
CodeMap uses an LLM gateway for chat and agent features. Configure via environment variables or config files:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
CODEMAP_LLM_GATEWAY_BASE_URL=http://localhost:4000/v1
|
|
165
|
+
CODEMAP_LLM_GATEWAY_API_KEY=your-key
|
|
166
|
+
CODEMAP_LLM_GATEWAY_DEFAULT_PROFILE=coder
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Or create a config file at `.codemap/llm-gateway.json` (project) or `~/.codemap/llm-gateway.json` (user).
|
|
170
|
+
|
|
171
|
+
## Requirements
|
|
172
|
+
|
|
173
|
+
- Node.js 18+
|
|
174
|
+
- Git (for repository features)
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemap-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CodeMap — AI-powered code intelligence and coding agent CLI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"web-tree-sitter": "^0.26.8",
|
|
37
37
|
"zod": "^4.3.6",
|
|
38
38
|
"@codemap/code-index": "1.0.0",
|
|
39
|
-
"@codemap/shared": "1.0.
|
|
39
|
+
"@codemap/shared": "1.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@mastra/core": "^1.35.0",
|