@lon-ask/dockit 0.1.1 → 0.1.2

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 (136) hide show
  1. package/README.md +482 -337
  2. package/SKILL.md +94 -103
  3. package/apps/client/index.html +12 -0
  4. package/apps/client/package.json +26 -0
  5. package/apps/client/src/App.tsx +18 -0
  6. package/apps/client/src/api/client.ts +54 -0
  7. package/apps/client/src/components/BuildPanel.tsx +77 -0
  8. package/apps/client/src/components/DocViewer.tsx +76 -0
  9. package/apps/client/src/components/EntryDetail.tsx +322 -0
  10. package/apps/client/src/components/EntryForm.tsx +117 -0
  11. package/apps/client/src/components/EntryList.tsx +165 -0
  12. package/apps/client/src/components/GlobalSearchBar.tsx +166 -0
  13. package/apps/client/src/components/Layout.tsx +57 -0
  14. package/apps/client/src/components/SearchBar.tsx +103 -0
  15. package/apps/client/src/components/SourceForm.tsx +497 -0
  16. package/apps/client/src/hooks/useTheme.ts +19 -0
  17. package/apps/client/src/index.css +77 -0
  18. package/apps/client/src/main.tsx +13 -0
  19. package/apps/client/src/types.ts +105 -0
  20. package/apps/client/vite.config.ts +13 -0
  21. package/apps/server/dist/core/domain/entry.js +20 -0
  22. package/apps/server/dist/core/domain/entry.js.map +1 -0
  23. package/apps/server/dist/core/domain/errors.js +33 -0
  24. package/apps/server/dist/core/domain/errors.js.map +1 -0
  25. package/apps/server/dist/core/domain/knowledge-graph.js +2 -0
  26. package/apps/server/dist/core/domain/knowledge-graph.js.map +1 -0
  27. package/apps/server/dist/core/domain/types.js +2 -0
  28. package/apps/server/dist/core/domain/types.js.map +1 -0
  29. package/apps/server/dist/core/ports/IBuildRepository.js +2 -0
  30. package/apps/server/dist/core/ports/IBuildRepository.js.map +1 -0
  31. package/apps/server/dist/core/ports/IDocumentNormalizer.js +2 -0
  32. package/apps/server/dist/core/ports/IDocumentNormalizer.js.map +1 -0
  33. package/apps/server/dist/core/ports/IDocumentStore.js +2 -0
  34. package/apps/server/dist/core/ports/IDocumentStore.js.map +1 -0
  35. package/apps/server/dist/core/ports/IEntryReadModel.js +2 -0
  36. package/apps/server/dist/core/ports/IEntryReadModel.js.map +1 -0
  37. package/apps/server/dist/core/ports/IEntryRepository.js +2 -0
  38. package/apps/server/dist/core/ports/IEntryRepository.js.map +1 -0
  39. package/apps/server/dist/core/ports/IKnowledgeGraph.js +2 -0
  40. package/apps/server/dist/core/ports/IKnowledgeGraph.js.map +1 -0
  41. package/apps/server/dist/core/ports/IPathResolver.js +2 -0
  42. package/apps/server/dist/core/ports/IPathResolver.js.map +1 -0
  43. package/apps/server/dist/core/ports/ISearchEngine.js +2 -0
  44. package/apps/server/dist/core/ports/ISearchEngine.js.map +1 -0
  45. package/apps/server/dist/core/ports/ISourceProcessor.js +2 -0
  46. package/apps/server/dist/core/ports/ISourceProcessor.js.map +1 -0
  47. package/apps/server/dist/core/ports/ISourceRepository.js +2 -0
  48. package/apps/server/dist/core/ports/ISourceRepository.js.map +1 -0
  49. package/apps/server/dist/core/usecases/BuildUseCase.js +76 -0
  50. package/apps/server/dist/core/usecases/BuildUseCase.js.map +1 -0
  51. package/apps/server/dist/core/usecases/ConfigUseCase.js +62 -0
  52. package/apps/server/dist/core/usecases/ConfigUseCase.js.map +1 -0
  53. package/apps/server/dist/core/usecases/SearchUseCase.js +17 -0
  54. package/apps/server/dist/core/usecases/SearchUseCase.js.map +1 -0
  55. package/apps/server/dist/index.js +86 -0
  56. package/apps/server/dist/index.js.map +1 -0
  57. package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js +25 -0
  58. package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js.map +1 -0
  59. package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js +42 -0
  60. package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js.map +1 -0
  61. package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js +145 -0
  62. package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js.map +1 -0
  63. package/apps/server/dist/infrastructure/graph/index.js +3 -0
  64. package/apps/server/dist/infrastructure/graph/index.js.map +1 -0
  65. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js +21 -0
  66. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js.map +1 -0
  67. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js +11 -0
  68. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js.map +1 -0
  69. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js +59 -0
  70. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js.map +1 -0
  71. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js +47 -0
  72. package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js.map +1 -0
  73. package/apps/server/dist/infrastructure/persistence/sqlite/connection.js +50 -0
  74. package/apps/server/dist/infrastructure/persistence/sqlite/connection.js.map +1 -0
  75. package/apps/server/dist/infrastructure/search/SearchEngineFactory.js +32 -0
  76. package/apps/server/dist/infrastructure/search/SearchEngineFactory.js.map +1 -0
  77. package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js +147 -0
  78. package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js.map +1 -0
  79. package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js +23 -0
  80. package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js.map +1 -0
  81. package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js +378 -0
  82. package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js.map +1 -0
  83. package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js +11 -0
  84. package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js.map +1 -0
  85. package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js +9 -0
  86. package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js.map +1 -0
  87. package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js +11 -0
  88. package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js.map +1 -0
  89. package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js +9 -0
  90. package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js.map +1 -0
  91. package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js +9 -0
  92. package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js.map +1 -0
  93. package/apps/server/dist/infrastructure/source-processors/PathResolver.js +5 -0
  94. package/apps/server/dist/infrastructure/source-processors/PathResolver.js.map +1 -0
  95. package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js +261 -0
  96. package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js.map +1 -0
  97. package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js +9 -0
  98. package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js.map +1 -0
  99. package/apps/server/dist/mcp-http.js +93 -0
  100. package/apps/server/dist/mcp-http.js.map +1 -0
  101. package/apps/server/dist/mcp.js +339 -0
  102. package/apps/server/dist/mcp.js.map +1 -0
  103. package/apps/server/dist/routes/build.js +89 -0
  104. package/apps/server/dist/routes/build.js.map +1 -0
  105. package/apps/server/dist/routes/entries.js +52 -0
  106. package/apps/server/dist/routes/entries.js.map +1 -0
  107. package/apps/server/dist/routes/graph.js +58 -0
  108. package/apps/server/dist/routes/graph.js.map +1 -0
  109. package/apps/server/dist/routes/search.js +24 -0
  110. package/apps/server/dist/routes/search.js.map +1 -0
  111. package/apps/server/dist/routes/sources.js +100 -0
  112. package/apps/server/dist/routes/sources.js.map +1 -0
  113. package/apps/server/dist/routes/viewer.js +22 -0
  114. package/apps/server/dist/routes/viewer.js.map +1 -0
  115. package/apps/server/dist/services/antora.js +222 -0
  116. package/apps/server/dist/services/antora.js.map +1 -0
  117. package/apps/server/dist/services/asciidoc.js +206 -0
  118. package/apps/server/dist/services/asciidoc.js.map +1 -0
  119. package/apps/server/dist/services/configLoader.js +150 -0
  120. package/apps/server/dist/services/configLoader.js.map +1 -0
  121. package/apps/server/dist/services/githubMarkdown.js +221 -0
  122. package/apps/server/dist/services/githubMarkdown.js.map +1 -0
  123. package/apps/server/dist/services/maven.js +148 -0
  124. package/apps/server/dist/services/maven.js.map +1 -0
  125. package/apps/server/dist/services/normalizer.js +42 -0
  126. package/apps/server/dist/services/normalizer.js.map +1 -0
  127. package/apps/server/dist/services/paths.js +5 -0
  128. package/apps/server/dist/services/paths.js.map +1 -0
  129. package/apps/server/dist/services/textExtractor.js +46 -0
  130. package/apps/server/dist/services/textExtractor.js.map +1 -0
  131. package/apps/server/dist/services/zip.js +63 -0
  132. package/apps/server/dist/services/zip.js.map +1 -0
  133. package/apps/server/package.json +38 -0
  134. package/bin/commands/dev.ts +2 -2
  135. package/bin/commands/serve.ts +2 -2
  136. package/package.json +17 -3
