mdcontext 0.0.1 → 0.1.0

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 (140) hide show
  1. package/.changeset/README.md +28 -0
  2. package/.changeset/config.json +11 -0
  3. package/.github/workflows/ci.yml +83 -0
  4. package/.github/workflows/release.yml +113 -0
  5. package/.tldrignore +112 -0
  6. package/AGENTS.md +46 -0
  7. package/BACKLOG.md +338 -0
  8. package/README.md +231 -11
  9. package/biome.json +36 -0
  10. package/cspell.config.yaml +14 -0
  11. package/dist/chunk-KRYIFLQR.js +92 -0
  12. package/dist/chunk-S7E6TFX6.js +742 -0
  13. package/dist/chunk-VVTGZNBT.js +1519 -0
  14. package/dist/cli/main.d.ts +1 -0
  15. package/dist/cli/main.js +2015 -0
  16. package/dist/index.d.ts +266 -0
  17. package/dist/index.js +86 -0
  18. package/dist/mcp/server.d.ts +1 -0
  19. package/dist/mcp/server.js +376 -0
  20. package/docs/019-USAGE.md +586 -0
  21. package/docs/020-current-implementation.md +364 -0
  22. package/docs/021-DOGFOODING-FINDINGS.md +175 -0
  23. package/docs/BACKLOG.md +80 -0
  24. package/docs/DESIGN.md +439 -0
  25. package/docs/PROJECT.md +88 -0
  26. package/docs/ROADMAP.md +407 -0
  27. package/docs/test-links.md +9 -0
  28. package/package.json +69 -10
  29. package/pnpm-workspace.yaml +5 -0
  30. package/research/config-analysis/01-current-implementation.md +470 -0
  31. package/research/config-analysis/02-strategy-recommendation.md +428 -0
  32. package/research/config-analysis/03-task-candidates.md +715 -0
  33. package/research/config-analysis/033-research-configuration-management.md +828 -0
  34. package/research/config-analysis/034-research-effect-cli-config.md +1504 -0
  35. package/research/config-analysis/04-consolidated-task-candidates.md +277 -0
  36. package/research/dogfood/consolidated-tool-evaluation.md +373 -0
  37. package/research/dogfood/strategy-a/a-synthesis.md +184 -0
  38. package/research/dogfood/strategy-a/a1-docs.md +226 -0
  39. package/research/dogfood/strategy-a/a2-amorphic.md +156 -0
  40. package/research/dogfood/strategy-a/a3-llm.md +164 -0
  41. package/research/dogfood/strategy-b/b-synthesis.md +228 -0
  42. package/research/dogfood/strategy-b/b1-architecture.md +207 -0
  43. package/research/dogfood/strategy-b/b2-gaps.md +258 -0
  44. package/research/dogfood/strategy-b/b3-workflows.md +250 -0
  45. package/research/dogfood/strategy-c/c-synthesis.md +451 -0
  46. package/research/dogfood/strategy-c/c1-explorer.md +192 -0
  47. package/research/dogfood/strategy-c/c2-diver-memory.md +145 -0
  48. package/research/dogfood/strategy-c/c3-diver-control.md +148 -0
  49. package/research/dogfood/strategy-c/c4-diver-failure.md +151 -0
  50. package/research/dogfood/strategy-c/c5-diver-execution.md +221 -0
  51. package/research/dogfood/strategy-c/c6-diver-org.md +221 -0
  52. package/research/effect-cli-error-handling.md +845 -0
  53. package/research/effect-errors-as-values.md +943 -0
  54. package/research/errors-task-analysis/00-consolidated-tasks.md +207 -0
  55. package/research/errors-task-analysis/cli-commands-analysis.md +909 -0
  56. package/research/errors-task-analysis/embeddings-analysis.md +709 -0
  57. package/research/errors-task-analysis/index-search-analysis.md +812 -0
  58. package/research/mdcontext-error-analysis.md +521 -0
  59. package/research/npm_publish/011-npm-workflow-research-agent2.md +792 -0
  60. package/research/npm_publish/012-npm-workflow-research-agent1.md +530 -0
  61. package/research/npm_publish/013-npm-workflow-research-agent3.md +722 -0
  62. package/research/npm_publish/014-npm-workflow-synthesis.md +556 -0
  63. package/research/npm_publish/031-npm-workflow-task-analysis.md +134 -0
  64. package/research/semantic-search/002-research-embedding-models.md +490 -0
  65. package/research/semantic-search/003-research-rag-alternatives.md +523 -0
  66. package/research/semantic-search/004-research-vector-search.md +841 -0
  67. package/research/semantic-search/032-research-semantic-search.md +427 -0
  68. package/research/task-management-2026/00-synthesis-recommendations.md +295 -0
  69. package/research/task-management-2026/01-ai-workflow-tools.md +416 -0
  70. package/research/task-management-2026/02-agent-framework-patterns.md +476 -0
  71. package/research/task-management-2026/03-lightweight-file-based.md +567 -0
  72. package/research/task-management-2026/04-established-tools-ai-features.md +541 -0
  73. package/research/task-management-2026/linear/01-core-features-workflow.md +771 -0
  74. package/research/task-management-2026/linear/02-api-integrations.md +930 -0
  75. package/research/task-management-2026/linear/03-ai-features.md +368 -0
  76. package/research/task-management-2026/linear/04-pricing-setup.md +205 -0
  77. package/research/task-management-2026/linear/05-usage-patterns-best-practices.md +605 -0
  78. package/scripts/rebuild-hnswlib.js +63 -0
  79. package/src/cli/argv-preprocessor.test.ts +210 -0
  80. package/src/cli/argv-preprocessor.ts +202 -0
  81. package/src/cli/cli.test.ts +430 -0
  82. package/src/cli/commands/backlinks.ts +54 -0
  83. package/src/cli/commands/context.ts +197 -0
  84. package/src/cli/commands/index-cmd.ts +300 -0
  85. package/src/cli/commands/index.ts +13 -0
  86. package/src/cli/commands/links.ts +52 -0
  87. package/src/cli/commands/search.ts +451 -0
  88. package/src/cli/commands/stats.ts +146 -0
  89. package/src/cli/commands/tree.ts +107 -0
  90. package/src/cli/flag-schemas.ts +275 -0
  91. package/src/cli/help.ts +386 -0
  92. package/src/cli/index.ts +9 -0
  93. package/src/cli/main.ts +145 -0
  94. package/src/cli/options.ts +31 -0
  95. package/src/cli/typo-suggester.test.ts +105 -0
  96. package/src/cli/typo-suggester.ts +130 -0
  97. package/src/cli/utils.ts +126 -0
  98. package/src/core/index.ts +1 -0
  99. package/src/core/types.ts +140 -0
  100. package/src/embeddings/index.ts +8 -0
  101. package/src/embeddings/openai-provider.ts +165 -0
  102. package/src/embeddings/semantic-search.ts +583 -0
  103. package/src/embeddings/types.ts +82 -0
  104. package/src/embeddings/vector-store.ts +299 -0
  105. package/src/index/index.ts +4 -0
  106. package/src/index/indexer.ts +446 -0
  107. package/src/index/storage.ts +196 -0
  108. package/src/index/types.ts +109 -0
  109. package/src/index/watcher.ts +131 -0
  110. package/src/index.ts +8 -0
  111. package/src/mcp/server.ts +483 -0
  112. package/src/parser/index.ts +1 -0
  113. package/src/parser/parser.test.ts +291 -0
  114. package/src/parser/parser.ts +395 -0
  115. package/src/parser/section-filter.ts +270 -0
  116. package/src/search/query-parser.test.ts +260 -0
  117. package/src/search/query-parser.ts +319 -0
  118. package/src/search/searcher.test.ts +182 -0
  119. package/src/search/searcher.ts +602 -0
  120. package/src/summarize/budget-bugs.test.ts +620 -0
  121. package/src/summarize/formatters.ts +419 -0
  122. package/src/summarize/index.ts +20 -0
  123. package/src/summarize/summarizer.test.ts +275 -0
  124. package/src/summarize/summarizer.ts +528 -0
  125. package/src/summarize/verify-bugs.test.ts +238 -0
  126. package/src/utils/index.ts +1 -0
  127. package/src/utils/tokens.test.ts +142 -0
  128. package/src/utils/tokens.ts +186 -0
  129. package/tests/fixtures/cli/.mdcontext/config.json +8 -0
  130. package/tests/fixtures/cli/.mdcontext/indexes/documents.json +33 -0
  131. package/tests/fixtures/cli/.mdcontext/indexes/links.json +12 -0
  132. package/tests/fixtures/cli/.mdcontext/indexes/sections.json +233 -0
  133. package/tests/fixtures/cli/.mdcontext/vectors.bin +0 -0
  134. package/tests/fixtures/cli/.mdcontext/vectors.meta.json +1264 -0
  135. package/tests/fixtures/cli/README.md +9 -0
  136. package/tests/fixtures/cli/api-reference.md +11 -0
  137. package/tests/fixtures/cli/getting-started.md +11 -0
  138. package/tsconfig.json +26 -0
  139. package/vitest.config.ts +21 -0
  140. package/vitest.setup.ts +12 -0
