@gmickel/gno 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +256 -0
  2. package/assets/skill/SKILL.md +112 -0
  3. package/assets/skill/cli-reference.md +327 -0
  4. package/assets/skill/examples.md +234 -0
  5. package/assets/skill/mcp-reference.md +159 -0
  6. package/package.json +90 -0
  7. package/src/app/constants.ts +313 -0
  8. package/src/cli/colors.ts +65 -0
  9. package/src/cli/commands/ask.ts +545 -0
  10. package/src/cli/commands/cleanup.ts +105 -0
  11. package/src/cli/commands/collection/add.ts +120 -0
  12. package/src/cli/commands/collection/index.ts +10 -0
  13. package/src/cli/commands/collection/list.ts +108 -0
  14. package/src/cli/commands/collection/remove.ts +64 -0
  15. package/src/cli/commands/collection/rename.ts +95 -0
  16. package/src/cli/commands/context/add.ts +67 -0
  17. package/src/cli/commands/context/check.ts +153 -0
  18. package/src/cli/commands/context/index.ts +10 -0
  19. package/src/cli/commands/context/list.ts +109 -0
  20. package/src/cli/commands/context/rm.ts +52 -0
  21. package/src/cli/commands/doctor.ts +393 -0
  22. package/src/cli/commands/embed.ts +462 -0
  23. package/src/cli/commands/get.ts +356 -0
  24. package/src/cli/commands/index-cmd.ts +119 -0
  25. package/src/cli/commands/index.ts +102 -0
  26. package/src/cli/commands/init.ts +328 -0
  27. package/src/cli/commands/ls.ts +217 -0
  28. package/src/cli/commands/mcp/config.ts +300 -0
  29. package/src/cli/commands/mcp/index.ts +24 -0
  30. package/src/cli/commands/mcp/install.ts +203 -0
  31. package/src/cli/commands/mcp/paths.ts +470 -0
  32. package/src/cli/commands/mcp/status.ts +222 -0
  33. package/src/cli/commands/mcp/uninstall.ts +158 -0
  34. package/src/cli/commands/mcp.ts +20 -0
  35. package/src/cli/commands/models/clear.ts +103 -0
  36. package/src/cli/commands/models/index.ts +32 -0
  37. package/src/cli/commands/models/list.ts +214 -0
  38. package/src/cli/commands/models/path.ts +51 -0
  39. package/src/cli/commands/models/pull.ts +199 -0
  40. package/src/cli/commands/models/use.ts +85 -0
  41. package/src/cli/commands/multi-get.ts +400 -0
  42. package/src/cli/commands/query.ts +220 -0
  43. package/src/cli/commands/ref-parser.ts +108 -0
  44. package/src/cli/commands/reset.ts +191 -0
  45. package/src/cli/commands/search.ts +136 -0
  46. package/src/cli/commands/shared.ts +156 -0
  47. package/src/cli/commands/skill/index.ts +19 -0
  48. package/src/cli/commands/skill/install.ts +197 -0
  49. package/src/cli/commands/skill/paths-cmd.ts +81 -0
  50. package/src/cli/commands/skill/paths.ts +191 -0
  51. package/src/cli/commands/skill/show.ts +73 -0
  52. package/src/cli/commands/skill/uninstall.ts +141 -0
  53. package/src/cli/commands/status.ts +205 -0
  54. package/src/cli/commands/update.ts +68 -0
  55. package/src/cli/commands/vsearch.ts +188 -0
  56. package/src/cli/context.ts +64 -0
  57. package/src/cli/errors.ts +64 -0
  58. package/src/cli/format/search-results.ts +211 -0
  59. package/src/cli/options.ts +183 -0
  60. package/src/cli/program.ts +1330 -0
  61. package/src/cli/run.ts +213 -0
  62. package/src/cli/ui.ts +92 -0
  63. package/src/config/defaults.ts +20 -0
  64. package/src/config/index.ts +55 -0
  65. package/src/config/loader.ts +161 -0
  66. package/src/config/paths.ts +87 -0
  67. package/src/config/saver.ts +153 -0
  68. package/src/config/types.ts +280 -0
  69. package/src/converters/adapters/markitdownTs/adapter.ts +140 -0
  70. package/src/converters/adapters/officeparser/adapter.ts +126 -0
  71. package/src/converters/canonicalize.ts +89 -0
  72. package/src/converters/errors.ts +218 -0
  73. package/src/converters/index.ts +51 -0
  74. package/src/converters/mime.ts +163 -0
  75. package/src/converters/native/markdown.ts +115 -0
  76. package/src/converters/native/plaintext.ts +56 -0
  77. package/src/converters/path.ts +48 -0
  78. package/src/converters/pipeline.ts +159 -0
  79. package/src/converters/registry.ts +74 -0
  80. package/src/converters/types.ts +123 -0
  81. package/src/converters/versions.ts +24 -0
  82. package/src/index.ts +27 -0
  83. package/src/ingestion/chunker.ts +238 -0
  84. package/src/ingestion/index.ts +32 -0
  85. package/src/ingestion/language.ts +276 -0
  86. package/src/ingestion/sync.ts +671 -0
  87. package/src/ingestion/types.ts +219 -0
  88. package/src/ingestion/walker.ts +235 -0
  89. package/src/llm/cache.ts +467 -0
  90. package/src/llm/errors.ts +191 -0
  91. package/src/llm/index.ts +58 -0
  92. package/src/llm/nodeLlamaCpp/adapter.ts +133 -0
  93. package/src/llm/nodeLlamaCpp/embedding.ts +165 -0
  94. package/src/llm/nodeLlamaCpp/generation.ts +88 -0
  95. package/src/llm/nodeLlamaCpp/lifecycle.ts +317 -0
  96. package/src/llm/nodeLlamaCpp/rerank.ts +94 -0
  97. package/src/llm/registry.ts +86 -0
  98. package/src/llm/types.ts +129 -0
  99. package/src/mcp/resources/index.ts +151 -0
  100. package/src/mcp/server.ts +229 -0
  101. package/src/mcp/tools/get.ts +220 -0
  102. package/src/mcp/tools/index.ts +160 -0
  103. package/src/mcp/tools/multi-get.ts +263 -0
  104. package/src/mcp/tools/query.ts +226 -0
  105. package/src/mcp/tools/search.ts +119 -0
  106. package/src/mcp/tools/status.ts +81 -0
  107. package/src/mcp/tools/vsearch.ts +198 -0
  108. package/src/pipeline/chunk-lookup.ts +44 -0
  109. package/src/pipeline/expansion.ts +256 -0
  110. package/src/pipeline/explain.ts +115 -0
  111. package/src/pipeline/fusion.ts +185 -0
  112. package/src/pipeline/hybrid.ts +535 -0
  113. package/src/pipeline/index.ts +64 -0
  114. package/src/pipeline/query-language.ts +118 -0
  115. package/src/pipeline/rerank.ts +223 -0
  116. package/src/pipeline/search.ts +261 -0
  117. package/src/pipeline/types.ts +328 -0
  118. package/src/pipeline/vsearch.ts +348 -0
  119. package/src/store/index.ts +41 -0
  120. package/src/store/migrations/001-initial.ts +196 -0
  121. package/src/store/migrations/index.ts +20 -0
  122. package/src/store/migrations/runner.ts +187 -0
  123. package/src/store/sqlite/adapter.ts +1242 -0
  124. package/src/store/sqlite/index.ts +7 -0
  125. package/src/store/sqlite/setup.ts +129 -0
  126. package/src/store/sqlite/types.ts +28 -0
  127. package/src/store/types.ts +506 -0
  128. package/src/store/vector/index.ts +13 -0
  129. package/src/store/vector/sqlite-vec.ts +373 -0
  130. package/src/store/vector/stats.ts +152 -0
  131. package/src/store/vector/types.ts +115 -0