package/README.md CHANGED
@@ -1,496 +1,641 @@
1
1
  # Dockit
2
2
 
3
- Local documentation hub that aggregates multiple documentation source types (ZIP, Maven, Antora, AsciiDoc, GitHub Markdown) into a unified, searchable HTML bundle — useful as LLM context. Also supports **source code knowledge graphs** powered by Graphify (Tree-sitter AST), producing structural dependency graphs for 15+ languages.
3
+ > Built with [OpenCode](https://opencode.ai) and [DeepSeek](https://deepseek.com)
4
4
 
5
- Ships with two search engines: a lightweight **TF-IDF engine** and a **hybrid semantic+keyword engine** (LanceDB + all-MiniLM-L6-v2 embeddings) configurable via a single toggle.
5
+ > **Local documentation hub** aggregate, index, and search your project's documentation and source code.
6
+ > Runs entirely offline. Ships as a single CLI binary via npm.
6
7
 
7
- All operational data (SQLite DB, build outputs, search indexes, knowledge graphs, embeddings model cache) is stored in `~/.dockit/` by default. Override with the `DOCKIT_DATA_DIR` environment variable.
8
+ ## Why Dockit
8
9
 
9
- ## Quick Start
10
+ Modern software teams juggle multiple documentation sources: auto-generated API docs, hand-written Markdown guides, AsciiDoc references, Antora sites, Maven Javadoc JARs, ZIP archives. Each source lives in its own silo with its own search bar. When an LLM coding agent needs to answer a framework question, it either hallucinates from training data or scrolls through GitHub.
11
+
12
+ Dockit solves this by ingesting **six documentation source types** and **source code** into a single, offline searchable index. It runs entirely on your machine — no cloud, no API keys, no internet required after the initial build.
13
+
14
+ ### What it does
15
+
16
+ - **Indexes documentation** from ZIP bundles, Maven Javadoc, Antora sites, AsciiDoc repos, GitHub Markdown repos
17
+ - **Builds source code knowledge graphs** via Graphify (Tree-sitter AST) — traces imports, calls, and inheritance across 15+ languages
18
+ - **Searches with hybrid TF-IDF + vector semantic engine** — keyword precision + conceptual understanding
19
+ - **Exposes an MCP server** so AI coding agents (Claude, Cline, OpenCode) can query docs on-demand
20
+ - **Works completely offline** — LanceDB embedded vector DB, ONNX embeddings model, local SQLite
21
+
22
+ ### Who it's for
23
+
24
+ | Role | Use case |
25
+ |------|----------|
26
+ | **LLM coding agents** | Query up-to-date framework docs instead of relying on stale training data |
27
+ | **Developers** | Search your project's docs + code structure from the terminal |
28
+ | **Teams** | Pre-build doc indexes once, share across the team |
29
+ | **Air-gapped environments** | Full offline operation with pre-seeded models and indexes |
30
+
31
+ ---
32
+
33
+ ## Installation
34
+
35
+ ### Method 1: npm registry (recommended)
36
+
37
+ ```bash
38
+ npm install -g @lon-ask/dockit
39
+ ```
40
+
41
+ After global install, the `dockit` command is available in your PATH:
42
+
43
+ ```bash
44
+ dockit --help
45
+ dockit list
46
+ ```
47
+
48
+ ### Method 2: npx (zero-install)
49
+
50
+ Run dockit on-demand without installing anything:
10
51
 
11
52
  ```bash
12
- # 1. Clone and install
13
- git clone https://github.com/your-org/dockit.git
53
+ npx @lon-ask/dockit list
54
+ npx @lon-ask/dockit init --path ./my-project --code-path src
55
+ npx @lon-ask/dockit search my-project "authentication"
56
+ ```
57
+
58
+ `npx` downloads the package to a temp cache and executes it. Perfect for one-off usage or CI pipelines. Set `DOCKIT_DATA_DIR` to persist data across invocations.
59
+
60
+ ### Method 3: Build from source
61
+
62
+ ```bash
63
+ git clone https://github.com/karthik20/dockit.git
14
64
  cd dockit
15
65
  npm install
16
- pip3 install graphify openai # optional — for source code graphs
66
+ npm run build
67
+ npm link # makes 'dockit' available globally
68
+
69
+ pip3 install graphify # optional — for source code knowledge graphs
70
+ ```
71
+
72
+ ### Prerequisites
17
73
 
18
- # 2. Make CLI available globally
19
- npm link
74
+ | Requirement | Needed for |
75
+ |-------------|-----------|
76
+ | Node.js 18+ | Runtime |
77
+ | Python 3.8+ & pip | Graphify source code graphs (optional) |
78
+ | Graphify (`pip install graphify`) | `source-code` source type, `graphifyEnabled` on doc sources |
79
+ | Maven (`mvn`) | Maven Javadoc source type |
80
+ | Antora CLI | Antora source type (auto-installed via npm dep) |
81
+ | Git | Cloning repos for AsciiDoc, Markdown, Source Code sources |
20
82
 
21
- # 3a. Build pre-configured docs (one-time per entry)
22
- dockit build quarkus
83
+ ### Data storage
23
84
 
24
- # 3b. Or init a project with source code + markdown scanning
25
- dockit init --path /path/to/project --code-path src
85
+ All operational data lives in `~/.dockit/` by default. Override with `DOCKIT_DATA_DIR`:
26
86
 
27
- # 4. Start searching
28
- dockit search quarkus "configure cache"
29
- dockit graph query dockit "BuildUseCase" # if source-code built
87
+ ```bash
88
+ export DOCKIT_DATA_DIR=/path/to/custom/data
30
89
  ```
31
90
 
32
- ## Pre-configured Documentation
91
+ | Path | Contents |
92
+ |------|----------|
93
+ | `~/.dockit/dockit.db` | SQLite database (entries, sources, builds) |
94
+ | `~/.dockit/dockit.yaml` | Your config (auto-created by `dockit init`) |
95
+ | `~/.dockit/.lancedb/` | Vector search index (LanceDB) |
96
+ | `~/.dockit/models/` | ONNX embedding model cache |
97
+ | `~/.dockit/{entryId}/bundle/` | Built HTML docs per entry |
98
+ | `~/.dockit/{entryId}/graph.json` | Knowledge graph (source-code entries) |
33
99
 
34
- | Entry | Version | Source Type | Description |
35
- |-------|---------|-------------|-------------|
36
- | **Quarkus** | 3.35 | AsciiDoc | Quarkus framework documentation |
37
- | **Quarkus Core** | 3.35.2 | Maven Javadoc | Quarkus Core API reference |
38
- | **React** | 19 | GitHub Markdown | React library documentation |
39
- | **Spring Boot** | 3.5.x | Antora | Production-ready Spring applications |
40
- | **Spring Framework** | 7.x | Antora | Core Spring ecosystem reference |
41
- | **Quarkus Source Code** | 3.35 | Source Code | Quarkus framework source — knowledge graph |
42
- | **Quarkus (Docs + Code)** | 3.35 | AsciiDoc + Source Code | Docs + code graph combined |
43
- | **Dockit** | 1.0 | Source Code + Markdown | Self-hosted dockit project entry |
100
+ ---
44
101
 
45
- Add your own entries by editing `dockit.yaml` or using `dockit init` — see [Supported Sources](#supported-documentation-sources) below.
102
+ ## Quick Start
46
103
 
47
- ## Search Engine
104
+ ### Index your own project (30 seconds)
48
105
 
49
- Dockit ships two search engines toggleable via `dockit.yaml`:
106
+ ```bash
107
+ # From your project directory
108
+ npx @lon-ask/dockit init --code-path src
109
+
110
+ # This:
111
+ # 1. Scans all .md files → searchable docs
112
+ # 2. Runs Graphify on src/ → knowledge graph
113
+ # 3. Builds vector search index
114
+ # 4. Saves config to ~/.dockit/dockit.yaml
115
+ ```
50
116
 
51
- ```yaml
52
- search:
53
- engine: vector # 'vector' (default) | 'json' (TF-IDF fallback)
117
+ Now search:
118
+
119
+ ```bash
120
+ npx @lon-ask/dockit search my-project "authentication"
121
+ npx @lon-ask/dockit graph gods my-project
122
+ npx @lon-ask/dockit graph path my-project "createApp" "startServer"
54
123
  ```
55
124
 
56
- | | JSON (TF-IDF) | Vector (Hybrid) |
57
- |---|---|---|
58
- | **Storage per entry** | ~300 KB | ~32 MB (LanceDB) |
59
- | **Runtime memory** | Minimal | ~200 MB |
60
- | **Build time** | Fast | Slower (embeds docs via ONNX) |
61
- | **Search method** | Term-frequency scoring (title 10x, headings 3x, body 1x) | Hybrid: parallel cosine ANN + BM25 FTS → RRF fusion |
62
- | **Keyword precision** | High (exact term matches) | Very high (FTS component recovers keywords) |
63
- | **Semantic matching** | None | Yes (finds conceptually related docs even without exact terms) |
64
- | **Model** | None | `all-MiniLM-L6-v2` via `@huggingface/transformers` (~88 MB ONNX) |
65
- | **Works offline** | Yes — zero dependencies | Yes — model bundles in npm package |
125
+ ### Index framework docs
66
126
 
67
- ### How hybrid search works
127
+ ```bash
128
+ # Build pre-configured entries from dockit.yaml
129
+ dockit build quarkus # 30 min, 3500+ AsciiDoc pages → ~800 MB vector index
130
+ dockit build react # 2 min, 200+ Markdown pages
131
+ dockit build spring-boot # 15 min, Antora site
68
132
 
69
- ```
70
- query vector (cosine ANN) + BM25 (FTS) in parallel
71
- → deduplicate per-path → RRF fusion → top N
133
+ # Search across all built entries
134
+ dockit search "configure cache"
72
135
  ```
73
136
 
74
- - Vector search finds semantically related pages (e.g., "Ahead-of-Time Caching" for a cache query)
75
- - FTS recovers exact keyword matches (e.g., "caffeine" in the Caching guide)
76
- - Reciprocal Rank Fusion combines both with dynamic weighting: confident FTS gets 2x weight, uncertain FTS gets 0.7x
77
- - Title matches in FTS results get an additional 1.5x boost
137
+ ### Use with an AI agent
78
138
 
79
- ### When to use each
139
+ Add dockit as an MCP server in your AI tool's config:
80
140
 
81
- - **`json`**: Low-resource environments, fast builds, or when exact keyword matching is sufficient
82
- - **`vector`** (default): Better discovery of non-obvious matches, section-level chunking with heading context in results, hybrid search that matches both keywords and concepts
141
+ ```json
142
+ // ~/.config/opencode/opencode.json
143
+ {
144
+ "mcp": {
145
+ "dockit": {
146
+ "type": "local",
147
+ "command": ["npx", "@lon-ask/dockit", "mcp"],
148
+ "enabled": true
149
+ }
150
+ }
151
+ }
152
+ ```
83
153
 
84
- ## CLI Usage (Recommended)
154
+ The agent can then call `dockit_search`, `dockit_graph_query`, etc. automatically.
85
155
 
86
- The CLI is the primary way to interact with Dockit. Works from any directory, requires no server process, and is ideal for LLM agents that can execute shell commands.
156
+ ---
87
157
 
88
- ### Commands
158
+ ## CLI Commands
89
159
 
90
160
  | Command | Description |
91
161
  |---------|-------------|
162
+ | `dockit init --path <dir> [--code-path <sub>]` | Index a local project (markdown + source code) |
92
163
  | `dockit search [<entry>] <query>` | Search documentation |
93
- | `dockit search <query>` | Global search top result per entry |
94
- | `dockit search [<entry>] <query> --get-top [N]` | Fetch full content for top N results (default 3) |
164
+ | `dockit search [<entry>] <query> --get-top [N]` | Search + fetch full content for top N results |
95
165
  | `dockit list` | List all entries |
96
- | `dockit build <entry>` | Build documentation for an entry |
166
+ | `dockit build <entry>` | Build/rebuild documentation for an entry |
97
167
  | `dockit status <entry>` | Check build status |
98
- | `dockit get <entry> <path>` | Fetch full document content |
99
- | `dockit graph query <entry> <query>` | Search knowledge graph nodes by name, file, or type |
100
- | `dockit graph path <entry> <from> <to>` | Find shortest dependency path between two nodes |
101
- | `dockit graph gods <entry>` | List most connected (god) nodes |
102
- | `dockit graph explain <entry> <node>` | Show node details and connections |
103
- | `dockit init --path <dir> [--code-path <subdir>]` | Initialize a project as a dockit source |
104
- | `dockit dev` | Start dev servers (web UI) |
105
- | `dockit serve` | Start production server |
106
- | `dockit mcp` | Start MCP server |
168
+ | `dockit get <entry> <path>` | Fetch full document by path |
169
+ | `dockit graph query <entry> <query>` | Search knowledge graph nodes |
170
+ | `dockit graph path <entry> <from> <to>` | Find shortest dependency path |
171
+ | `dockit graph gods <entry>` | List most-connected nodes |
172
+ | `dockit graph explain <entry> <node>` | Show node details + connections |
173
+ | `dockit dev` | Start dev servers (Web UI on :5173 + API on :3001) |
174
+ | `dockit serve [--port <p>]` | Start production REST server |
175
+ | `dockit mcp` | Start MCP server for AI agents |
107
176
 
108
- ### Search Workflow
177
+ ### Flags
178
+
179
+ | Flag | Applies to | Description |
180
+ |------|-----------|-------------|
181
+ | `--json` | search, list, status, graph | Output as JSON |
182
+ | `--limit <n>` | search, graph query, graph gods | Max results |
183
+ | `--get-top [N]` | search | Fetch full content for top N (default 3) |
184
+ | `--name <n>` | init | Entry display name |
185
+ | `--version <v>` | init | Entry version string |
186
+ | `--code-path <p>` | init | Subdirectory for source code scanning |
187
+ | `--port <p>` | serve, mcp --http | Custom port |
109
188
 
110
- **Step 1: Global search** — discover which entries are relevant
189
+ ### Search workflow
111
190
 
112
191
  ```bash
192
+ # Step 1: Discover relevant entries
113
193
  dockit search "cache"
114
- # Returns top result per entry:
115
- # [React] cache
116
- # [Quarkus] caching-guide
117
- # [Quarkus Core] Cache API
194
+ # [React] cache [Quarkus] caching-guide [Quarkus Core] Cache API
195
+
196
+ # Step 2: Deep-dive into one entry with full content
197
+ dockit search quarkus "cache" --get-top 3
198
+ # → Returns plain text of top 3 matching documents
199
+
200
+ # Step 3: JSON output for scripts
201
+ dockit search react "useState" --get-top 3 --json
118
202
  ```
119
203
 
120
- **Step 2: Scoped search** — dive deeper into the chosen entry
204
+ ### Knowledge graph workflow
121
205
 
122
206
  ```bash
123
- dockit search quarkus "cache" --get-top 3
124
- # Returns full content for top 3 Quarkus cache documents
207
+ # Find nodes matching a term
208
+ dockit graph query my-project "database" --limit 5
209
+
210
+ # See the most-connected nodes (entry points, god classes)
211
+ dockit graph gods my-project
212
+
213
+ # Trace how two modules are connected
214
+ dockit graph path my-project "app.ts" "database.ts"
215
+
216
+ # Inspect a node's connections
217
+ dockit graph explain my-project "createApp"
125
218
  ```
126
219
 
127
- ### Knowledge Graph Queries
220
+ ---
128
221
 
129
- For `source-code` entries built with Graphify:
222
+ ## Supported Documentation Sources
130
223
 
131
- ```bash
132
- # Search nodes
133
- dockit graph query dockit-code "BuildUseCase"
224
+ | Type | What it indexes | Remote | Local |
225
+ |------|----------------|--------|-------|
226
+ | **GitHub Markdown** | All `.md` files in a repo | `repoUrl`, `sourcePath`, `branch` | `localPath` |
227
+ | **AsciiDoc** | `.adoc` files via Asciidoctor | `repoUrl`, `sourcePath` | `localPath`, `zipPath` |
228
+ | **Antora** | Multi-page Antora documentation sites | `repoUrl` | `localPath`, `zipPath` |
229
+ | **ZIP Bundle** | Pre-built HTML in a ZIP archive | `url` | `localPath` |
230
+ | **Maven Javadoc** | Javadoc JAR from Maven Central | — | `localJar`, `useMavenCommand` |
231
+ | **Source Code** | Knowledge graph via Graphify Tree-sitter AST | `repoUrl`, `sourcePath`, `branch` | `localPath` |
134
232
 
135
- # List most connected nodes
136
- dockit graph gods dockit-code --limit 5
233
+ ### Source code knowledge graphs
234
+
235
+ The `source-code` source type runs [Graphify](https://github.com/safishamsi/graphify) which parses your code with Tree-sitter (AST) and produces a `graph.json` containing nodes (classes, functions, files) and edges (imports, calls, inherits). No LLM required — pure static analysis. Supports TypeScript, JavaScript, Python, Java, Go, Rust, C++, and 10 more languages.
137
236
 
138
- # Find shortest path between two nodes
139
- dockit graph path dockit-code "BuildUseCase" "SourceCodeSourceProcessor"
237
+ Add `graphifyEnabled: true` to any doc source to also generate a graph alongside the docs:
140
238
 
141
- # Show node details and connections
142
- dockit graph explain dockit-code "BuildUseCase"
239
+ ```yaml
240
+ sources:
241
+ - type: github-markdown
242
+ label: "API Docs"
243
+ repoUrl: "https://github.com/myorg/myrepo.git"
244
+ sourcePath: "docs" # where .md files live
245
+ graphifyEnabled: true
246
+ graphifySourcePath: "src" # where source code lives
143
247
  ```
144
248
 
145
- ### Init a Project
249
+ ---
146
250
 
147
- ```bash
148
- # From project root — auto-detects name
149
- dockit init --code-path apps
251
+ ## Search Engine
150
252
 
151
- # With explicit path and version
152
- dockit init --path /path/to/project --name "MyApp" --version "2.0" --code-path src
253
+ Dockit ships two engines, toggled via `dockit.yaml`:
153
254
 
154
- # This creates:
155
- # - source-code source (graphify on --code-path)
156
- # - github-markdown source (scans all .md files)
157
- # - Builds both immediately
255
+ ```yaml
256
+ search:
257
+ engine: vector # 'vector' (default) | 'json' (TF-IDF)
158
258
  ```
159
259
 
160
- ### Flags
161
-
162
- | Flag | Description |
163
- |------|-------------|
164
- | `--json` | Output as JSON (for search, list, status, graph) |
165
- | `--limit <n>` | Max results (default 20) |
166
- | `--get-top [N]` | Fetch full content for top N results (default 3) |
167
- | `--port <port>` | Custom port (for serve, mcp --http) |
260
+ | | JSON (TF-IDF) | Vector (Hybrid) |
261
+ |---|---|---|
262
+ | **Storage** | ~300 KB per entry | ~32 MB per entry |
263
+ | **Memory** | Minimal | ~200 MB |
264
+ | **Build speed** | Fast | Slower (embeds all documents) |
265
+ | **Keyword match** | Exact term frequency | BM25 FTS (very high precision) |
266
+ | **Semantic match** | None | Yes (cosine ANN via all-MiniLM-L6-v2) |
267
+ | **Model** | None | 88 MB ONNX, bundled in package |
268
+ | **Offline** | Yes | Yes |
168
269
 
169
- ### Examples
270
+ ### How hybrid search works
170
271
 
171
- ```bash
172
- # Global search see which entries match
173
- dockit search "hooks"
272
+ ```
273
+ query [vector cosine ANN] + [BM25 full-text search] in parallel
274
+ deduplicate per document path
275
+ → Reciprocal Rank Fusion combining both
276
+ → dynamic FTS weighting: 2x for confident matches, 0.7x for uncertain
277
+ → title match bonus: 1.5x when query terms appear in headings
278
+ ```
174
279
 
175
- # Scoped search with full content
176
- dockit search react "how to create a hook" --get-top
280
+ ---
177
281
 
178
- # JSON output for scripts/agents
179
- dockit search react "useState" --get-top 3 --json
282
+ ## Config File (`dockit.yaml`)
180
283
 
181
- # Build documentation
182
- dockit build quarkus
183
- dockit status quarkus
284
+ After running `dockit init`, your config is at `~/.dockit/dockit.yaml`:
184
285
 
185
- # Fetch a specific document
186
- dockit get react react-docs-markdown/reference/react/hooks.html
286
+ ```yaml
287
+ entries:
288
+ - id: my-project
289
+ name: My Project
290
+ version: "1.0"
291
+ description: My project source code and documentation
292
+ sources:
293
+ - type: source-code
294
+ label: "my-project Code"
295
+ localPath: /home/user/projects/my-project
296
+ sourcePath: src
297
+ - type: github-markdown
298
+ label: "my-project Markdown"
299
+ localPath: /home/user/projects/my-project
187
300
 
188
- # Graph queries
189
- dockit graph query dockit-code "SourceCodeSourceProcessor"
190
- dockit graph gods dockit-code
301
+ search:
302
+ engine: vector
191
303
  ```
192
304
 
193
- ## MCP Server (Optional)
305
+ Config resolution order:
306
+ 1. `~/.dockit/dockit.yaml` — user home (created by `dockit init`)
307
+ 2. `./dockit.yaml` — project root (development/backward compatibility)
308
+
309
+ ---
310
+
311
+ ## LLM Integration
312
+
313
+ Dockit is designed to be an **on-demand knowledge source for AI coding agents**. Instead of relying on stale training data or hallucinated API references, LLMs can query dockit at runtime for up-to-date, project-specific documentation and source code structure.
314
+
315
+ ### How it works
316
+
317
+ Dockit ships with a **skill file** (`SKILL.md`) that teaches LLMs how to use the tool. When an LLM coding agent has access to dockit (via CLI, MCP, or shell commands), it follows this workflow:
194
318
 
195
- Dockit exposes an MCP (Model Context Protocol) server for AI tools like Claude Desktop, Cline, and OpenCode.
319
+ ```
320
+ User question → dockit search "query" → discover relevant entries
321
+ → dockit search <entry> "query" --get-top → retrieve full docs
322
+ → dockit graph query <entry> "node" → trace code structure
323
+ → Answer user with retrieved content as context
324
+ ```
325
+
326
+ The skill file instructs the LLM to:
327
+ - Strip conversational filler from queries (keep only technical terms)
328
+ - Always scope searches to the right entry once identified
329
+ - Prefer dockit documentation over training data
330
+ - Use knowledge graph queries for source-code entries
331
+ - Show attribution (source type, repo, version) with answers
196
332
 
197
333
  ### OpenCode
198
334
 
335
+ OpenCode supports multiple integration modes:
336
+
337
+ **Skill mode** (recommended) — OpenCode reads `SKILL.md` automatically from the skill registry:
338
+
339
+ ```bash
340
+ # When dockit is configured as a skill in ~/.config/opencode/skills/dockit/
341
+ # OpenCode loads SKILL.md instructions and invokes dockit CLI commands directly
342
+ opencode> "How do I configure cache in Quarkus?"
343
+ # OpenCode runs: dockit search quarkus "configure cache" --get-top
344
+ ```
345
+
346
+ **MCP mode** — dockit exposes as an MCP server for structured tool calls:
347
+
199
348
  ```json
200
- // ~/.config/opencode/opencode.json
201
349
  {
202
350
  "$schema": "https://opencode.ai/config.json",
203
351
  "mcp": {
204
352
  "dockit": {
205
353
  "type": "local",
206
- "command": ["bash", "/path/to/dockit/scripts/mcp-wrapper.sh"],
354
+ "command": ["npx", "@lon-ask/dockit", "mcp"],
207
355
  "enabled": true
208
356
  }
209
357
  }
210
358
  }
211
359
  ```
212
360
 
213
- ### Claude Desktop / Cline
361
+ **CLI mode** dockit commands are shell commands the agent can execute:
362
+
363
+ ```bash
364
+ dockit search react "useState" --get-top 3 --json
365
+ ```
366
+
367
+ ### Claude Code
368
+
369
+ Add dockit as an MCP server in Claude Code's config:
214
370
 
215
371
  ```json
216
- // ~/.claude/claude_desktop_config.json
217
372
  {
218
373
  "mcpServers": {
219
374
  "dockit": {
220
- "command": "bash",
221
- "args": ["/path/to/dockit/scripts/mcp-wrapper.sh"]
375
+ "command": "npx",
376
+ "args": ["@lon-ask/dockit", "mcp"]
222
377
  }
223
378
  }
224
379
  }
225
380
  ```
226
381
 
227
- ### HTTP Transport
382
+ Claude can then call `dockit_search`, `dockit_get_doc`, `dockit_graph_query`, and all other MCP tools directly. The skill instructions in `SKILL.md` guide it to use the right tool for each query type.
228
383
 
229
- ```bash
230
- # Start HTTP bridge on port 3456
231
- DOCKIT_MCP_HTTP_PORT=3456 ./scripts/mcp-wrapper.sh
384
+ **Claude Code with CLI fallback** — if MCP is unavailable, Claude can run dockit as a shell command:
232
385
 
233
- # Then curl:
234
- curl -X POST http://localhost:3456 \
235
- -H "Content-Type: application/json" \
236
- -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
386
+ ```bash
387
+ npx @lon-ask/dockit search quarkus "reactive routes" --get-top 3 --json
237
388
  ```
238
389
 
239
- ### MCP Tools
240
-
241
- | Tool | Description |
242
- |------|-------------|
243
- | `dockit_list_entries` | List all configured entries |
244
- | `dockit_find_entry` | Find entries by name/description |
245
- | `dockit_search` | Search within a specific entry |
246
- | `dockit_global_search` | Search across all entries |
247
- | `dockit_get_doc` | Fetch full document content |
248
- | `dockit_build` / `dockit_build_status` | Build / check status |
249
- | `dockit_graph_query` | Search knowledge graph (MCP only) |
250
- | `dockit_graph_path` | Find shortest path between nodes (MCP only) |
251
- | `dockit_graph_explain` | Node details with edges (MCP only) |
252
- | `dockit_graph_gods` | Most connected nodes (MCP only) |
253
-
254
- ## How LLMs Use Dockit
255
-
256
- Dockit includes `SKILL.md` — a skill file that instructs LLMs how to use Dockit effectively. When an LLM has access to the `dockit` CLI or MCP tools, it follows this workflow:
257
-
258
- 1. **`dockit list`** / **`dockit_list_entries`** — discover available documentation
259
- 2. **`dockit search "query"`** — global search to find relevant entries
260
- 3. **`dockit search <entry> "query" --get-top`** — scoped search with full content
261
- 4. **For source-code entries**: use `dockit graph query <entry> "node"` for structural queries
262
- 5. **Answer the user's question** using the retrieved documentation as context
263
-
264
- The LLM strips conversational filler from queries, scopes searches to the right entry, and prefers Dockit documentation over training data.
265
-
266
- ## Supported Documentation Sources
267
-
268
- | Type | Description | Remote Fields | Local/Offline Fields |
269
- |------|-------------|---------------|---------------------|
270
- | **ZIP Bundle** | Download or extract a ZIP of HTML documentation | `url` | `localPath` — path to pre-downloaded .zip |
271
- | **Maven Artifact** | Download a documentation JAR (javadoc) from Maven Central | *(none extra)* | `useMavenCommand: true` — uses local Maven + settings.xml; `localJar` — path to pre-downloaded .jar |
272
- | **Antora** | Build a multi-page HTML site with Antora | `repoUrl` | `localPath` — path to pre-cloned repo |
273
- | **AsciiDoc** | Convert `.adoc` files to HTML | `repoUrl`, `sourcePath` (optional) | `localPath` — path to pre-cloned repo |
274
- | **GitHub Markdown** | Clone a GitHub repo and convert `.md` files to HTML | `repoUrl`, `sourcePath` (optional), `branch` (optional) | `localPath` — path to pre-cloned repo |
275
- | **Source Code** | Build a knowledge graph via Graphify (Tree-sitter AST) | `repoUrl`, `sourcePath` (optional), `branch` (optional) | `localPath` — path to local repo |
276
- | **Combined** | Add `graphifyEnabled: true` on doc sources (AsciiDoc, Markdown, Antora) to also generate a graph | *(inherits from parent type)* | *(inherits from parent type)* |
277
-
278
- ### Source code knowledge graphs
279
-
280
- The `source-code` source type runs [Graphify](https://github.com/anomalyco/graphify) (Tree-sitter AST parser) on the source directory, producing a `graph.json` with nodes (classes, functions, files) and edges (imports, calls, inherits). Supports 15+ languages including TypeScript, JavaScript, Python, Java, Go, Rust, and C++.
281
-
282
- **Configuration fields:**
390
+ ### Cline (VS Code)
283
391
 
284
- | Field | Description |
285
- |-------|-------------|
286
- | `repoUrl` / `localPath` / `zipPath` | Source acquisition (same pattern as other types) |
287
- | `sourcePath` | Subdirectory to scan for code files |
288
- | `graphifySourcePath` | Separate subdirectory for graphify (when different from sourcePath e.g. docs vs code) |
289
-
290
- For existing doc sources (AsciiDoc, GitHub Markdown, Antora) that point to a repo containing source code, toggle `graphifyEnabled: true` and set `graphifySourcePath` to scan the code during build:
291
-
292
- ```yaml
293
- sources:
294
- - type: asciidoc
295
- label: "Docs"
296
- repoUrl: "https://github.com/myorg/myrepo.git"
297
- sourcePath: "docs" # doc files
298
- graphifyEnabled: true
299
- graphifySourcePath: "src" # code files for graph
392
+ ```json
393
+ {
394
+ "mcpServers": {
395
+ "dockit": {
396
+ "command": "npx",
397
+ "args": ["@lon-ask/dockit", "mcp"]
398
+ }
399
+ }
400
+ }
300
401
  ```
301
402
 
302
- ## Offline / Proxy Mode
403
+ ### General LLM Integration
303
404
 
304
- For environments behind corporate proxies or without internet access, Dockit supports multiple fallback mechanisms:
405
+ Any LLM that can execute shell commands or make HTTP requests can use dockit:
305
406
 
306
- ### Source Repositories (local clones)
407
+ **Via CLI (shell access)**:
408
+ ```bash
409
+ # Build an entry
410
+ npx @lon-ask/dockit build react
411
+ # Search with full content
412
+ npx @lon-ask/dockit search react "hooks" --get-top 3 --json
413
+ # Query knowledge graph
414
+ npx @lon-ask/dockit graph gods my-project --json
415
+ ```
307
416
 
308
- Each source type supports local paths that take precedence over remote URLs:
417
+ **Via REST API** (when server is running):
418
+ ```bash
419
+ dockit serve --port 3001 &
420
+ curl "http://localhost:3001/api/entries/react/search?q=hooks"
421
+ curl "http://localhost:3001/api/graph/my-project/query?q=database"
422
+ ```
309
423
 
310
- ```yaml
311
- # dockit.yaml — local mode entries
312
- entries:
313
- - id: quarkus-local
314
- name: Quarkus (Local)
315
- version: "3.35"
316
- sources:
317
- - type: asciidoc
318
- label: "Quarkus Docs"
319
- localPath: "/home/user/repos/quarkus"
320
- sourcePath: "docs/src/main/asciidoc"
424
+ **Via HTTP MCP bridge**:
425
+ ```bash
426
+ DOCKIT_MCP_HTTP_PORT=3456 npx @lon-ask/dockit mcp --http &
427
+ curl -X POST http://localhost:3456 \
428
+ -H "Content-Type: application/json" \
429
+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"dockit_search","arguments":{"entry":"react","query":"hooks"}}}'
321
430
  ```
322
431
 
323
- ### Embedding Model (air-gapped vector search)
432
+ ### Skills Registry
433
+
434
+ Dockit's `SKILL.md` is also registered as a skill file. When placed in an LLM agent's skill directory, it provides:
324
435
 
325
- The embedding model downloads on first `embed()` call by default into `~/.dockit/models/`. Override with `DOCKIT_DATA_DIR` or `configure({ cacheDir: '...' })`. For air-gapped environments:
436
+ 1. **Tool instructions** which commands to use and when
437
+ 2. **Query refinement rules** — stripping filler, keeping technical terms
438
+ 3. **Workflow patterns** — discover → search → retrieve → graph
439
+ 4. **Attribution rules** — always cite source type, repo, version
326
440
 
327
- **Option A Pre-seed on connected machine, then copy:**
441
+ To register dockit as a skill:
328
442
  ```bash
329
- # On connected machine
330
- npm run download-model -w packages/embeddings
443
+ # For OpenCode
444
+ cp SKILL.md ~/.config/opencode/skills/dockit/SKILL.md
331
445
 
332
- # Copy ~/.dockit/models/ to the target machine
446
+ # For other agents that support skill files, place SKILL.md in their skills directory
333
447
  ```
334
448
 
335
- **Option B Install offline via npm:**
336
- The model ONNX bundle ships inside the `@dockit/embeddings` npm package under `packages/embeddings/model/`. If `~/.dockit/models/` is empty at first `embed()` call, it will attempt to download — set `DOCKIT_DATA_DIR` to point to a pre-seeded directory or use `configure({ cacheDir: '/path/to/model' })`.
449
+ ### MCP Tools Reference
337
450
 
338
- ### Pre-built Index Bundling
451
+ | Tool | Description |
452
+ |------|-------------|
453
+ | `dockit_list_entries` | List all configured entries |
454
+ | `dockit_find_entry` | Find entries by name/description |
455
+ | `dockit_search` | Search within a specific entry |
456
+ | `dockit_global_search` | Search across all entries |
457
+ | `dockit_get_doc` | Fetch full document content |
458
+ | `dockit_build` | Build documentation for an entry |
459
+ | `dockit_build_status` | Check build status |
460
+ | `dockit_graph_query` | Search knowledge graph nodes |
461
+ | `dockit_graph_path` | Find dependency path between two nodes |
462
+ | `dockit_graph_explain` | Show node details and connections |
463
+ | `dockit_graph_gods` | List most-connected (god) nodes |
339
464
 
340
- For environments where even building is impractical, LanceDB and JSON indexes can be pre-built and bundled:
465
+ ---
341
466
 
342
- 1. Build indexes on a connected machine:
343
- ```bash
344
- dockit build quarkus
345
- dockit build spring-boot
346
- # ... all desired entries
347
- ```
348
- 2. Package the `~/.dockit/` directory (or specific `.lancedb/` + `index.json` files)
349
- 3. Deploy to target machines via the same `~/.dockit/` path
467
+ ## Web UI
350
468
 
351
- ### Proxy Configuration
469
+ Dockit includes a React-based graphical interface for managing entries, configuring sources, and browsing documentation. It runs alongside the API server.
352
470
 
353
- Standard proxy environment variables:
471
+ ### Starting the UI
354
472
 
355
473
  ```bash
356
- export HTTP_PROXY=http://proxy.corp:8080
357
- export HTTPS_PROXY=http://proxy.corp:8080
358
- ```
359
-
360
- Or override the HuggingFace CDN host via code:
474
+ # Development mode — starts both API server + Vite dev UI concurrently
475
+ npx @lon-ask/dockit dev
476
+ # API → http://localhost:3001
477
+ # UI → http://localhost:5173
361
478
 
362
- ```ts
363
- import { env } from '@huggingface/transformers';
364
- env.remoteHost = 'https://internal-mirror.corp'; // point to internal mirror
479
+ # Production mode — API server only (UI not served yet)
480
+ npx @lon-ask/dockit serve --port 3001
365
481
  ```
366
482
 
367
- ### Native Binaries
483
+ > **Note**: The first `npx` run downloads `tsx` and `vite` (if not locally cached). Subsequent runs use the cached versions and start within seconds.
368
484
 
369
- `@lancedb/lancedb` ships prebuilt binaries for linux x64/arm64, macOS x64/arm64, and Windows x64/arm64 — no compilation needed.
485
+ ### How it works under the hood
370
486
 
371
- ### Additional offline fields
487
+ `dockit dev` spawns two processes in parallel:
488
+ - **API server** — `npx tsx watch apps/server/src/index.ts` (Express + TypeScript, hot reload)
489
+ - **Web UI** — `npx vite apps/client` (React dev server with HMR, port 5173)
372
490
 
373
- | Source Type | Fields (all take precedence over remote) |
374
- |-------------|------------------------------------------|
375
- | **ZIP** | `localPath` — path to pre-downloaded .zip |
376
- | **Maven** | `useMavenCommand: true` — uses local `~/.m2/settings.xml` (proxies, mirrors); `localJar` — pre-downloaded .jar |
377
- | **Antora** | `localPath` — pre-cloned repo |
378
- | **AsciiDoc** | `localPath` — pre-cloned repo (kept, not cleaned up) |
379
- | **GitHub Markdown** | `localPath` — pre-cloned repo |
380
- | **Source Code** | `localPath` — local repo directory |
491
+ The UI proxies `/api/*` requests to the API server at `localhost:3001`. Both processes terminate on Ctrl+C.
381
492
 
382
- ## Web UI (Optional)
493
+ ### What the UI provides
383
494
 
384
- Dockit includes a web interface for managing entries, configuring sources, and browsing documentation.
495
+ | Feature | Description |
496
+ |---------|-------------|
497
+ | **Entry management** | Create, edit, and delete documentation entries via a form |
498
+ | **Source configuration** | Add/remove/reorder sources per entry — supports all 6 source types (ZIP, Maven, Antora, AsciiDoc, GitHub Markdown, Source Code) |
499
+ | **Source form** | Mode selector (Git Repo / Local Dir / ZIP File), Graphify toggle with source path field |
500
+ | **Build triggering** | One-click build with live streaming logs |
501
+ | **Download script** | Export build as a self-contained `.sh` script (for CI/reproducible builds) |
502
+ | **Document viewer** | Browse built HTML docs in the browser |
503
+ | **Entry detail** | Shows all sources, graph status badge (Network icon when graphify is enabled), build history |
504
+ | **Status badges** | Quick visual indicators for entry status (pending/building/ready/error) per source |
385
505
 
386
- ```bash
387
- # Start dev servers
388
- dockit dev
389
- # Or: npm run dev
506
+ ### What it shows
390
507
 
391
- # Frontend http://localhost:5173
392
- # Backend → http://localhost:3001
393
- ```
508
+ The UI surfaces the same data as the CLI, but visually:
394
509
 
395
- 1. Open http://localhost:5173 in your browser
396
- 2. Click **New Entry** in the sidebar
397
- 3. Add sources (including **Source Code** type) and click **Build Now**
398
- 4. For doc sources with repos, toggle **Generate source code knowledge graph** and set the **Source Code Path**
399
- 5. Use the embedded viewer to browse, or search across indexed content
510
+ 1. **Sidebar** list of all entries with status badges
511
+ 2. **Entry page** entry metadata (name, version, description) + sources list + build controls
512
+ 3. **Source editor** — configure type, URL/path, source path, graphify toggle
513
+ 4. **Build log** real-time output stream during builds
514
+ 5. **Graph status** which entries have knowledge graphs built
400
515
 
401
- ### Build Modes
516
+ ### Architecture
402
517
 
403
- - **Build Now** — server-side processing with live log output
404
- - **Download Script** exports a self-contained `.sh` script with all curl commands
518
+ ```
519
+ Browser (port 5173) ←→ API Server (port 3001)
520
+
521
+ SQLite DB + LanceDB + ~/.dockit/
522
+ ```
405
523
 
406
- ## Data Storage
524
+ The UI communicates with the Express API via REST endpoints (`/api/entries`, `/api/sources`, `/api/build`, etc.). All data CRUD, search, and build operations are done through the same API that the CLI and MCP server use.
407
525
 
408
- All runtime data is stored in `~/.dockit/` by default:
526
+ ---
409
527
 
410
- | Path | Description |
411
- |------|-------------|
412
- | `~/.dockit/dockit.db` | SQLite database (entries, sources, builds) |
413
- | `~/.dockit/dockit.yaml` | User configuration (auto-created by `dockit init`) |
414
- | `~/.dockit/.lancedb/` | Vector search index (LanceDB) |
415
- | `~/.dockit/models/` | HuggingFace ONNX embedding model cache |
416
- | `~/.dockit/{entryId}/bundle/` | Built HTML documentation per entry |
417
- | `~/.dockit/{entryId}/sources/` | Raw source processing artifacts |
418
- | `~/.dockit/{entryId}/graph.json` | Knowledge graph (source-code entries) |
528
+ ## Offline / Air-Gapped Mode
419
529
 
420
- Override with the environment variable:
530
+ Dockit is designed for full offline operation:
421
531
 
422
- ```bash
423
- export DOCKIT_DATA_DIR=/custom/path # all data goes here instead of ~/.dockit/
424
- ```
532
+ | Concern | Solution |
533
+ |---------|----------|
534
+ | **No internet** | All models bundled in npm package, LanceDB is embedded (Rust native) |
535
+ | **Corporate proxy** | Set `HTTP_PROXY`/`HTTPS_PROXY` env vars |
536
+ | **Pre-built indexes** | Build on connected machine, copy `~/.dockit/` to target |
537
+ | **Embedding model** | Ships as ONNX (~88 MB). Caches to `~/.dockit/models/` |
538
+ | **Source repos** | Clone once locally, reference via `localPath` in config |
539
+ | **Maven Javadoc** | Download JAR once, reference via `localJar` or use local Maven settings |
425
540
 
426
- Configuration (`dockit.yaml`) is resolved in order:
427
- 1. `~/.dockit/dockit.yaml` (user home, persisted by `dockit init`)
428
- 2. Project root `dockit.yaml` (backward compatibility for development)
541
+ ---
429
542
 
430
543
  ## Architecture
431
544
 
432
545
  ```
433
- dockit/
546
+ dockit/ # npm package @lon-ask/dockit
547
+ ├── bin/
548
+ │ ├── dockit.js # CLI entry point (shebang node)
549
+ │ ├── dockit-cli.ts # Command router
550
+ │ ├── commands/ # search, build, graph, init, get, list, dev, mcp
551
+ │ └── utils.ts # Shared CLI helpers
434
552
  ├── apps/
435
- │ ├── server/ Express + TypeScript backend (port 3001)
553
+ │ ├── server/ # Express backend (port 3001)
436
554
  │ │ └── src/
437
- │ │ ├── core/domain/ Domain types & knowledge-graph types
438
- │ │ ├── core/ports/ IKnowledgeGraph, ISourceProcessor + ports
439
- │ │ ├── core/usecases/ BuildUseCase, ConfigUseCase, SearchUseCase
440
- │ │ ├── infrastructure/graph/ GraphifyKnowledgeGraph, GraphSearchDecorator
441
- │ ├── infrastructure/source-processors/ SourceCodeSourceProcessor + others
442
- │ │ └── routes/graph.ts Graph REST endpoints
443
- │ └── client/ React + Vite + Tailwind CSS frontend (port 5173)
444
- ├── bin/ CLI entry point, graph commands, init command
555
+ │ │ ├── core/ # Domain types, ports, use cases
556
+ │ │ ├── infrastructure/ # SQLite, LanceDB, Graphify, processors
557
+ │ │ ├── routes/ # REST API, graph endpoints, viewer
558
+ │ │ └── services/ # Config loader, text extractor, normalizer
559
+ └── client/ # React + Vite web UI (port 5173)
445
560
  ├── packages/
446
- │ └── embeddings/ @dockit/embeddings — ONNX model wrapper (@huggingface/transformers)
447
- ├── ~/.dockit/ Runtime data (created automatically on first run)
448
- ├── dockit.db SQLite database
449
- ├── dockit.yaml Entries/sources config (auto-created by `dockit init`)
450
- ├── .lancedb/ Vector search index
451
- │ ├── models/ HuggingFace ONNX embedding model cache
452
- │ ├── {entryId}/bundle/ Build outputs per entry
453
- │ ├── {entryId}/sources/ Raw source processing artifacts
454
- │ └── {entryId}/graph.json Knowledge graph (source-code entries)
455
- ├── dockit.yaml Entries/sources config
456
- ├── SKILL.md LLM skill instructions
457
- ├── GRAPHIFY_SOURCE_PLAN.md Graphify feature plan
458
- └── package.json npm workspace root
459
- ```
460
-
461
- ## API Overview
561
+ │ └── embeddings/ # @lon-ask/dockit-embeddings
562
+ │ └── model/ # all-MiniLM-L6-v2 ONNX (88 MB)
563
+ ├── scripts/
564
+ └── mcp-wrapper.sh # MCP server launcher
565
+ ├── dockit.yaml # Example config
566
+ └── SKILL.md # LLM agent instructions
567
+ ```
568
+
569
+ Runtime data (auto-created):
570
+ ```
571
+ ~/.dockit/
572
+ ├── dockit.db # SQLite (entries, sources, builds)
573
+ ├── dockit.yaml # Your config
574
+ ├── .lancedb/ # Vector search index
575
+ ├── models/ # Embedding model cache
576
+ └── {entryId}/
577
+ ├── bundle/ # Normalized HTML docs
578
+ ├── sources/ # Raw processing artifacts
579
+ └── graph.json # Knowledge graph
580
+ ```
581
+
582
+ ---
583
+
584
+ ## API Reference
462
585
 
463
586
  | Method | Path | Purpose |
464
587
  |--------|------|---------|
465
- | `GET` | `/api/entries` | List entries |
466
- | `POST` | `/api/entries` | Create entry |
467
- | `GET` | `/api/entries/:id` | Get entry detail + sources |
468
- | `PUT` | `/api/entries/:id` | Update entry |
469
- | `DELETE` | `/api/entries/:id` | Delete entry + all data |
470
- | `POST` | `/api/entries/:id/sources` | Add source to entry |
471
- | `PUT` | `/api/sources/:id` | Update source |
472
- | `DELETE` | `/api/sources/:id` | Remove source |
473
- | `POST` | `/api/entries/:id/build` | Trigger build |
474
- | `GET` | `/api/entries/:id/build-status` | Poll build progress |
475
- | `GET` | `/api/entries/:id/cli-script` | Download CLI script |
476
- | `GET` | `/api/graph/:entry/query?q=...` | Search knowledge graph nodes |
477
- | `GET` | `/api/graph/:entry/path?from=...&to=...` | Find path between nodes |
478
- | `GET` | `/api/graph/:entry/gods` | List most connected nodes |
479
- | `GET` | `/api/entries/:id/search?q=term` | Search built docs |
480
- | `GET` | `/api/bundle/:entryId/*` | Serve bundled HTML |
588
+ | `GET` | `/api/entries` | List entries |
589
+ | `POST` | `/api/entries` | Create entry |
590
+ | `GET` | `/api/entries/:id` | Get entry detail |
591
+ | `PUT` | `/api/entries/:id` | Update entry |
592
+ | `DELETE` | `/api/entries/:id` | Delete entry |
593
+ | `POST` | `/api/entries/:id/sources` | Add source |
594
+ | `PUT` | `/api/sources/:id` | Update source |
595
+ | `DELETE` | `/api/sources/:id` | Remove source |
596
+ | `POST` | `/api/entries/:id/build` | Trigger build |
597
+ | `GET` | `/api/entries/:id/build-status` | Poll build |
598
+ | `GET` | `/api/entries/:id/cli-script` | Download CLI script |
599
+ | `GET` | `/api/graph/:entry/query?q=...` | Graph node search |
600
+ | `GET` | `/api/graph/:entry/path?from=...&to=...` | Graph path find |
601
+ | `GET` | `/api/graph/:entry/gods` | Graph god nodes |
602
+ | `GET` | `/api/entries/:id/search?q=term` | Search docs |
603
+ | `GET` | `/api/bundle/:entryId/*` | Serve HTML |
604
+
605
+ ---
481
606
 
482
607
  ## Tech Stack
483
608
 
484
609
  | Layer | Technology |
485
610
  |-------|-----------|
486
- | Frontend | React 19, TypeScript, Vite 6, Tailwind CSS 4, React Router 7 |
487
- | Backend | Express 4, TypeScript, tsx |
611
+ | CLI | Node.js, tsx (TypeScript runtime) |
612
+ | Backend | Express 4, TypeScript |
488
613
  | Database | SQLite via better-sqlite3 |
489
- | MCP | @modelcontextprotocol/server 2.0.0-alpha.2 |
490
- | HTML Parsing | node-html-parser |
614
+ | Vector Search | LanceDB (embedded Rust) |
615
+ | Embeddings | all-MiniLM-L6-v2 ONNX via @huggingface/transformers |
616
+ | Frontend | React 19, Vite 6, Tailwind CSS 4 |
617
+ | MCP | @modelcontextprotocol/server v2 |
618
+ | HTML/MD Parse | node-html-parser, marked |
491
619
  | AsciiDoc | @asciidoctor/core |
620
+ | Antora | @antora/cli + @antora/site-generator |
492
621
  | Archives | unzipper |
493
- | Build Pipeline | Antora CLI, Git, Maven dependency plugin |
494
- | Markdown | marked |
495
- | Vector Search | LanceDB embedded (Rust native), all-MiniLM-L6-v2 via @huggingface/transformers |
496
622
  | Knowledge Graph | Graphify (Tree-sitter AST, 15+ languages) |
623
+
624
+ ---
625
+
626
+ ## Credits
627
+
628
+ Dockit was built with the assistance of the following LLMs and tools:
629
+
630
+ | Contributor | Role |
631
+ |------------|------|
632
+ | **[OpenCode](https://opencode.ai)** | Primary development agent — architecture, code generation, code review, CLI tooling, MCP server, graph features, npm publishing pipeline |
633
+ | **[DeepSeek](https://deepseek.com)** | Strategic architecture planning, feature design, documentation writing, test planning |
634
+
635
+ Special thanks to:
636
+
637
+ | Tool | Used for |
638
+ |------|---------|
639
+ | **[Graphify](https://github.com/safishamsi/graphify)** | Tree-sitter AST source code knowledge graphs |
640
+ | **[LanceDB](https://lancedb.com)** | Embedded vector search |
641
+ | **[OpenCode](https://opencode.ai)** | Interactive CLI agent framework that orchestrated the entire build pipeline |