@@ -0,0 +1,586 @@
1
+ # mdcontext Usage Guide
2
+
3
+ Complete command reference and workflows for mdcontext.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Installation](#installation)
8
+ - [Quick Start](#quick-start)
9
+ - [Commands](#commands)
10
+ - [index](#index)
11
+ - [search](#search)
12
+ - [context](#context)
13
+ - [tree](#tree)
14
+ - [links](#links)
15
+ - [backlinks](#backlinks)
16
+ - [stats](#stats)
17
+ - [MCP Server](#mcp-server)
18
+ - [Workflows](#workflows)
19
+ - [Configuration](#configuration)
20
+
21
+ ---
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ # Global install
27
+ npm install -g mdcontext
28
+
29
+ # Or use npx
30
+ npx mdcontext --help
31
+ ```
32
+
33
+ **Requirements:**
34
+
35
+ - Node.js 18+
36
+ - OpenAI API key (for semantic search only)
37
+
38
+ ---
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ # 1. Index your markdown files
44
+ mdcontext index ./docs
45
+
46
+ # 2. View structure
47
+ mdcontext tree ./docs # File list
48
+ mdcontext tree ./docs/README.md # Document outline
49
+
50
+ # 3. Get LLM-ready context
51
+ mdcontext context ./docs/README.md
52
+
53
+ # 4. Enable semantic search (optional)
54
+ export OPENAI_API_KEY=sk-...
55
+ mdcontext index --embed
56
+ mdcontext search "how to authenticate"
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Commands
62
+
63
+ ### index
64
+
65
+ Build or update the document index. Run this first before using other commands.
66
+
67
+ ```bash
68
+ mdcontext index [path] [options]
69
+ ```
70
+
71
+ **Arguments:**
72
+
73
+ | Argument | Description |
74
+ | -------- | ----------------------------------------------- |
75
+ | `path` | Directory to index (default: current directory) |
76
+
77
+ **Options:**
78
+
79
+ | Option | Description |
80
+ | ------------- | --------------------------------- |
81
+ | `-e, --embed` | Also build semantic embeddings |
82
+ | `-w, --watch` | Watch for file changes |
83
+ | `--force` | Force full rebuild (ignore cache) |
84
+ | `--json` | Output as JSON |
85
+ | `--pretty` | Pretty-print JSON |
86
+
87
+ **Examples:**
88
+
89
+ ```bash
90
+ # Index current directory
91
+ mdcontext index
92
+
93
+ # Index specific directory
94
+ mdcontext index ./docs
95
+
96
+ # Index with embeddings for semantic search
97
+ mdcontext index --embed
98
+
99
+ # Watch mode for development
100
+ mdcontext index --watch
101
+
102
+ # Force rebuild
103
+ mdcontext index --force
104
+ ```
105
+
106
+ **Index location:** `.mdcontext/indexes/`
107
+
108
+ ---
109
+
110
+ ### search
111
+
112
+ Search by meaning (semantic) or by structure (heading patterns).
113
+
114
+ ```bash
115
+ mdcontext search [options] <query> [path]
116
+ ```
117
+
118
+ **Arguments:**
119
+
120
+ | Argument | Description |
121
+ | -------- | --------------------------------------------------- |
122
+ | `query` | Search query (natural language or regex pattern) |
123
+ | `path` | Directory to search in (default: current directory) |
124
+
125
+ **Options:**
126
+
127
+ | Option | Description |
128
+ | --------------- | ---------------------------------------------- |
129
+ | `-k, --keyword` | Force keyword search (exact text match) |
130
+ | `-n, --limit` | Maximum results (default: 10) |
131
+ | `--threshold` | Similarity threshold for semantic search (0-1) |
132
+ | `--json` | Output as JSON |
133
+ | `--pretty` | Pretty-print JSON |
134
+
135
+ **Auto-detection:**
136
+
137
+ - If embeddings exist AND query looks like natural language: semantic search
138
+ - If query has regex characters OR `-k` flag: keyword search
139
+
140
+ **Examples:**
141
+
142
+ ```bash
143
+ # Semantic search (if embeddings exist)
144
+ mdcontext search "how to authenticate"
145
+
146
+ # Keyword search (exact text match)
147
+ mdcontext search -k "Setup|Install"
148
+
149
+ # Limit results
150
+ mdcontext search -n 5 "api"
151
+
152
+ # Higher similarity threshold
153
+ mdcontext search --threshold 0.8 "deploy"
154
+
155
+ # Search in specific directory
156
+ mdcontext search "config" ./docs
157
+ ```
158
+
159
+ ---
160
+
161
+ ### context
162
+
163
+ Get LLM-ready context from one or more files.
164
+
165
+ ```bash
166
+ mdcontext context [options] <files...>
167
+ ```
168
+
169
+ **Arguments:**
170
+
171
+ | Argument | Description |
172
+ | ---------- | ---------------------------------------------------- |
173
+ | `files...` | One or more markdown files (glob patterns supported) |
174
+
175
+ **Options:**
176
+
177
+ | Option | Description |
178
+ | -------------- | ---------------------------- |
179
+ | `-t, --tokens` | Token budget |
180
+ | `--brief` | Minimal output (~100 tokens) |
181
+ | `--full` | Include full content |
182
+ | `--json` | Output as JSON |
183
+ | `--pretty` | Pretty-print JSON |
184
+
185
+ **Examples:**
186
+
187
+ ```bash
188
+ # Single file
189
+ mdcontext context README.md
190
+
191
+ # Multiple files
192
+ mdcontext context README.md docs/api.md docs/setup.md
193
+
194
+ # Glob patterns
195
+ mdcontext context docs/*.md
196
+
197
+ # With token budget
198
+ mdcontext context -t 500 README.md
199
+
200
+ # Brief summary
201
+ mdcontext context --brief README.md
202
+
203
+ # Full content
204
+ mdcontext context --full README.md
205
+ ```
206
+
207
+ **Output includes:**
208
+
209
+ - Document title and path
210
+ - Section summaries (respecting token budget)
211
+ - Token count
212
+ - Metadata markers for code, tables, etc.
213
+
214
+ ---
215
+
216
+ ### tree
217
+
218
+ Display file structure or document outline.
219
+
220
+ ```bash
221
+ mdcontext tree [path] [options]
222
+ ```
223
+
224
+ **Arguments:**
225
+
226
+ | Argument | Description |
227
+ | -------- | ---------------------------------------------- |
228
+ | `path` | Directory or file (default: current directory) |
229
+
230
+ **Options:**
231
+
232
+ | Option | Description |
233
+ | ---------- | ----------------- |
234
+ | `--json` | Output as JSON |
235
+ | `--pretty` | Pretty-print JSON |
236
+
237
+ **Auto-detection:**
238
+
239
+ - If path is a directory: shows file list
240
+ - If path is a file: shows document outline (heading hierarchy)
241
+
242
+ **Examples:**
243
+
244
+ ```bash
245
+ # File list in current directory
246
+ mdcontext tree
247
+
248
+ # File list in specific directory
249
+ mdcontext tree ./docs
250
+
251
+ # Document outline
252
+ mdcontext tree README.md
253
+ ```
254
+
255
+ **Directory output:**
256
+
257
+ ```
258
+ docs/
259
+ ├── README.md (2,450 tokens)
260
+ ├── api/
261
+ │ ├── endpoints.md (1,200 tokens)
262
+ │ └── authentication.md (890 tokens)
263
+ └── guides/
264
+ └── getting-started.md (1,560 tokens)
265
+ ```
266
+
267
+ **File output:**
268
+
269
+ ```
270
+ # API Reference (450 tokens)
271
+ ## Authentication (120 tokens)
272
+ ### OAuth Flow (45 tokens)
273
+ ### API Keys (35 tokens)
274
+ ## Endpoints (280 tokens)
275
+ ### Users (95 tokens)
276
+ ### Products (105 tokens)
277
+ ```
278
+
279
+ ---
280
+
281
+ ### links
282
+
283
+ Show outgoing links from a file.
284
+
285
+ ```bash
286
+ mdcontext links <file> [options]
287
+ ```
288
+
289
+ **Arguments:**
290
+
291
+ | Argument | Description |
292
+ | -------- | ------------------------ |
293
+ | `file` | Markdown file to analyze |
294
+
295
+ **Options:**
296
+
297
+ | Option | Description |
298
+ | ------------ | ------------------------------------------- |
299
+ | `-r, --root` | Root directory for index (default: current) |
300
+ | `--json` | Output as JSON |
301
+ | `--pretty` | Pretty-print JSON |
302
+
303
+ **Example:**
304
+
305
+ ```bash
306
+ mdcontext links docs/README.md
307
+ ```
308
+
309
+ **Output:**
310
+
311
+ ```
312
+ Internal Links:
313
+ → ./getting-started.md (Getting Started)
314
+ → ./api/endpoints.md (API Reference)
315
+ → #installation (Installation)
316
+
317
+ External Links:
318
+ → https://github.com/example (GitHub)
319
+ ```
320
+
321
+ ---
322
+
323
+ ### backlinks
324
+
325
+ Show files that link to a specific file.
326
+
327
+ ```bash
328
+ mdcontext backlinks <file> [options]
329
+ ```
330
+
331
+ **Arguments:**
332
+
333
+ | Argument | Description |
334
+ | -------- | ------------------------------ |
335
+ | `file` | Markdown file to find links to |
336
+
337
+ **Options:**
338
+
339
+ | Option | Description |
340
+ | ------------ | ------------------------------------------- |
341
+ | `-r, --root` | Root directory for index (default: current) |
342
+ | `--json` | Output as JSON |
343
+ | `--pretty` | Pretty-print JSON |
344
+
345
+ **Example:**
346
+
347
+ ```bash
348
+ mdcontext backlinks docs/api/authentication.md
349
+ ```
350
+
351
+ **Output:**
352
+
353
+ ```
354
+ Files linking to docs/api/authentication.md:
355
+ ← docs/README.md (in section "Quick Start")
356
+ ← docs/guides/getting-started.md (in section "Authentication")
357
+ ```
358
+
359
+ ---
360
+
361
+ ### stats
362
+
363
+ Show index statistics.
364
+
365
+ ```bash
366
+ mdcontext stats [path] [options]
367
+ ```
368
+
369
+ **Arguments:**
370
+
371
+ | Argument | Description |
372
+ | -------- | ---------------------------------------------- |
373
+ | `path` | Directory to show stats for (default: current) |
374
+
375
+ **Options:**
376
+
377
+ | Option | Description |
378
+ | ---------- | ----------------- |
379
+ | `--json` | Output as JSON |
380
+ | `--pretty` | Pretty-print JSON |
381
+
382
+ **Example:**
383
+
384
+ ```bash
385
+ mdcontext stats
386
+ ```
387
+
388
+ **Output:**
389
+
390
+ ```
391
+ Index Statistics:
392
+ Documents: 23
393
+ Sections: 156
394
+ Total tokens: 45,230
395
+ Links: 89 (67 internal, 22 external)
396
+ Code blocks: 34
397
+ Embeddings: 156 (100%)
398
+ Last updated: 2024-01-15 10:30:00
399
+ ```
400
+
401
+ ---
402
+
403
+ ## MCP Server
404
+
405
+ mdcontext includes an MCP server for integration with AI assistants.
406
+
407
+ ### Starting the Server
408
+
409
+ ```bash
410
+ mdcontext-mcp
411
+ ```
412
+
413
+ ### Available Tools
414
+
415
+ | Tool | Description |
416
+ | -------------- | ---------------------------------------- |
417
+ | `md_search` | Semantic search across indexed documents |
418
+ | `md_context` | Get LLM-ready context for a file |
419
+ | `md_structure` | Get document structure/outline |
420
+
421
+ ### Claude Desktop Configuration
422
+
423
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
424
+
425
+ ```json
426
+ {
427
+ "mcpServers": {
428
+ "mdcontext": {
429
+ "command": "mdcontext-mcp",
430
+ "args": []
431
+ }
432
+ }
433
+ }
434
+ ```
435
+
436
+ ### Claude Code Configuration
437
+
438
+ Add to `.claude/settings.json`:
439
+
440
+ ```json
441
+ {
442
+ "mcpServers": {
443
+ "mdcontext": {
444
+ "command": "mdcontext-mcp",
445
+ "args": []
446
+ }
447
+ }
448
+ }
449
+ ```
450
+
451
+ ---
452
+
453
+ ## Workflows
454
+
455
+ ### Adding Documentation to LLM Context
456
+
457
+ ```bash
458
+ # 1. See what's available
459
+ mdcontext tree ./docs
460
+
461
+ # 2. Check document structure
462
+ mdcontext tree docs/api.md
463
+
464
+ # 3. Get context for specific file
465
+ mdcontext context -t 500 docs/api.md
466
+
467
+ # 4. Or combine multiple files
468
+ mdcontext context -t 2000 README.md docs/setup.md docs/api.md
469
+ ```
470
+
471
+ ### Finding Related Documentation
472
+
473
+ ```bash
474
+ # 1. See what a file links to
475
+ mdcontext links docs/README.md
476
+
477
+ # 2. See what links to a file
478
+ mdcontext backlinks docs/api/authentication.md
479
+
480
+ # 3. Use semantic search to find related content
481
+ mdcontext search "user authentication and session management"
482
+ ```
483
+
484
+ ### Keeping Index Updated
485
+
486
+ ```bash
487
+ # One-time index
488
+ mdcontext index
489
+
490
+ # Watch mode during development
491
+ mdcontext index --watch
492
+
493
+ # Force full rebuild after major changes
494
+ mdcontext index --force
495
+ ```
496
+
497
+ ### Setting Up Semantic Search
498
+
499
+ ```bash
500
+ # 1. Set API key
501
+ export OPENAI_API_KEY=sk-...
502
+
503
+ # 2. Build embeddings
504
+ mdcontext index --embed
505
+
506
+ # 3. Search by meaning
507
+ mdcontext search "how to handle authentication errors"
508
+ ```
509
+
510
+ ### Optimizing for Token Budget
511
+
512
+ ```bash
513
+ # Check document size
514
+ mdcontext tree docs/large-doc.md
515
+
516
+ # Get brief summary
517
+ mdcontext context docs/large-doc.md --brief
518
+
519
+ # Or set explicit budget
520
+ mdcontext context -t 200 docs/large-doc.md
521
+
522
+ # Combine multiple files with shared budget
523
+ mdcontext context -t 1000 a.md b.md c.md
524
+ ```
525
+
526
+ ---
527
+
528
+ ## Configuration
529
+
530
+ ### Index Directory
531
+
532
+ By default, indexes are stored in `.mdcontext/` in your project root:
533
+
534
+ ```
535
+ .mdcontext/
536
+ ├── indexes/
537
+ │ ├── documents.json # Document metadata
538
+ │ ├── sections.json # Section index
539
+ │ ├── links.json # Link graph
540
+ │ └── vectors.bin # Embeddings
541
+ └── cache/
542
+ └── parsed/ # Cached parsed documents
543
+ ```
544
+
545
+ ### Environment Variables
546
+
547
+ | Variable | Required | Description |
548
+ | ---------------- | ------------------- | -------------- |
549
+ | `OPENAI_API_KEY` | For semantic search | OpenAI API key |
550
+
551
+ ### Supported File Types
552
+
553
+ - `.md` - Markdown
554
+ - `.mdx` - MDX (treated as markdown)
555
+
556
+ ### GFM Features Supported
557
+
558
+ - Tables
559
+ - Task lists (`- [ ]`, `- [x]`)
560
+ - Strikethrough
561
+ - Autolinks
562
+ - YAML frontmatter
563
+
564
+ ---
565
+
566
+ ## Troubleshooting
567
+
568
+ ### "No index found"
569
+
570
+ Run `mdcontext index` to build the index first.
571
+
572
+ ### "Semantic search not available"
573
+
574
+ 1. Set `OPENAI_API_KEY` environment variable
575
+ 2. Run `mdcontext index --embed` to build embedding index
576
+
577
+ ### "File not found in index"
578
+
579
+ 1. Check file is in indexed directory
580
+ 2. Run `mdcontext index --force` to rebuild
581
+
582
+ ### High token counts
583
+
584
+ - Use `--brief` for compressed output
585
+ - Use `-t <tokens>` to set explicit budget
586
+ - Use multiple files with shared budget via `context`