Skip to content

Commit 0b2fbb3

Browse files
committed
docs: add configuration guide to website
- Document config file structure and options - Explain repository settings and exclude patterns - Document MCP adapter configuration - Cover environment variable substitution - Explain storage locations and path resolution - Add Cursor and Claude Code integration details - Include troubleshooting tips
1 parent b804995 commit 0b2fbb3

File tree

3 files changed

+231
-1
lines changed

3 files changed

+231
-1
lines changed

PLAN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Focus on quality, documentation, and developer experience before adding new feat
135135
| Task | Status | Priority |
136136
|------|--------|----------|
137137
| CLI reference docs | ✅ Done | 🟡 Medium |
138-
| Configuration guide | 🔲 Todo | 🟡 Medium |
138+
| Configuration guide | ✅ Done | 🟡 Medium |
139139
| Troubleshooting guide | 🔲 Todo | 🟡 Medium |
140140
| Examples for new tools | 🔲 Todo | 🟢 Low |
141141

website/content/docs/_meta.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export default {
33
install: 'Installation',
44
quickstart: 'Quickstart',
55
cli: 'CLI Reference',
6+
configuration: 'Configuration',
67
'---tools': {
78
type: 'separator',
89
title: 'MCP Tools',
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# Configuration
2+
3+
Dev-agent uses a layered configuration system with sensible defaults.
4+
5+
## Configuration File
6+
7+
Run `dev init` to create a configuration file at `.dev-agent/config.json`:
8+
9+
```json
10+
{
11+
"version": "1.0",
12+
"repository": {
13+
"path": ".",
14+
"excludePatterns": [
15+
"**/node_modules/**",
16+
"**/dist/**",
17+
"**/.git/**",
18+
"**/coverage/**"
19+
],
20+
"languages": ["typescript", "javascript", "markdown"]
21+
},
22+
"mcp": {
23+
"adapters": {
24+
"search": { "enabled": true },
25+
"github": { "enabled": true },
26+
"plan": { "enabled": true },
27+
"explore": { "enabled": true },
28+
"status": { "enabled": false }
29+
}
30+
}
31+
}
32+
```
33+
34+
## Configuration Options
35+
36+
### Repository Settings
37+
38+
| Option | Type | Default | Description |
39+
|--------|------|---------|-------------|
40+
| `repository.path` | string | `"."` | Path to repository root |
41+
| `repository.excludePatterns` | string[] | See below | Glob patterns to exclude |
42+
| `repository.languages` | string[] | `["typescript", "javascript", "markdown"]` | Languages to index |
43+
44+
**Default Exclude Patterns:**
45+
- `**/node_modules/**`
46+
- `**/dist/**`
47+
- `**/.git/**`
48+
- `**/coverage/**`
49+
50+
### MCP Adapter Settings
51+
52+
Control which MCP tools are enabled:
53+
54+
| Adapter | Default | Tool | Description |
55+
|---------|---------|------|-------------|
56+
| `search` | enabled | `dev_search` | Semantic code search |
57+
| `github` | enabled | `dev_gh` | GitHub issues/PRs search |
58+
| `plan` | enabled | `dev_plan` | Context assembly for issues |
59+
| `explore` | enabled | `dev_explore` | Code exploration |
60+
| `status` | disabled | `dev_status` | Repository status |
61+
| `refs` | enabled | `dev_refs` | Relationship queries |
62+
| `map` | enabled | `dev_map` | Codebase overview |
63+
64+
**Disable an adapter:**
65+
```json
66+
{
67+
"mcp": {
68+
"adapters": {
69+
"github": { "enabled": false }
70+
}
71+
}
72+
}
73+
```
74+
75+
## Environment Variables
76+
77+
Configuration values can reference environment variables using `${VAR_NAME}` syntax:
78+
79+
```json
80+
{
81+
"repository": {
82+
"path": "${REPO_PATH}"
83+
}
84+
}
85+
```
86+
87+
**Built-in Environment Variables:**
88+
89+
| Variable | Description | Used By |
90+
|----------|-------------|---------|
91+
| `WORKSPACE_FOLDER_PATHS` | Cursor workspace paths | MCP server |
92+
| `REPOSITORY_PATH` | Explicit repository path | MCP server |
93+
94+
## Storage Locations
95+
96+
Dev-agent stores index data in `~/.dev-agent/indexes/`:
97+
98+
```
99+
~/.dev-agent/
100+
└── indexes/
101+
└── {hash}/ # Per-repository storage
102+
├── vectors.lance # Vector embeddings
103+
├── metadata.json # Repository metadata
104+
├── indexer-state.json
105+
└── github-state.json
106+
```
107+
108+
**Storage path resolution:**
109+
1. If repository has a git remote → hash of `owner/repo`
110+
2. Otherwise → hash of absolute path
111+
112+
This means the same repository cloned to different locations shares the same index.
113+
114+
### Check Storage Location
115+
116+
```bash
117+
dev storage path
118+
# Output: ~/.dev-agent/indexes/a1b2c3d4/
119+
120+
dev storage size
121+
# Output: 12.5 MB
122+
```
123+
124+
## Cursor Integration
125+
126+
Cursor uses a global MCP config at `~/.cursor/mcp.json`:
127+
128+
```json
129+
{
130+
"mcpServers": {
131+
"dev-agent": {
132+
"command": "dev",
133+
"args": ["mcp", "start"]
134+
}
135+
}
136+
}
137+
```
138+
139+
**Automatic workspace detection:**
140+
- Cursor sets `WORKSPACE_FOLDER_PATHS` automatically
141+
- Single config works across all projects
142+
- No per-project configuration needed
143+
144+
Install with:
145+
```bash
146+
dev mcp install --cursor
147+
```
148+
149+
## Claude Code Integration
150+
151+
Claude Code uses the `claude` CLI for MCP configuration:
152+
153+
```bash
154+
# Install
155+
dev mcp install
156+
157+
# List servers
158+
claude mcp list
159+
160+
# Remove
161+
dev mcp uninstall
162+
```
163+
164+
## Embedding Model
165+
166+
Dev-agent uses `Xenova/all-MiniLM-L6-v2` for embeddings:
167+
168+
| Property | Value |
169+
|----------|-------|
170+
| Model | all-MiniLM-L6-v2 |
171+
| Dimensions | 384 |
172+
| Provider | @xenova/transformers |
173+
| Location | Local (no API calls) |
174+
175+
The model is downloaded on first run (~23MB) and cached locally.
176+
177+
## Advanced: Custom Exclude Patterns
178+
179+
Add project-specific patterns:
180+
181+
```json
182+
{
183+
"repository": {
184+
"excludePatterns": [
185+
"**/node_modules/**",
186+
"**/dist/**",
187+
"**/.git/**",
188+
"**/coverage/**",
189+
"**/vendor/**",
190+
"**/*.generated.ts",
191+
"**/legacy/**"
192+
]
193+
}
194+
}
195+
```
196+
197+
## Troubleshooting
198+
199+
### Config Not Found
200+
201+
```bash
202+
# Check if config exists
203+
ls -la .dev-agent/config.json
204+
205+
# Create config
206+
dev init
207+
```
208+
209+
### Environment Variable Not Set
210+
211+
If you see `Environment variable X is not set`:
212+
213+
```bash
214+
# Set the variable
215+
export REPO_PATH=/path/to/repo
216+
217+
# Or use a literal value in config instead
218+
```
219+
220+
### Storage Permission Issues
221+
222+
```bash
223+
# Check permissions
224+
ls -la ~/.dev-agent/
225+
226+
# Fix permissions
227+
chmod -R 755 ~/.dev-agent/
228+
```
229+

0 commit comments

Comments
 (0)