package/README.md ADDED
@@ -0,0 +1,256 @@
1
+ # GNO: Your Local Second Brain
2
+
3
+ **Index, Search, and Synthesize Your Entire Digital Life.**
4
+
5
+ GNO is a **Local Knowledge Engine** designed for privacy-conscious individuals and AI agents. It indexes your notes, code, documents (Markdown, PDF, Office, and more), and meeting transcripts, providing lightning-fast semantic search and AI-powered answers—all on your machine.
6
+
7
+ ---
8
+
9
+ ## ✨ Key Features
10
+
11
+ * **Universal Indexing**: Effortlessly ingest and search across Markdown, PDF, DOCX, XLSX, PPTX, and plain text files.
12
+ * **Hybrid Search Pipeline**: Combines **BM25 keyword search** with **vector semantic search** and **AI re-ranking** for unparalleled retrieval accuracy.
13
+ * **Local LLM Integration**: Get grounded AI answers with citations using **node-llama-cpp** and auto-downloaded GGUF models. No external services, maximum privacy.
14
+ * **Agent-First Design (MCP)**: Seamlessly integrate GNO with AI agents via the Model Context Protocol (MCP) server.
15
+ * **Deterministic Output**: Stable, schema-driven JSON, file-line, and markdown outputs for reliable scripting.
16
+ * **Multilingual Support**: Robust handling of multiple languages in indexing and retrieval.
17
+ * **Privacy-Preserving**: All processing happens locally. Your data never leaves your device.
18
+ * **World-Class Engineering**: Spec-driven development, rigorous testing, and eval gates ensure reliability and quality.
19
+
20
+ ---
21
+
22
+ ## 🚀 Quick Start
23
+
24
+ Get searching in minutes with the 3-command workflow:
25
+
26
+ 1. **Initialize your knowledge base**:
27
+ ```sh
28
+ # Create a collection for your notes (adjust path and name as needed)
29
+ gno init ~/my-notes --name notes --pattern "**/*.md"
30
+
31
+ # Full index: sync files + generate embeddings
32
+ gno index
33
+ ```
34
+
35
+ 2. **Ask a question**:
36
+ ```sh
37
+ # Get a direct, cited answer from your documents
38
+ gno ask "What are the best practices for API authentication?" --collection notes
39
+
40
+ # Search with keywords or natural language
41
+ gno query "Q4 planning meeting summary" --collection notes
42
+ ```
43
+
44
+ 3. **Explore your data**:
45
+ ```sh
46
+ # Retrieve specific document content
47
+ gno get "notes/2024-01-15.md"
48
+
49
+ # Get results in a machine-readable format for agents
50
+ gno search "project deadlines" --json -n 10
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 🧠 For Humans & AI Agents
56
+
57
+ GNO is built for both worlds:
58
+
59
+ * **For Humans**: A powerful, yet intuitive CLI to quickly find information, get answers, and explore your local knowledge base.
60
+ * **For AI Agents**: Exposes a stable MCP server and structured output formats (`--json`, `--files`) for seamless integration with LLMs and agentic workflows.
61
+
62
+ ---
63
+
64
+ ## 🔎 Search Modes
65
+
66
+ GNO offers multiple search strategies to suit your needs:
67
+
68
+ | Command | Mode | Description | Best For |
69
+ | :---------- | :------------- | :-------------------------------------------------------------- | :----------------------------------------------- |
70
+ | `gno search`| **BM25** | Fast, keyword-based full-text search. | Exact phrase matching, known terms. |
71
+ | `gno vsearch`| **Vector** | Semantic search based on meaning, not just keywords. | Natural language queries, conceptual understanding. |
72
+ | `gno query` | **Hybrid** | Combines BM25 and Vector search with LLM reranking and fusion. | Highest accuracy, nuanced understanding. |
73
+ | `gno ask` | **RAG-focused**| Hybrid search providing a synthesized, cited answer from results. | Getting direct answers to complex questions. |
74
+
75
+ ---
76
+
77
+ ## 🤖 Agent Integration
78
+
79
+ GNO is designed to be the knowledge backbone for your AI agents.
80
+
81
+ ### CLI Output Formats
82
+
83
+ Use `--json` or `--files` for machine-readable output:
84
+
85
+ ```sh
86
+ # Get JSON results for LLM processing
87
+ gno query "meeting notes on user feedback" --json -n 5
88
+
89
+ # Get file paths and scores for agent tool use
90
+ gno search "API design" --files --min-score 0.3
91
+ ```
92
+
93
+ ### Skill Installation (Recommended for Claude Code/Codex/OpenCode)
94
+
95
+ Skills integrate via CLI - the agent runs GNO commands directly. No MCP overhead, no context pollution.
96
+
97
+ ```bash
98
+ gno skill install --scope user # User-wide for Claude Code
99
+ gno skill install --target codex # For Codex
100
+ gno skill install --target all # Both
101
+ ```
102
+
103
+ After install, restart your agent. It will detect GNO and can search your indexed documents.
104
+
105
+ ### MCP Server (For Claude Desktop/Cursor)
106
+
107
+ Exposes an MCP server for GUI-based AI applications.
108
+
109
+ **Tools Exposed:**
110
+ * `gno_search` (BM25)
111
+ * `gno_vsearch` (Vector)
112
+ * `gno_query` (Hybrid)
113
+ * `gno_get` (Document retrieval)
114
+ * `gno_multi_get` (Batch retrieval)
115
+ * `gno_status` (Index health)
116
+
117
+ **Example Claude Desktop Configuration** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "gno": {
123
+ "command": "gno",
124
+ "args": ["mcp"]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ *(Adjust path and `mcpServers` key based on your agent's configuration.)*
131
+
132
+ ---
133
+
134
+ ## ⚙️ How It Works: The GNO Pipeline
135
+
136
+ GNO employs a sophisticated, multi-stage retrieval process for optimal results:
137
+
138
+ ```mermaid
139
+ graph TD
140
+ A[User Query] --> B(Query Expansion);
141
+ B --> C{Lexical Variants};
142
+ B --> D{Semantic Variants};
143
+ B --> E{Optional HyDE};
144
+ A --> F[Original Query];
145
+
146
+ C --> G(BM25 Retrieval);
147
+ D --> H(Vector Search);
148
+ E --> H;
149
+ F --> G;
150
+ F --> H;
151
+
152
+ G --> I(Ranked List 1);
153
+ H --> J(Ranked List 2);
154
+ I --> K{RRF Fusion + Bonus};
155
+ J --> K;
156
+
157
+ K --> L(Top Candidates);
158
+ L --> M(LLM Re-ranking);
159
+ M --> N(Position-Aware Blending);
160
+ N --> O(Final Results);
161
+
162
+ subgraph "Search Stages"
163
+ B; C; D; E; F; G; H; I; J; K; L; M; N; O;
164
+ end
165
+ ```
166
+
167
+ ### Search Pipeline Details:
168
+
169
+ 1. **Query Expansion**: Generates alternative queries (lexical and semantic) and an optional synthetic "HyDE" document using a local LLM for richer retrieval.
170
+ 2. **Parallel Retrieval**: Executes BM25 (keyword) and Vector (semantic) searches concurrently.
171
+ 3. **Fusion**: Combines results using Reciprocal Rank Fusion (RRF) with a weighted boost for original query matches and a top-rank bonus.
172
+ 4. **Re-ranking**: An LLM-based cross-encoder re-scores the top candidates for final relevance.
173
+ 5. **Blending**: Dynamically adjusts the mix of retrieval vs. reranked scores based on rank position to preserve accuracy.
174
+
175
+ **Score Normalization**: Raw scores from FTS, vector distance, and reranker are normalized to a 0-1 scale for consistent fusion.
176
+
177
+ ---
178
+
179
+ ## 📦 Installation
180
+
181
+ Requires **Bun** >= 1.0.0.
182
+
183
+ ```sh
184
+ # Install globally
185
+ bun install -g @gmickel/gno
186
+ ```
187
+
188
+ **macOS users**: For optimal vector search performance, install Homebrew SQLite:
189
+ ```sh
190
+ brew install sqlite3
191
+ ```
192
+
193
+ Verify your installation:
194
+ ```sh
195
+ gno doctor
196
+ ```
197
+
198
+ ---
199
+
200
+ ## 🏠 Local LLM Models
201
+
202
+ GNO runs embeddings, reranking, and query expansion locally using GGUF models via `node-llama-cpp`. Models are automatically downloaded and cached on first use in `~/.cache/gno/models/`.
203
+
204
+ | Model | Purpose | Size (approx.) |
205
+ | :-------------------- | :---------------- | :------------- |
206
+ | `bge-m3` | Multilingual Embeddings | ~500MB |
207
+ | `bge-reranker-v2-m3` | Cross-Encoder Re-ranking | ~700MB |
208
+ | `Qwen-Instruct` | Query Expansion / HyDE | ~600MB |
209
+
210
+ *(Specific GGUF versions are pinned for stability.)*
211
+
212
+ ---
213
+
214
+ ## 📜 Architecture Overview
215
+
216
+ GNO follows a layered, Ports and Adapters architecture for maintainability and testability:
217
+
218
+ ```
219
+ ┌───────────────────────────────────────────────────────────┐
220
+ │ GNO CLI / MCP │
221
+ ├───────────────────────────────────────────────────────────┤
222
+ │ Ports: Converter, Store, Embedding, Generation, Rerank... │
223
+ ├───────────────────────────────────────────────────────────┤
224
+ │ Adapters: SQLite, FTS5, sqlite-vec, node-llama-cpp, CLI │
225
+ ├───────────────────────────────────────────────────────────┤
226
+ │ Core Domain: Identity, Mirrors, Chunking, Retrieval │
227
+ └───────────────────────────────────────────────────────────┘
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 💻 Development
233
+
234
+ ```bash
235
+ # Clone the repository
236
+ git clone https://github.com/gmickel/gno.git
237
+ cd gno
238
+
239
+ # Install dependencies
240
+ bun install
241
+
242
+ # Run tests
243
+ bun test
244
+
245
+ # Lint and format code
246
+ bun run lint
247
+
248
+ # Type check
249
+ bun run typecheck
250
+ ```
251
+
252
+ ---
253
+
254
+ ## 📄 License
255
+
256
+ [MIT License](./LICENSE)
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: gno
3
+ description: Search local documents, files, notes, and knowledge bases. Supports PDFs, Markdown, Word docs, code files. Use when user wants to search files, find documents, query their notes, look up information in local folders, index a directory, set up document search, build a knowledge base, or needs RAG/semantic search over their files.
4
+ allowed-tools: Bash(gno:*), Read
5
+ ---
6
+
7
+ # GNO - Local Document Search
8
+
9
+ Fast local semantic search for your documents. Index once, search instantly.
10
+
11
+ **Role**: document search assistant
12
+ **Goal**: help users index, search, and query their documents
13
+
14
+ ## When to Use This Skill
15
+
16
+ - User asks to **search files, documents, or notes**
17
+ - User wants to **find information** in local folders
18
+ - User needs to **index a directory** for searching
19
+ - User mentions **PDFs, markdown, docs** they want to search
20
+ - User asks about **knowledge base** or **RAG** setup
21
+ - User wants **semantic/vector search** over their files
22
+ - User needs to **set up MCP** for document access
23
+
24
+ ## Quick Start
25
+
26
+ ```bash
27
+ # 1. Initialize in any directory
28
+ gno init
29
+
30
+ # 2. Add a collection (folder of docs)
31
+ gno collection add ~/docs --name docs
32
+
33
+ # 3. Index documents
34
+ gno index
35
+
36
+ # 4. Search
37
+ gno search "your query"
38
+ ```
39
+
40
+ ## Core Commands
41
+
42
+ ### Indexing
43
+
44
+ | Command | Description |
45
+ |---------|-------------|
46
+ | `gno init` | Initialize GNO in current directory |
47
+ | `gno collection add <path> --name <name>` | Add folder to index |
48
+ | `gno index` | Full index (ingest + embed) |
49
+ | `gno update` | Sync files without embedding |
50
+
51
+ ### Searching
52
+
53
+ | Command | Description |
54
+ |---------|-------------|
55
+ | `gno search <query>` | BM25 keyword search |
56
+ | `gno vsearch <query>` | Vector semantic search |
57
+ | `gno query <query>` | Hybrid search (BM25 + vector + rerank) |
58
+ | `gno ask <question>` | AI-powered Q&A with citations |
59
+
60
+ ### Common Options
61
+
62
+ - `-n <num>` — Max results (default: 5)
63
+ - `-c, --collection <name>` — Filter to collection
64
+ - `--json` — JSON output
65
+ - `--full` — Include full content (not snippets)
66
+
67
+ ## Usage Patterns
68
+
69
+ ### Search & Retrieve
70
+
71
+ ```bash
72
+ # Keyword search
73
+ gno search "termination clause" -n 10
74
+
75
+ # Semantic search (similar meaning)
76
+ gno vsearch "how to cancel contract"
77
+
78
+ # Hybrid search (best quality)
79
+ gno query "deployment process" --collection work
80
+
81
+ # Get answer with citations
82
+ gno ask "what are the payment terms"
83
+ ```
84
+
85
+ ### Inspect Documents
86
+
87
+ ```bash
88
+ # Get document by URI
89
+ gno get gno://docs/readme.md
90
+
91
+ # Get with line numbers
92
+ gno get "#a1b2c3d4" --line-numbers
93
+
94
+ # List documents
95
+ gno ls docs
96
+ ```
97
+
98
+ ### JSON Output (for scripts)
99
+
100
+ ```bash
101
+ # Search results as JSON
102
+ gno search "api" --json | jq '.[] | .uri'
103
+
104
+ # Status check
105
+ gno status --json
106
+ ```
107
+
108
+ ## Reference
109
+
110
+ For complete CLI details, see [cli-reference.md](cli-reference.md).
111
+ For MCP server setup, see [mcp-reference.md](mcp-reference.md).
112
+ For usage examples, see [examples.md](examples.md).
@@ -0,0 +1,327 @@
1
+ # GNO CLI Reference
2
+
3
+ Complete command reference for GNO.
4
+
5
+ ## Global Flags
6
+
7
+ All commands accept:
8
+
9
+ | Flag | Description |
10
+ |------|-------------|
11
+ | `--index <name>` | Use alternate index (default: "default") |
12
+ | `--config <path>` | Override config file path |
13
+ | `--no-color` | Disable colored output |
14
+ | `--verbose` | Enable verbose logging |
15
+ | `--yes` | Non-interactive mode |
16
+ | `--json` | JSON output (where supported) |
17
+
18
+ ## Initialization
19
+
20
+ ### gno init
21
+
22
+ ```bash
23
+ gno init [<path>] [options]
24
+ ```
25
+
26
+ | Option | Description |
27
+ |--------|-------------|
28
+ | `--name <name>` | Collection name |
29
+ | `--pattern <glob>` | File pattern (default: `**/*`) |
30
+ | `--include <exts>` | Extension allowlist (e.g., `.md,.pdf`) |
31
+ | `--exclude <paths>` | Exclude patterns (default: `.git,node_modules`) |
32
+ | `--tokenizer <type>` | FTS tokenizer: unicode61, porter, trigram |
33
+ | `--language <code>` | BCP-47 language hint |
34
+
35
+ ## Collections
36
+
37
+ ### gno collection add
38
+
39
+ ```bash
40
+ gno collection add <path> --name <name> [options]
41
+ ```
42
+
43
+ Options same as `init`.
44
+
45
+ ### gno collection list
46
+
47
+ ```bash
48
+ gno collection list [--json|--md]
49
+ ```
50
+
51
+ ### gno collection remove
52
+
53
+ ```bash
54
+ gno collection remove <name>
55
+ ```
56
+
57
+ ### gno collection rename
58
+
59
+ ```bash
60
+ gno collection rename <old> <new>
61
+ ```
62
+
63
+ ## Indexing
64
+
65
+ ### gno update
66
+
67
+ Sync files from disk (no embedding).
68
+
69
+ ```bash
70
+ gno update [--git-pull]
71
+ ```
72
+
73
+ ### gno index
74
+
75
+ Full index (update + embed).
76
+
77
+ ```bash
78
+ gno index [options]
79
+ ```
80
+
81
+ | Option | Description |
82
+ |--------|-------------|
83
+ | `--collection <name>` | Scope to single collection |
84
+ | `--no-embed` | Skip embedding |
85
+ | `--models-pull` | Download models if missing |
86
+ | `--git-pull` | Git pull before indexing |
87
+
88
+ ### gno embed
89
+
90
+ Generate embeddings only.
91
+
92
+ ```bash
93
+ gno embed [--force] [--model <uri>] [--batch-size <n>] [--dry-run]
94
+ ```
95
+
96
+ ## Search Commands
97
+
98
+ ### gno search
99
+
100
+ BM25 keyword search.
101
+
102
+ ```bash
103
+ gno search <query> [options]
104
+ ```
105
+
106
+ | Option | Default | Description |
107
+ |--------|---------|-------------|
108
+ | `-n` | 5 | Max results |
109
+ | `--min-score` | 0 | Minimum score (0-1) |
110
+ | `-c, --collection` | all | Filter to collection |
111
+ | `--full` | false | Full content (not snippets) |
112
+ | `--line-numbers` | false | Include line numbers |
113
+ | `--lang` | auto | Language filter |
114
+
115
+ Output formats: `--json`, `--files`, `--csv`, `--md`, `--xml`
116
+
117
+ ### gno vsearch
118
+
119
+ Vector semantic search. Same options as `search`.
120
+
121
+ ```bash
122
+ gno vsearch <query> [options]
123
+ ```
124
+
125
+ ### gno query
126
+
127
+ Hybrid search with expansion and reranking.
128
+
129
+ ```bash
130
+ gno query <query> [options]
131
+ ```
132
+
133
+ Additional options:
134
+
135
+ | Option | Description |
136
+ |--------|-------------|
137
+ | `--no-expand` | Disable query expansion |
138
+ | `--no-rerank` | Disable reranking |
139
+ | `--explain` | Print retrieval details to stderr |
140
+
141
+ ### gno ask
142
+
143
+ AI-powered Q&A with citations.
144
+
145
+ ```bash
146
+ gno ask <question> [options]
147
+ ```
148
+
149
+ | Option | Description |
150
+ |--------|-------------|
151
+ | `--answer` | Generate grounded answer |
152
+ | `--no-answer` | Retrieval only |
153
+ | `--max-answer-tokens <n>` | Cap answer length |
154
+ | `--show-sources` | Show all sources |
155
+
156
+ ## Document Retrieval
157
+
158
+ ### gno get
159
+
160
+ Get single document.
161
+
162
+ ```bash
163
+ gno get <ref> [--from <line>] [-l <lines>] [--line-numbers] [--source]
164
+ ```
165
+
166
+ Ref formats:
167
+ - `gno://collection/path` — Full URI
168
+ - `collection/path` — Relative path
169
+ - `#docid` — Document ID
170
+ - `gno://docs/file.md:120` — With line number
171
+
172
+ ### gno multi-get
173
+
174
+ Get multiple documents.
175
+
176
+ ```bash
177
+ gno multi-get <pattern> [--max-bytes <n>] [--line-numbers]
178
+ ```
179
+
180
+ ### gno ls
181
+
182
+ List documents.
183
+
184
+ ```bash
185
+ gno ls [<scope>] [--json|--files|--md]
186
+ ```
187
+
188
+ ## Context Management
189
+
190
+ ### gno context add
191
+
192
+ ```bash
193
+ gno context add <scope> "<text>"
194
+ ```
195
+
196
+ Scope formats:
197
+ - `/` — Global
198
+ - `collection:` — Collection prefix
199
+ - `gno://collection/path` — Path prefix
200
+
201
+ ### gno context list
202
+
203
+ ```bash
204
+ gno context list [--json|--md]
205
+ ```
206
+
207
+ ### gno context rm
208
+
209
+ ```bash
210
+ gno context rm <scope>
211
+ ```
212
+
213
+ ## Models
214
+
215
+ ### gno models list
216
+
217
+ ```bash
218
+ gno models list [--json|--md]
219
+ ```
220
+
221
+ ### gno models use
222
+
223
+ ```bash
224
+ gno models use <preset>
225
+ ```
226
+
227
+ Presets: `slim` (~1GB), `balanced` (~2GB), `quality` (~2.5GB)
228
+
229
+ ### gno models pull
230
+
231
+ ```bash
232
+ gno models pull [--all|--embed|--rerank|--gen] [--force]
233
+ ```
234
+
235
+ ### gno models clear
236
+
237
+ ```bash
238
+ gno models clear [--all|--embed|--rerank|--gen]
239
+ ```
240
+
241
+ ### gno models path
242
+
243
+ ```bash
244
+ gno models path [--json]
245
+ ```
246
+
247
+ ## Maintenance
248
+
249
+ ### gno status
250
+
251
+ ```bash
252
+ gno status [--json|--md]
253
+ ```
254
+
255
+ ### gno doctor
256
+
257
+ ```bash
258
+ gno doctor [--json|--md]
259
+ ```
260
+
261
+ ### gno cleanup
262
+
263
+ ```bash
264
+ gno cleanup
265
+ ```
266
+
267
+ ## MCP Server
268
+
269
+ ### gno mcp
270
+
271
+ Start MCP server (stdio transport).
272
+
273
+ ```bash
274
+ gno mcp
275
+ ```
276
+
277
+ ### gno mcp install
278
+
279
+ Install GNO as MCP server in client configurations.
280
+
281
+ ```bash
282
+ gno mcp install [options]
283
+ ```
284
+
285
+ | Option | Default | Description |
286
+ |--------|---------|-------------|
287
+ | `-t, --target` | claude-desktop | Target: `claude-desktop`, `claude-code`, `codex` |
288
+ | `-s, --scope` | user | Scope: `user`, `project` |
289
+ | `-f, --force` | false | Overwrite existing config |
290
+ | `--dry-run` | false | Preview changes |
291
+
292
+ Examples:
293
+
294
+ ```bash
295
+ # Claude Desktop (default)
296
+ gno mcp install
297
+
298
+ # Claude Code (user scope)
299
+ gno mcp install -t claude-code
300
+
301
+ # Claude Code (project scope)
302
+ gno mcp install -t claude-code -s project
303
+ ```
304
+
305
+ ### gno mcp uninstall
306
+
307
+ Remove GNO MCP server from client configuration.
308
+
309
+ ```bash
310
+ gno mcp uninstall [-t <target>] [-s <scope>]
311
+ ```
312
+
313
+ ### gno mcp status
314
+
315
+ Show MCP installation status.
316
+
317
+ ```bash
318
+ gno mcp status [--json]
319
+ ```
320
+
321
+ ## Exit Codes
322
+
323
+ | Code | Description |
324
+ |------|-------------|
325
+ | 0 | Success |
326
+ | 1 | Validation error (bad args) |
327
+ | 2 | Runtime error (IO, DB, model) |