@lon-ask/dockit 0.1.0 → 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.
- package/README.md +482 -337
- package/SKILL.md +94 -103
- package/apps/client/index.html +12 -0
- package/apps/client/package.json +26 -0
- package/apps/client/src/App.tsx +18 -0
- package/apps/client/src/api/client.ts +54 -0
- package/apps/client/src/components/BuildPanel.tsx +77 -0
- package/apps/client/src/components/DocViewer.tsx +76 -0
- package/apps/client/src/components/EntryDetail.tsx +322 -0
- package/apps/client/src/components/EntryForm.tsx +117 -0
- package/apps/client/src/components/EntryList.tsx +165 -0
- package/apps/client/src/components/GlobalSearchBar.tsx +166 -0
- package/apps/client/src/components/Layout.tsx +57 -0
- package/apps/client/src/components/SearchBar.tsx +103 -0
- package/apps/client/src/components/SourceForm.tsx +497 -0
- package/apps/client/src/hooks/useTheme.ts +19 -0
- package/apps/client/src/index.css +77 -0
- package/apps/client/src/main.tsx +13 -0
- package/apps/client/src/types.ts +105 -0
- package/apps/client/vite.config.ts +13 -0
- package/apps/server/dist/core/domain/entry.js +20 -0
- package/apps/server/dist/core/domain/entry.js.map +1 -0
- package/apps/server/dist/core/domain/errors.js +33 -0
- package/apps/server/dist/core/domain/errors.js.map +1 -0
- package/apps/server/dist/core/domain/knowledge-graph.js +2 -0
- package/apps/server/dist/core/domain/knowledge-graph.js.map +1 -0
- package/apps/server/dist/core/domain/types.js +2 -0
- package/apps/server/dist/core/domain/types.js.map +1 -0
- package/apps/server/dist/core/ports/IBuildRepository.js +2 -0
- package/apps/server/dist/core/ports/IBuildRepository.js.map +1 -0
- package/apps/server/dist/core/ports/IDocumentNormalizer.js +2 -0
- package/apps/server/dist/core/ports/IDocumentNormalizer.js.map +1 -0
- package/apps/server/dist/core/ports/IDocumentStore.js +2 -0
- package/apps/server/dist/core/ports/IDocumentStore.js.map +1 -0
- package/apps/server/dist/core/ports/IEntryReadModel.js +2 -0
- package/apps/server/dist/core/ports/IEntryReadModel.js.map +1 -0
- package/apps/server/dist/core/ports/IEntryRepository.js +2 -0
- package/apps/server/dist/core/ports/IEntryRepository.js.map +1 -0
- package/apps/server/dist/core/ports/IKnowledgeGraph.js +2 -0
- package/apps/server/dist/core/ports/IKnowledgeGraph.js.map +1 -0
- package/apps/server/dist/core/ports/IPathResolver.js +2 -0
- package/apps/server/dist/core/ports/IPathResolver.js.map +1 -0
- package/apps/server/dist/core/ports/ISearchEngine.js +2 -0
- package/apps/server/dist/core/ports/ISearchEngine.js.map +1 -0
- package/apps/server/dist/core/ports/ISourceProcessor.js +2 -0
- package/apps/server/dist/core/ports/ISourceProcessor.js.map +1 -0
- package/apps/server/dist/core/ports/ISourceRepository.js +2 -0
- package/apps/server/dist/core/ports/ISourceRepository.js.map +1 -0
- package/apps/server/dist/core/usecases/BuildUseCase.js +76 -0
- package/apps/server/dist/core/usecases/BuildUseCase.js.map +1 -0
- package/apps/server/dist/core/usecases/ConfigUseCase.js +62 -0
- package/apps/server/dist/core/usecases/ConfigUseCase.js.map +1 -0
- package/apps/server/dist/core/usecases/SearchUseCase.js +17 -0
- package/apps/server/dist/core/usecases/SearchUseCase.js.map +1 -0
- package/apps/server/dist/index.js +86 -0
- package/apps/server/dist/index.js.map +1 -0
- package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js +25 -0
- package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js +42 -0
- package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js +145 -0
- package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/index.js +3 -0
- package/apps/server/dist/infrastructure/graph/index.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js +21 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js +11 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js +59 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js +47 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/connection.js +50 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/connection.js.map +1 -0
- package/apps/server/dist/infrastructure/search/SearchEngineFactory.js +32 -0
- package/apps/server/dist/infrastructure/search/SearchEngineFactory.js.map +1 -0
- package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js +147 -0
- package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js.map +1 -0
- package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js +23 -0
- package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js.map +1 -0
- package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js +378 -0
- package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js +11 -0
- package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js +11 -0
- package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/PathResolver.js +5 -0
- package/apps/server/dist/infrastructure/source-processors/PathResolver.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js +261 -0
- package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js.map +1 -0
- package/apps/server/dist/mcp-http.js +93 -0
- package/apps/server/dist/mcp-http.js.map +1 -0
- package/apps/server/dist/mcp.js +339 -0
- package/apps/server/dist/mcp.js.map +1 -0
- package/apps/server/dist/routes/build.js +89 -0
- package/apps/server/dist/routes/build.js.map +1 -0
- package/apps/server/dist/routes/entries.js +52 -0
- package/apps/server/dist/routes/entries.js.map +1 -0
- package/apps/server/dist/routes/graph.js +58 -0
- package/apps/server/dist/routes/graph.js.map +1 -0
- package/apps/server/dist/routes/search.js +24 -0
- package/apps/server/dist/routes/search.js.map +1 -0
- package/apps/server/dist/routes/sources.js +100 -0
- package/apps/server/dist/routes/sources.js.map +1 -0
- package/apps/server/dist/routes/viewer.js +22 -0
- package/apps/server/dist/routes/viewer.js.map +1 -0
- package/apps/server/dist/services/antora.js +222 -0
- package/apps/server/dist/services/antora.js.map +1 -0
- package/apps/server/dist/services/asciidoc.js +206 -0
- package/apps/server/dist/services/asciidoc.js.map +1 -0
- package/apps/server/dist/services/configLoader.js +150 -0
- package/apps/server/dist/services/configLoader.js.map +1 -0
- package/apps/server/dist/services/githubMarkdown.js +221 -0
- package/apps/server/dist/services/githubMarkdown.js.map +1 -0
- package/apps/server/dist/services/maven.js +148 -0
- package/apps/server/dist/services/maven.js.map +1 -0
- package/apps/server/dist/services/normalizer.js +42 -0
- package/apps/server/dist/services/normalizer.js.map +1 -0
- package/apps/server/dist/services/paths.js +5 -0
- package/apps/server/dist/services/paths.js.map +1 -0
- package/apps/server/dist/services/textExtractor.js +46 -0
- package/apps/server/dist/services/textExtractor.js.map +1 -0
- package/apps/server/dist/services/zip.js +63 -0
- package/apps/server/dist/services/zip.js.map +1 -0
- package/apps/server/package.json +38 -0
- package/apps/server/src/infrastructure/search/vector/EmbeddingService.ts +1 -1
- package/bin/commands/dev.ts +2 -2
- package/bin/commands/serve.ts +2 -2
- package/package.json +18 -3
package/README.md
CHANGED
|
@@ -1,496 +1,641 @@
|
|
|
1
1
|
# Dockit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Built with [OpenCode](https://opencode.ai) and [DeepSeek](https://deepseek.com)
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+
## Why Dockit
|
|
8
9
|
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
dockit build quarkus
|
|
83
|
+
### Data storage
|
|
23
84
|
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
102
|
+
## Quick Start
|
|
46
103
|
|
|
47
|
-
|
|
104
|
+
### Index your own project (30 seconds)
|
|
48
105
|
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
71
|
-
→ deduplicate per-path → RRF fusion → top N
|
|
133
|
+
# Search across all built entries
|
|
134
|
+
dockit search "configure cache"
|
|
72
135
|
```
|
|
73
136
|
|
|
74
|
-
|
|
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
|
-
|
|
139
|
+
Add dockit as an MCP server in your AI tool's config:
|
|
80
140
|
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
154
|
+
The agent can then call `dockit_search`, `dockit_graph_query`, etc. automatically.
|
|
85
155
|
|
|
86
|
-
|
|
156
|
+
---
|
|
87
157
|
|
|
88
|
-
|
|
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
|
|
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
|
|
99
|
-
| `dockit graph query <entry> <query>` | Search knowledge graph nodes
|
|
100
|
-
| `dockit graph path <entry> <from> <to>` | Find shortest dependency path
|
|
101
|
-
| `dockit graph gods <entry>` | List most
|
|
102
|
-
| `dockit graph explain <entry> <node>` | Show node details
|
|
103
|
-
| `dockit
|
|
104
|
-
| `dockit
|
|
105
|
-
| `dockit
|
|
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
|
-
###
|
|
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
|
-
|
|
189
|
+
### Search workflow
|
|
111
190
|
|
|
112
191
|
```bash
|
|
192
|
+
# Step 1: Discover relevant entries
|
|
113
193
|
dockit search "cache"
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
#
|
|
117
|
-
|
|
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
|
-
|
|
204
|
+
### Knowledge graph workflow
|
|
121
205
|
|
|
122
206
|
```bash
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
220
|
+
---
|
|
128
221
|
|
|
129
|
-
|
|
222
|
+
## Supported Documentation Sources
|
|
130
223
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
142
|
-
|
|
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
|
-
|
|
249
|
+
---
|
|
146
250
|
|
|
147
|
-
|
|
148
|
-
# From project root — auto-detects name
|
|
149
|
-
dockit init --code-path apps
|
|
251
|
+
## Search Engine
|
|
150
252
|
|
|
151
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
#
|
|
157
|
-
# - Builds both immediately
|
|
255
|
+
```yaml
|
|
256
|
+
search:
|
|
257
|
+
engine: vector # 'vector' (default) | 'json' (TF-IDF)
|
|
158
258
|
```
|
|
159
259
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
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
|
-
###
|
|
270
|
+
### How hybrid search works
|
|
170
271
|
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
dockit search react "how to create a hook" --get-top
|
|
280
|
+
---
|
|
177
281
|
|
|
178
|
-
|
|
179
|
-
dockit search react "useState" --get-top 3 --json
|
|
282
|
+
## Config File (`dockit.yaml`)
|
|
180
283
|
|
|
181
|
-
|
|
182
|
-
dockit build quarkus
|
|
183
|
-
dockit status quarkus
|
|
284
|
+
After running `dockit init`, your config is at `~/.dockit/dockit.yaml`:
|
|
184
285
|
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
dockit graph gods dockit-code
|
|
301
|
+
search:
|
|
302
|
+
engine: vector
|
|
191
303
|
```
|
|
192
304
|
|
|
193
|
-
|
|
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
|
-
|
|
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": ["
|
|
354
|
+
"command": ["npx", "@lon-ask/dockit", "mcp"],
|
|
207
355
|
"enabled": true
|
|
208
356
|
}
|
|
209
357
|
}
|
|
210
358
|
}
|
|
211
359
|
```
|
|
212
360
|
|
|
213
|
-
|
|
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": "
|
|
221
|
-
"args": ["/
|
|
375
|
+
"command": "npx",
|
|
376
|
+
"args": ["@lon-ask/dockit", "mcp"]
|
|
222
377
|
}
|
|
223
378
|
}
|
|
224
379
|
}
|
|
225
380
|
```
|
|
226
381
|
|
|
227
|
-
|
|
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
|
-
|
|
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
|
-
|
|
234
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
403
|
+
### General LLM Integration
|
|
303
404
|
|
|
304
|
-
|
|
405
|
+
Any LLM that can execute shell commands or make HTTP requests can use dockit:
|
|
305
406
|
|
|
306
|
-
|
|
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
|
-
|
|
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
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
441
|
+
To register dockit as a skill:
|
|
328
442
|
```bash
|
|
329
|
-
#
|
|
330
|
-
|
|
443
|
+
# For OpenCode
|
|
444
|
+
cp SKILL.md ~/.config/opencode/skills/dockit/SKILL.md
|
|
331
445
|
|
|
332
|
-
#
|
|
446
|
+
# For other agents that support skill files, place SKILL.md in their skills directory
|
|
333
447
|
```
|
|
334
448
|
|
|
335
|
-
|
|
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
|
-
|
|
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
|
-
|
|
465
|
+
---
|
|
341
466
|
|
|
342
|
-
|
|
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
|
-
|
|
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
|
-
|
|
471
|
+
### Starting the UI
|
|
354
472
|
|
|
355
473
|
```bash
|
|
356
|
-
|
|
357
|
-
|
|
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
|
-
|
|
363
|
-
|
|
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
|
-
|
|
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
|
-
|
|
485
|
+
### How it works under the hood
|
|
370
486
|
|
|
371
|
-
|
|
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
|
-
|
|
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
|
-
|
|
493
|
+
### What the UI provides
|
|
383
494
|
|
|
384
|
-
|
|
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
|
-
|
|
387
|
-
# Start dev servers
|
|
388
|
-
dockit dev
|
|
389
|
-
# Or: npm run dev
|
|
506
|
+
### What it shows
|
|
390
507
|
|
|
391
|
-
|
|
392
|
-
# Backend → http://localhost:3001
|
|
393
|
-
```
|
|
508
|
+
The UI surfaces the same data as the CLI, but visually:
|
|
394
509
|
|
|
395
|
-
1.
|
|
396
|
-
2.
|
|
397
|
-
3.
|
|
398
|
-
4.
|
|
399
|
-
5.
|
|
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
|
-
###
|
|
516
|
+
### Architecture
|
|
402
517
|
|
|
403
|
-
|
|
404
|
-
|
|
518
|
+
```
|
|
519
|
+
Browser (port 5173) ←→ API Server (port 3001)
|
|
520
|
+
↓
|
|
521
|
+
SQLite DB + LanceDB + ~/.dockit/
|
|
522
|
+
```
|
|
405
523
|
|
|
406
|
-
|
|
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
|
-
|
|
526
|
+
---
|
|
409
527
|
|
|
410
|
-
|
|
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
|
-
|
|
530
|
+
Dockit is designed for full offline operation:
|
|
421
531
|
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
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/
|
|
553
|
+
│ ├── server/ # Express backend (port 3001)
|
|
436
554
|
│ │ └── src/
|
|
437
|
-
│ │ ├── core/
|
|
438
|
-
│ │ ├──
|
|
439
|
-
│ │ ├──
|
|
440
|
-
│ │
|
|
441
|
-
│
|
|
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/
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
│
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
├──
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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`
|
|
466
|
-
| `POST`
|
|
467
|
-
| `GET`
|
|
468
|
-
| `PUT`
|
|
469
|
-
| `DELETE` | `/api/entries/:id`
|
|
470
|
-
| `POST`
|
|
471
|
-
| `PUT`
|
|
472
|
-
| `DELETE` | `/api/sources/:id`
|
|
473
|
-
| `POST`
|
|
474
|
-
| `GET`
|
|
475
|
-
| `GET`
|
|
476
|
-
| `GET`
|
|
477
|
-
| `GET`
|
|
478
|
-
| `GET`
|
|
479
|
-
| `GET`
|
|
480
|
-
| `GET`
|
|
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
|
-
|
|
|
487
|
-
| Backend | Express 4, TypeScript
|
|
611
|
+
| CLI | Node.js, tsx (TypeScript runtime) |
|
|
612
|
+
| Backend | Express 4, TypeScript |
|
|
488
613
|
| Database | SQLite via better-sqlite3 |
|
|
489
|
-
|
|
|
490
|
-
|
|
|
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 |
|