cocosearch 0.1.0__tar.gz
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.
- cocosearch-0.1.0/PKG-INFO +506 -0
- cocosearch-0.1.0/README.md +488 -0
- cocosearch-0.1.0/pyproject.toml +50 -0
- cocosearch-0.1.0/src/cocosearch/__init__.py +3 -0
- cocosearch-0.1.0/src/cocosearch/__main__.py +6 -0
- cocosearch-0.1.0/src/cocosearch/cli.py +2054 -0
- cocosearch-0.1.0/src/cocosearch/config/__init__.py +40 -0
- cocosearch-0.1.0/src/cocosearch/config/env_substitution.py +74 -0
- cocosearch-0.1.0/src/cocosearch/config/env_validation.py +76 -0
- cocosearch-0.1.0/src/cocosearch/config/errors.py +103 -0
- cocosearch-0.1.0/src/cocosearch/config/generator.py +58 -0
- cocosearch-0.1.0/src/cocosearch/config/loader.py +102 -0
- cocosearch-0.1.0/src/cocosearch/config/resolver.py +279 -0
- cocosearch-0.1.0/src/cocosearch/config/schema.py +48 -0
- cocosearch-0.1.0/src/cocosearch/dashboard/__init__.py +8 -0
- cocosearch-0.1.0/src/cocosearch/dashboard/server.py +611 -0
- cocosearch-0.1.0/src/cocosearch/dashboard/terminal.py +238 -0
- cocosearch-0.1.0/src/cocosearch/dashboard/web/__init__.py +14 -0
- cocosearch-0.1.0/src/cocosearch/dashboard/web/static/index.html +2180 -0
- cocosearch-0.1.0/src/cocosearch/exceptions.py +32 -0
- cocosearch-0.1.0/src/cocosearch/handlers/README.md +141 -0
- cocosearch-0.1.0/src/cocosearch/handlers/__init__.py +369 -0
- cocosearch-0.1.0/src/cocosearch/handlers/_template.py +152 -0
- cocosearch-0.1.0/src/cocosearch/handlers/bash.py +96 -0
- cocosearch-0.1.0/src/cocosearch/handlers/dockerfile.py +121 -0
- cocosearch-0.1.0/src/cocosearch/handlers/gotmpl.py +91 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/__init__.py +0 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/_template.py +92 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/docker_compose.py +134 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/github_actions.py +157 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/gitlab_ci.py +152 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/helm_template.py +143 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/helm_values.py +203 -0
- cocosearch-0.1.0/src/cocosearch/handlers/grammars/kubernetes.py +171 -0
- cocosearch-0.1.0/src/cocosearch/handlers/groovy.py +126 -0
- cocosearch-0.1.0/src/cocosearch/handlers/hcl.py +102 -0
- cocosearch-0.1.0/src/cocosearch/handlers/scala.py +145 -0
- cocosearch-0.1.0/src/cocosearch/handlers/text.py +26 -0
- cocosearch-0.1.0/src/cocosearch/handlers/utils.py +38 -0
- cocosearch-0.1.0/src/cocosearch/indexer/__init__.py +10 -0
- cocosearch-0.1.0/src/cocosearch/indexer/config.py +103 -0
- cocosearch-0.1.0/src/cocosearch/indexer/embedder.py +114 -0
- cocosearch-0.1.0/src/cocosearch/indexer/file_filter.py +90 -0
- cocosearch-0.1.0/src/cocosearch/indexer/flow.py +302 -0
- cocosearch-0.1.0/src/cocosearch/indexer/parse_tracking.py +241 -0
- cocosearch-0.1.0/src/cocosearch/indexer/preflight.py +65 -0
- cocosearch-0.1.0/src/cocosearch/indexer/progress.py +142 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/__init__.py +10 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/bash.scm +4 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/c.scm +26 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/cpp.scm +42 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/css.scm +26 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/go.scm +21 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/hcl.scm +4 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/java.scm +21 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/javascript.scm +19 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/php.scm +21 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/python.scm +9 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/ruby.scm +17 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/rust.scm +24 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/scala.scm +22 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/terraform.scm +4 -0
- cocosearch-0.1.0/src/cocosearch/indexer/queries/typescript.scm +27 -0
- cocosearch-0.1.0/src/cocosearch/indexer/schema_migration.py +255 -0
- cocosearch-0.1.0/src/cocosearch/indexer/symbols.py +511 -0
- cocosearch-0.1.0/src/cocosearch/indexer/tsvector.py +147 -0
- cocosearch-0.1.0/src/cocosearch/management/__init__.py +66 -0
- cocosearch-0.1.0/src/cocosearch/management/clear.py +78 -0
- cocosearch-0.1.0/src/cocosearch/management/context.py +147 -0
- cocosearch-0.1.0/src/cocosearch/management/discovery.py +48 -0
- cocosearch-0.1.0/src/cocosearch/management/git.py +188 -0
- cocosearch-0.1.0/src/cocosearch/management/metadata.py +322 -0
- cocosearch-0.1.0/src/cocosearch/management/stats.py +910 -0
- cocosearch-0.1.0/src/cocosearch/mcp/__init__.py +11 -0
- cocosearch-0.1.0/src/cocosearch/mcp/project_detection.py +159 -0
- cocosearch-0.1.0/src/cocosearch/mcp/server.py +1215 -0
- cocosearch-0.1.0/src/cocosearch/search/__init__.py +23 -0
- cocosearch-0.1.0/src/cocosearch/search/cache.py +380 -0
- cocosearch-0.1.0/src/cocosearch/search/context_expander.py +447 -0
- cocosearch-0.1.0/src/cocosearch/search/db.py +171 -0
- cocosearch-0.1.0/src/cocosearch/search/filters.py +126 -0
- cocosearch-0.1.0/src/cocosearch/search/formatter.py +382 -0
- cocosearch-0.1.0/src/cocosearch/search/hybrid.py +599 -0
- cocosearch-0.1.0/src/cocosearch/search/query.py +452 -0
- cocosearch-0.1.0/src/cocosearch/search/query_analyzer.py +162 -0
- cocosearch-0.1.0/src/cocosearch/search/repl.py +226 -0
- cocosearch-0.1.0/src/cocosearch/search/utils.py +43 -0
- cocosearch-0.1.0/src/cocosearch/validation.py +79 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: cocosearch
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first code search via MCP/CLI
|
|
5
|
+
Author: VioletCranberry
|
|
6
|
+
Author-email: VioletCranberry <zh6an0w.fedor@gmail.com>
|
|
7
|
+
Requires-Dist: cocoindex[embeddings]>=0.3.31
|
|
8
|
+
Requires-Dist: mcp[cli]>=1.26.0
|
|
9
|
+
Requires-Dist: pathspec>=1.0.3
|
|
10
|
+
Requires-Dist: pgvector>=0.4.2
|
|
11
|
+
Requires-Dist: psycopg[binary,pool]>=3.3.2
|
|
12
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
13
|
+
Requires-Dist: rich>=13.0.0
|
|
14
|
+
Requires-Dist: tree-sitter>=0.25.0,<0.26.0
|
|
15
|
+
Requires-Dist: tree-sitter-language-pack>=0.13.0
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="./docs/banner.svg" alt="Coco[-S]earch — Local-first hybrid semantic code search" width="960">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-%3E%3D3.11-blue?logo=python&logoColor=white" alt="Python >= 3.11"></a>
|
|
25
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License: MIT"></a>
|
|
26
|
+
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
|
|
27
|
+
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv"></a>
|
|
28
|
+
<a href="https://docs.pytest.org/"><img src="https://img.shields.io/badge/tests-pytest-blue?logo=pytest&logoColor=white" alt="pytest"></a>
|
|
29
|
+
<a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?logo=anthropic&logoColor=white" alt="MCP"></a>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Bash-4EAA25?logo=gnubash&logoColor=white" alt="Bash"></a>
|
|
34
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/C-A8B9CC?logo=c&logoColor=white" alt="C"></a>
|
|
35
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/C%2B%2B-00599C?logo=cplusplus&logoColor=white" alt="C++"></a>
|
|
36
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/C%23-512BD4?logo=csharp&logoColor=white" alt="C#"></a>
|
|
37
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/CSS-1572B6?logo=css3&logoColor=white" alt="CSS"></a>
|
|
38
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Dockerfile-2496ED?logo=docker&logoColor=white" alt="Dockerfile"></a>
|
|
39
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/DTD-7A7A7A" alt="DTD"></a>
|
|
40
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Fortran-734F96?logo=fortran&logoColor=white" alt="Fortran"></a>
|
|
41
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white" alt="Go"></a>
|
|
42
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Groovy-4298B8?logo=apachegroovy&logoColor=white" alt="Groovy"></a>
|
|
43
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/HCL-844FBA?logo=terraform&logoColor=white" alt="HCL"></a>
|
|
44
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/HTML-E34F26?logo=html5&logoColor=white" alt="HTML"></a>
|
|
45
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Java-ED8B00?logo=openjdk&logoColor=white" alt="Java"></a>
|
|
46
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=black" alt="JavaScript"></a>
|
|
47
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/JSON-000000?logo=json&logoColor=white" alt="JSON"></a>
|
|
48
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Kotlin-7F52FF?logo=kotlin&logoColor=white" alt="Kotlin"></a>
|
|
49
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Markdown-000000?logo=markdown&logoColor=white" alt="Markdown"></a>
|
|
50
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Pascal-0364B8" alt="Pascal"></a>
|
|
51
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/PHP-777BB4?logo=php&logoColor=white" alt="PHP"></a>
|
|
52
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white" alt="Python"></a>
|
|
53
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/R-276DC3?logo=r&logoColor=white" alt="R"></a>
|
|
54
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Ruby-CC342D?logo=ruby&logoColor=white" alt="Ruby"></a>
|
|
55
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white" alt="Rust"></a>
|
|
56
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Scala-DC322F?logo=scala&logoColor=white" alt="Scala"></a>
|
|
57
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Solidity-363636?logo=solidity&logoColor=white" alt="Solidity"></a>
|
|
58
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/SQL-336791" alt="SQL"></a>
|
|
59
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/Swift-F05138?logo=swift&logoColor=white" alt="Swift"></a>
|
|
60
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/TOML-9C4121?logo=toml&logoColor=white" alt="TOML"></a>
|
|
61
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white" alt="TypeScript"></a>
|
|
62
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/XML-0060AC" alt="XML"></a>
|
|
63
|
+
<a href="#supported-languages"><img src="https://img.shields.io/badge/YAML-CB171E?logo=yaml&logoColor=white" alt="YAML"></a>
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
<p align="center">
|
|
67
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/Docker_Compose-2496ED?logo=docker&logoColor=white" alt="Docker Compose"></a>
|
|
68
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/GitHub_Actions-2088FF?logo=githubactions&logoColor=white" alt="GitHub Actions"></a>
|
|
69
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/GitLab_CI-FC6D26?logo=gitlab&logoColor=white" alt="GitLab CI"></a>
|
|
70
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/Helm_Template-0F1689?logo=helm&logoColor=white" alt="Helm Template"></a>
|
|
71
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/Helm_Values-0F1689?logo=helm&logoColor=white" alt="Helm Values"></a>
|
|
72
|
+
<a href="#supported-grammars"><img src="https://img.shields.io/badge/Kubernetes-326CE5?logo=kubernetes&logoColor=white" alt="Kubernetes"></a>
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
Coco[-S]earch is a local-first hybrid semantic code search tool. It combines vector similarity and keyword matching (via RRF fusion) to find code by meaning, not just text. Powered by [CocoIndex](https://github.com/cocoindex-io/cocoindex) for indexing, [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) for syntax-aware chunking and symbol extraction, [PostgreSQL](https://www.postgresql.org/) with [pgvector](https://github.com/pgvector/pgvector) for storage, and [Ollama](https://ollama.com/) for local embeddings. No external APIs — everything runs on your machine.
|
|
76
|
+
|
|
77
|
+
Available as a CLI, MCP server, or interactive REPL. Incremental indexing, `.gitignore`-aware. Supports 31+ languages with symbol-level filtering for 14+, plus domain-specific grammars for structured config files.
|
|
78
|
+
|
|
79
|
+
## 📑 Table of Contents
|
|
80
|
+
|
|
81
|
+
- [⚠️ Disclaimer](#disclaimer)
|
|
82
|
+
- [🚀 Quick Start](#quick-start)
|
|
83
|
+
- [✨ Features](#features)
|
|
84
|
+
- [🖥️ Interfaces](#interfaces)
|
|
85
|
+
- [🏆 Where MCP Wins](#where-mcp-wins)
|
|
86
|
+
- [📚 Useful Documentation](#useful-documentation)
|
|
87
|
+
- [🧩 Components](#components)
|
|
88
|
+
- [⚙️ How Search Works](#how-search-works)
|
|
89
|
+
- [🌐 Supported Languages](#supported-languages)
|
|
90
|
+
- [📝 Supported Grammars](#supported-grammars)
|
|
91
|
+
- [🔧 Configuration](#configuration)
|
|
92
|
+
- [🧪 Testing](#testing)
|
|
93
|
+
- [🛠️ Troubleshooting](#troubleshooting)
|
|
94
|
+
|
|
95
|
+
## Disclaimer
|
|
96
|
+
|
|
97
|
+
This project was originally built for personal use — a solo experiment in local-first, privacy-focused code search to accelerate self-onboarding to new codebases and explore spec-driven development. Initially scaffolded with [GSD](https://github.com/glittercowboy/get-shit-done) and refined by hand. Ships with a CLI, MCP tools, dashboards (TUI/WEB), a status API, reusable [Claude SKILLS](https://code.claude.com/docs/en/skills), and a [Claude Code plugin](https://code.claude.com/docs/en/plugins) for one-command setup.
|
|
98
|
+
|
|
99
|
+
## Quick Start
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# 1. Clone this repository and start infrastructure:
|
|
103
|
+
git clone https://github.com/VioletCranberry/coco-s.git && cd coco-s
|
|
104
|
+
# Docker volumes are bind-mounted to ./docker_data/ inside the repository,
|
|
105
|
+
# so infrastructure must be started from the cloned repo directory.
|
|
106
|
+
docker compose up -d
|
|
107
|
+
# 2. Verify services are ready.
|
|
108
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch config check
|
|
109
|
+
# 3. Index your project (or use WEB dashboard).
|
|
110
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch index .
|
|
111
|
+
# 4. Register with your AI assistant (pick one):
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Option A — Plugin (recommended):**
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
claude plugin marketplace add VioletCranberry/coco-s
|
|
118
|
+
claude plugin install cocosearch@cocosearch
|
|
119
|
+
# All 7 skills + MCP server configured automatically
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
<p align="center">
|
|
123
|
+
<img src="./docs/plugin-examples.png" alt="CocoSearch plugin skills in Claude Code" width="720">
|
|
124
|
+
</p>
|
|
125
|
+
|
|
126
|
+
**Option B — Manual MCP registration:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
claude mcp add --scope user cocosearch -- \
|
|
130
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch mcp --project-from-cwd
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
> **Note:** The MCP server automatically opens a web dashboard in your browser on a random port. Set `COCOSEARCH_DASHBOARD_PORT=8080` to pin it to a fixed port, or `COCOSEARCH_NO_DASHBOARD=1` to disable it.
|
|
134
|
+
|
|
135
|
+
Install skills manually (for development):
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
mkdir -p .claude/skills
|
|
139
|
+
for skill in cocosearch-onboarding cocosearch-refactoring cocosearch-debugging cocosearch-quickstart cocosearch-explore cocosearch-new-feature cocosearch-subway; do
|
|
140
|
+
ln -sfn "../../skills/$skill" ".claude/skills/$skill"
|
|
141
|
+
done
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Features
|
|
145
|
+
|
|
146
|
+
- 🔍 **Hybrid search** -- combines semantic similarity and keyword matching via RRF fusion to find code by meaning and by text.
|
|
147
|
+
- 🏷️ **Symbol filtering** -- narrow results to functions, classes, methods, or interfaces; match symbol names with glob patterns.
|
|
148
|
+
- 📐 **Context expansion** -- results automatically expand to enclosing function/class boundaries using Tree-sitter, so you see complete units of code.
|
|
149
|
+
- ⚡ **Query caching** -- exact and semantic cache for fast repeated queries (0.95 cosine threshold).
|
|
150
|
+
- 🩺 **Parse health tracking** -- per-language parse status, failure details, and staleness warnings when the index drifts from your branch.
|
|
151
|
+
- 🔒 **Privacy-first** -- everything runs locally. No external API calls, no telemetry.
|
|
152
|
+
|
|
153
|
+
## Interfaces
|
|
154
|
+
|
|
155
|
+
Search your code four ways — pick what fits your workflow:
|
|
156
|
+
|
|
157
|
+
| Interface | Best for | How to start |
|
|
158
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
159
|
+
| **CLI** | One-off searches, scripting, CI | `cocosearch search "auth flow"` |
|
|
160
|
+
| **Interactive REPL** | Exploratory sessions — tweak filters, switch indexes, iterate on queries without restarting | `cocosearch search --interactive` |
|
|
161
|
+
| **Web Dashboard** | Visual search + index management in the browser — filters, syntax-highlighted results, charts, dark/light theme | `cocosearch dashboard` |
|
|
162
|
+
| **MCP Server** | AI assistant integration ([Claude Code](https://claude.com/product/claude-code), [Claude Desktop](https://claude.com/download), [OpenCode](https://opencode.ai/)) | `cocosearch mcp --project-from-cwd` |
|
|
163
|
+
|
|
164
|
+
### CLI
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Index a project
|
|
168
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch index /path/to/project
|
|
169
|
+
|
|
170
|
+
# Search with natural language
|
|
171
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch search "authentication flow" --pretty
|
|
172
|
+
|
|
173
|
+
# Serve CocoSearch WEB dashboard
|
|
174
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch dashboard
|
|
175
|
+
|
|
176
|
+
# Start interactive REPL
|
|
177
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch search --interactive
|
|
178
|
+
|
|
179
|
+
# View index stats with parse health
|
|
180
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch stats --pretty
|
|
181
|
+
|
|
182
|
+
❯ uv run cocosearch stats --pretty
|
|
183
|
+
|
|
184
|
+
Index: cocosearch
|
|
185
|
+
Source: GIT/personal/coco-s
|
|
186
|
+
Branch: main (0b6050b) · up to date
|
|
187
|
+
Status: Indexed
|
|
188
|
+
Files: 192 | Chunks: 2,023 | Size: 15.0 MB
|
|
189
|
+
Created: 2026-02-09 18:30
|
|
190
|
+
Last Updated: 2026-02-14 12:36 (0 days ago)
|
|
191
|
+
|
|
192
|
+
Language Distribution
|
|
193
|
+
┏━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
194
|
+
┃ Language ┃ Files ┃ Chunks ┃ Distribution ┃
|
|
195
|
+
┡━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
|
196
|
+
│ py │ 162 │ 1648 │ ██████████████████████████████ │
|
|
197
|
+
│ md │ 22 │ 267 │ ████▊ │
|
|
198
|
+
│ html │ 1 │ 100 │ █▊ │
|
|
199
|
+
│ json │ 3 │ 3 │ │
|
|
200
|
+
│ toml │ 1 │ 2 │ │
|
|
201
|
+
│ yaml │ 2 │ 2 │ │
|
|
202
|
+
│ docker-comp… │ 1 │ 1 │ │
|
|
203
|
+
└──────────────┴────────┴──────────┴────────────────────────────────┘
|
|
204
|
+
|
|
205
|
+
Grammar Distribution
|
|
206
|
+
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
|
|
207
|
+
┃ Grammar ┃ Base Language ┃ Files ┃ Chunks ┃ Recognition % ┃
|
|
208
|
+
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
|
|
209
|
+
│ docker-compose │ yaml │ 1 │ 1 │ 100.0% │
|
|
210
|
+
└──────────────────────┴────────────────┴────────┴──────────┴────────────────┘
|
|
211
|
+
|
|
212
|
+
Symbol Statistics
|
|
213
|
+
┏━━━━━━━━━━┳━━━━━━━┓
|
|
214
|
+
┃ Type ┃ Count ┃
|
|
215
|
+
┡━━━━━━━━━━╇━━━━━━━┩
|
|
216
|
+
│ function │ 927 │
|
|
217
|
+
│ class │ 229 │
|
|
218
|
+
└──────────┴───────┘
|
|
219
|
+
|
|
220
|
+
Parse health: 100.0% clean (162/162 files)
|
|
221
|
+
Parse Status by Language
|
|
222
|
+
┏━━━━━━━━━━┳━━━━━━━┳━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┓
|
|
223
|
+
┃ Language ┃ Files ┃ OK ┃ Partial ┃ Error ┃ No Grammar ┃
|
|
224
|
+
┡━━━━━━━━━━╇━━━━━━━╇━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━┩
|
|
225
|
+
│ python │ 162 │ 162 │ 0 │ 0 │ 0 │
|
|
226
|
+
└──────────┴───────┴─────┴─────────┴───────┴────────────┘
|
|
227
|
+
|
|
228
|
+
# View index stats with parse health live
|
|
229
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch stats --live
|
|
230
|
+
|
|
231
|
+
# List all indexes
|
|
232
|
+
uvx --from git+https://github.com/VioletCranberry/coco-s cocosearch list --pretty
|
|
233
|
+
|
|
234
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
|
|
235
|
+
┃ Name ┃ Table ┃ Branch ┃ Status ┃
|
|
236
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
|
|
237
|
+
│ cocosearch │ codeindex_cocosearch__cocosearch_chunks │ main (ed00733) │ Indexed │
|
|
238
|
+
└────────────┴────────────────────────────────────────────┴─────────────────────────┴─────────┘
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
For the full list of commands and flags, see [CLI Reference](./docs/cli-reference.md).
|
|
242
|
+
|
|
243
|
+
### Web Dashboard
|
|
244
|
+
|
|
245
|
+
`cocosearch dashboard` opens a browser UI at `http://localhost:8080` with:
|
|
246
|
+
|
|
247
|
+
- **Code search** — natural language queries with language, symbol type, and hybrid search filters. Results show syntax-highlighted snippets, score badges, match type, and symbol metadata.
|
|
248
|
+
- **Index management** — create, reindex (incremental or fresh), and delete indexes from the browser.
|
|
249
|
+
- **Observability** — language distribution charts, parse health breakdown, staleness warnings, storage metrics.
|
|
250
|
+
|
|
251
|
+
<details>
|
|
252
|
+
<summary>Dashboard screenshots</summary>
|
|
253
|
+
|
|
254
|
+
<p align="center">
|
|
255
|
+
<img src="./docs/dashboard-dark.png" alt="CocoSearch dashboard — dark theme" width="480">
|
|
256
|
+
|
|
257
|
+
<img src="./docs/dashboard-light.png" alt="CocoSearch dashboard — light theme" width="480">
|
|
258
|
+
</p>
|
|
259
|
+
|
|
260
|
+
</details>
|
|
261
|
+
|
|
262
|
+
### Interactive REPL
|
|
263
|
+
|
|
264
|
+
`cocosearch search --interactive` starts a persistent search session:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
cocosearch> authentication middleware
|
|
268
|
+
[results...]
|
|
269
|
+
cocosearch> :lang python
|
|
270
|
+
Language filter: python
|
|
271
|
+
cocosearch> error handling in views
|
|
272
|
+
[results filtered to Python...]
|
|
273
|
+
cocosearch> :index other-project
|
|
274
|
+
Switched to index: other-project
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Settings persist across queries — change `:limit`, `:lang`, `:context`, or `:index` without restarting. Supports command history (up/down arrows) and inline filters (`lang:python` directly in queries).
|
|
278
|
+
|
|
279
|
+
## Where MCP wins
|
|
280
|
+
|
|
281
|
+
For codebases of meaningful size, CocoSearch reduces the number of MCP tool calls needed to find relevant code — often from 5-15 iterative grep/read cycles down to 1-2 semantic searches. This means fewer round-trips, less irrelevant content in the context window, and lower token consumption for exploratory and intent-based queries.
|
|
282
|
+
|
|
283
|
+
- **Exploratory/semantic queries**: "how does authentication work", "where is error handling done", "find the caching logic".
|
|
284
|
+
- Native approach: Claude does 5-15 iterative grep/glob/read cycles, each adding results to context. Lots of trial-and-error, irrelevant matches, and full-file reads.
|
|
285
|
+
- CocoSearch: 1 search_code call returns ranked, pre-chunked results with smart context expansion to function/class boundaries. Dramatically fewer tokens in context.
|
|
286
|
+
- **Identifier search with fuzzy intent**: "find the function that handles user signup".
|
|
287
|
+
- Native grep requires Claude to guess the exact name (grep "signup", grep "register", grep "create_user"...). Each miss costs a round-trip + tokens.
|
|
288
|
+
- CocoSearch's hybrid RRF (vector + keyword) handles this in 1 call.
|
|
289
|
+
- **Filtered searches**: language/symbol type/symbol name filtering is built-in. Native tools require Claude to manually assemble glob patterns and filter results.
|
|
290
|
+
|
|
291
|
+
## Useful Documentation
|
|
292
|
+
|
|
293
|
+
- [How It Works](./docs/how-it-works.md)
|
|
294
|
+
- [Architecture Overview](./docs/architecture.md)
|
|
295
|
+
- [Search Features](./docs/search-features.md)
|
|
296
|
+
- [Dogfooding](./docs/dogfooding.md)
|
|
297
|
+
- [MCP Configuration](./docs/mcp-configuration.md)
|
|
298
|
+
- [MCP Tools Reference](./docs/mcp-tools.md)
|
|
299
|
+
- [CLI Reference](./docs/cli-reference.md)
|
|
300
|
+
- [Retrieval Logic](./docs/retrieval.md)
|
|
301
|
+
- [Adding Languages](./docs/adding-languages.md)
|
|
302
|
+
|
|
303
|
+
## Components
|
|
304
|
+
|
|
305
|
+
- **Ollama** -- runs the embedding model (`nomic-embed-text`) locally.
|
|
306
|
+
- **PostgreSQL + pgvector** -- stores code chunks and their vector embeddings for similarity search.
|
|
307
|
+
- **CocoSearch** -- CLI and MCP server that coordinates indexing and search.
|
|
308
|
+
|
|
309
|
+
### Available MCP Tools
|
|
310
|
+
|
|
311
|
+
- `index_codebase` -- index a directory for semantic search
|
|
312
|
+
- `search_code` -- search indexed code with natural language queries
|
|
313
|
+
- `list_indexes` -- list all available indexes
|
|
314
|
+
- `index_stats` -- get statistics and parse health for an index
|
|
315
|
+
- `clear_index` -- remove an index from the database
|
|
316
|
+
|
|
317
|
+
### Available Skills
|
|
318
|
+
|
|
319
|
+
- **cocosearch-quickstart** ([SKILL.md](./skills/cocosearch-quickstart/SKILL.md)): Use when setting up CocoSearch for the first time or indexing a new project. Guides through infrastructure check, indexing, and verification in under 2 minutes.
|
|
320
|
+
- **cocosearch-debugging** ([SKILL.md](./skills/cocosearch-debugging/SKILL.md)): Use when debugging an error, unexpected behavior, or tracing how code flows through a system. Guides root cause analysis using CocoSearch semantic and symbol search.
|
|
321
|
+
- **cocosearch-onboarding** ([SKILL.md](./skills/cocosearch-onboarding/SKILL.md)): Use when onboarding to a new or unfamiliar codebase. Guides you through understanding architecture, key modules, and code patterns step-by-step using CocoSearch.
|
|
322
|
+
- **cocosearch-refactoring** ([SKILL.md](./skills/cocosearch-refactoring/SKILL.md)): Use when planning a refactoring, extracting code into a new module, renaming across the codebase, or splitting a large file. Guides impact analysis and safe step-by-step execution using CocoSearch.
|
|
323
|
+
- **cocosearch-new-feature** ([SKILL.md](./skills/cocosearch-new-feature/SKILL.md)): Use when adding new functionality — a new command, endpoint, module, handler, or capability. Guides placement, pattern matching, and integration using CocoSearch.
|
|
324
|
+
- **cocosearch-explore** ([SKILL.md](./skills/cocosearch-explore/SKILL.md)): Use for codebase exploration — answering questions about how code works, tracing flows, or researching a topic. Autonomous mode for subagent/plan mode research; interactive mode for user-facing "how does X work?" explanations.
|
|
325
|
+
- **cocosearch-subway** ([SKILL.md](./skills/cocosearch-subway/SKILL.md)): Use when the user wants to visualize codebase structure as an interactive London Underground-style subway map. AI-generated visualization using CocoSearch tools for exploration.
|
|
326
|
+
|
|
327
|
+
## How Search Works
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
Query: "authentication flow"
|
|
331
|
+
─────────────────────────────────────────────────────────────────────
|
|
332
|
+
│
|
|
333
|
+
┌─────────▼──────────┐
|
|
334
|
+
│ Query Analysis │ Detect identifiers
|
|
335
|
+
│ (camelCase, etc.) │ → auto-enable hybrid
|
|
336
|
+
└─────────┬──────────┘
|
|
337
|
+
│
|
|
338
|
+
┌─────────▼──────────┐
|
|
339
|
+
│ Ollama Embedding │ nomic-embed-text
|
|
340
|
+
│ 768-dim vector │ (runs locally)
|
|
341
|
+
└─────────┬──────────┘
|
|
342
|
+
│
|
|
343
|
+
┌───────────────┴───────────────┐
|
|
344
|
+
│ │
|
|
345
|
+
┌─────────▼──────────┐ ┌─────────▼──────────┐
|
|
346
|
+
│ Vector Similarity │ │ Keyword Search │
|
|
347
|
+
│ (pgvector cosine) │ │ (tsvector FTS) │
|
|
348
|
+
└─────────┬──────────┘ └─────────┬──────────┘
|
|
349
|
+
│ │
|
|
350
|
+
└───────────┬───────────────────┘
|
|
351
|
+
│
|
|
352
|
+
┌─────────▼──────────┐
|
|
353
|
+
│ RRF Fusion │ Reciprocal Rank Fusion
|
|
354
|
+
│ + Definition 2x │ merges both ranked lists
|
|
355
|
+
└─────────┬──────────┘
|
|
356
|
+
│
|
|
357
|
+
┌─────────▼──────────┐
|
|
358
|
+
│ Symbol & Language │ --symbol-type function
|
|
359
|
+
│ Filtering │ --language python
|
|
360
|
+
└─────────┬──────────┘
|
|
361
|
+
│
|
|
362
|
+
┌─────────▼──────────┐
|
|
363
|
+
│ Context Expansion │ Expand to enclosing
|
|
364
|
+
│ (Tree-sitter) │ function/class boundaries
|
|
365
|
+
└─────────┬──────────┘
|
|
366
|
+
│
|
|
367
|
+
┌─────────▼──────────┐
|
|
368
|
+
│ Query Cache │ Exact hash + semantic
|
|
369
|
+
│ (LRU + 0.95) │ similarity fallback
|
|
370
|
+
└─────────┬──────────┘
|
|
371
|
+
│
|
|
372
|
+
▼
|
|
373
|
+
Ranked Results
|
|
374
|
+
─────────────────────────────────────────────────────────────────────
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Supported Languages
|
|
378
|
+
|
|
379
|
+
CocoSearch indexes 31 programming languages. Symbol-aware languages (✓) support `--symbol-type` and `--symbol-name` filtering.
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
|
|
383
|
+
┃ Language ┃ Extensions ┃ Symbols ┃
|
|
384
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
|
|
385
|
+
│ C │ .c, .h │ ✓ │
|
|
386
|
+
│ C++ │ .cpp, .cc, .cxx, .hpp, .hxx │ ✓ │
|
|
387
|
+
│ C# │ .cs │ ✗ │
|
|
388
|
+
│ CSS │ .css, .scss │ ✓ │
|
|
389
|
+
│ DTD │ .dtd │ ✗ │
|
|
390
|
+
│ Fortran │ .f, .f90, .f95, .f03 │ ✗ │
|
|
391
|
+
│ Go │ .go │ ✓ │
|
|
392
|
+
│ Groovy │ .groovy, .gradle │ ✗ │
|
|
393
|
+
│ HTML │ .html, .htm │ ✗ │
|
|
394
|
+
│ Java │ .java │ ✓ │
|
|
395
|
+
│ Javascript │ .js, .mjs, .cjs, .jsx │ ✓ │
|
|
396
|
+
│ JSON │ .json │ ✗ │
|
|
397
|
+
│ Kotlin │ .kt, .kts │ ✗ │
|
|
398
|
+
│ Markdown │ .md, .mdx │ ✗ │
|
|
399
|
+
│ Pascal │ .pas, .dpr │ ✗ │
|
|
400
|
+
│ Php │ .php │ ✓ │
|
|
401
|
+
│ Python │ .py, .pyw, .pyi │ ✓ │
|
|
402
|
+
│ R │ .r, .R │ ✗ │
|
|
403
|
+
│ Ruby │ .rb │ ✓ │
|
|
404
|
+
│ Rust │ .rs │ ✓ │
|
|
405
|
+
│ Scala │ .scala │ ✓ │
|
|
406
|
+
│ Solidity │ .sol │ ✗ │
|
|
407
|
+
│ SQL │ .sql │ ✗ │
|
|
408
|
+
│ Swift │ .swift │ ✗ │
|
|
409
|
+
│ TOML │ .toml │ ✗ │
|
|
410
|
+
│ Typescript │ .ts, .tsx, .mts, .cts │ ✓ │
|
|
411
|
+
│ XML │ .xml │ ✗ │
|
|
412
|
+
│ YAML │ .yaml, .yml │ ✗ │
|
|
413
|
+
│ Bash │ .sh, .bash, .zsh │ ✓ │
|
|
414
|
+
│ Dockerfile │ Dockerfile │ ✗ │
|
|
415
|
+
│ HCL │ .tf, .hcl, .tfvars │ ✓ │
|
|
416
|
+
└────────────┴─────────────────────────────┴─────────┘
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
<details>
|
|
420
|
+
<summary>How chunking works</summary>
|
|
421
|
+
|
|
422
|
+
Chunking strategy depends on the language:
|
|
423
|
+
|
|
424
|
+
- **Tree-sitter chunking (~20 languages)**: CocoIndex's `SplitRecursively` uses Tree-sitter internally to split at syntax-aware boundaries (function/class edges). Covers Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, C#, Ruby, PHP, and others in CocoIndex's [built-in list](https://cocoindex.io/docs/ops/functions#supported-languages).
|
|
425
|
+
- **Custom handler chunking (6 languages)**: HCL, Dockerfile, Bash, Go Template, Scala, and Groovy use regex-based `CustomLanguageSpec` separators tuned for their syntax — no Tree-sitter grammar available for these in CocoIndex.
|
|
426
|
+
- **Text fallback**: Languages not recognized by either tier (Markdown, JSON, YAML, TOML, etc.) are split on blank lines and whitespace boundaries.
|
|
427
|
+
|
|
428
|
+
In short: CocoIndex's Tree-sitter tells you _where to cut_; the `.scm` files tell you _what's inside each piece_.
|
|
429
|
+
|
|
430
|
+
Independently of chunking, CocoSearch runs its own Tree-sitter queries (`.scm` files in `src/cocosearch/indexer/queries/`) to extract symbol metadata — function, class, method, and interface names and signatures. This powers `--symbol-type` and `--symbol-name` filtering. Symbol extraction is available for 14 languages.
|
|
431
|
+
|
|
432
|
+
See [Adding Languages](./docs/adding-languages.md) for details on how these tiers work and how to add new languages or grammars.
|
|
433
|
+
|
|
434
|
+
</details>
|
|
435
|
+
|
|
436
|
+
## Supported Grammars
|
|
437
|
+
|
|
438
|
+
Beyond language-level support, CocoSearch recognizes **grammars** — domain-specific schemas within a base language. A **language** is matched by file extension (e.g., `.yaml` -> YAML), while a **grammar** is matched by file path and content patterns (e.g., `.github/workflows/ci.yml` containing `on:` + `jobs:` -> GitHub Actions). Grammars provide structured chunking and richer metadata compared to generic text chunking.
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
442
|
+
┃ Grammar ┃ File Format ┃ Path Patterns ┃
|
|
443
|
+
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
|
444
|
+
│ docker-compose │ yaml │ docker-compose*.yml, docker-compose*.yaml, compose*.yml, compose*.yaml │
|
|
445
|
+
│ github-actions │ yaml │ .github/workflows/*.yml, .github/workflows/*.yaml │
|
|
446
|
+
│ gitlab-ci │ yaml │ .gitlab-ci.yml │
|
|
447
|
+
│ helm-template │ gotmpl │ **/templates/*.yaml, **/templates/**/*.yaml, **/templates/*.yml, │
|
|
448
|
+
│ │ │ **/templates/**/*.yml │
|
|
449
|
+
│ helm-values │ yaml │ **/values.yaml, **/values-*.yaml │
|
|
450
|
+
│ kubernetes │ yaml │ *.yaml, *.yml │
|
|
451
|
+
└────────────────┴─────────────┴──────────────────────────────────────────────────────────────────────────────────┘
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
<details>
|
|
455
|
+
<summary>How grammar matching works</summary>
|
|
456
|
+
|
|
457
|
+
Priority: Grammar match > Language match > TextHandler fallback.
|
|
458
|
+
|
|
459
|
+
A grammar is matched by file path patterns and optionally by content patterns. For example, a YAML file at `.github/workflows/ci.yml` containing `on:` + `jobs:` is recognized as GitHub Actions, not generic YAML. This enables structured chunking by job/step and richer metadata extraction (job names, service names, stages).
|
|
460
|
+
|
|
461
|
+
</details>
|
|
462
|
+
|
|
463
|
+
## Configuration
|
|
464
|
+
|
|
465
|
+
Create `cocosearch.yaml` in your project root to customize indexing:
|
|
466
|
+
|
|
467
|
+
```yaml
|
|
468
|
+
indexing:
|
|
469
|
+
# See also https://cocoindex.io/docs/ops/functions#supported-languages
|
|
470
|
+
include_patterns:
|
|
471
|
+
- "*.py"
|
|
472
|
+
- "*.js"
|
|
473
|
+
- "*.ts"
|
|
474
|
+
- "*.go"
|
|
475
|
+
- "*.rs"
|
|
476
|
+
exclude_patterns:
|
|
477
|
+
- "*_test.go"
|
|
478
|
+
- "*.min.js"
|
|
479
|
+
chunk_size: 1000 # bytes
|
|
480
|
+
chunk_overlap: 300 # bytes
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
## Testing
|
|
484
|
+
|
|
485
|
+
Tests use [pytest](https://docs.pytest.org/). All tests are unit tests, fully mocked, and require no infrastructure. Markers are auto-applied based on directory -- no need to add them manually.
|
|
486
|
+
|
|
487
|
+
```bash
|
|
488
|
+
uv run pytest # Run all unit tests
|
|
489
|
+
uv run pytest tests/unit/search/test_cache.py -v # Single file
|
|
490
|
+
uv run pytest -k "test_rrf_double_match" -v # Single test by name
|
|
491
|
+
uv run pytest tests/unit/handlers/ -v # Handler tests
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
## Troubleshooting
|
|
495
|
+
|
|
496
|
+
**Dashboard shows "Indexing" but CLI shows "Indexed"**
|
|
497
|
+
|
|
498
|
+
The web dashboard and CLI now share a status sync mechanism: when the dashboard detects a live indexing thread, it corrects the database status so both interfaces agree. If you still see a discrepancy, check whether indexing is genuinely running (CPU usage, `docker stats` for Ollama activity).
|
|
499
|
+
|
|
500
|
+
**Index appears stuck in "Indexing" status**
|
|
501
|
+
|
|
502
|
+
After 1 hour with no progress updates, the status auto-recovers to "Indexed". You can also run `cocosearch index .` again to force a fresh index, which will reset the status.
|
|
503
|
+
|
|
504
|
+
**High CPU after indexing appears complete**
|
|
505
|
+
|
|
506
|
+
Ollama may still be processing embeddings in its queue. Check with `docker stats` or `ps aux | grep ollama`. CocoIndex may also perform background cleanup after the main indexing loop finishes.
|