guest@opencode:~$
Ask "how does auth work?"
══════════════════════════════════════

features --list

tree-sitter --parse

$ tree-sitter --parse

Extracts functions, classes, and methods as clean semantic blocks. Understands structure, not just text.

TypeScriptJavaScriptPythonPHP
sha256 --cache

$ sha256 --cache

Re-indexing only processes changed files. "157 unchanged, 2 updated" is the norm. No API waste.

hashincremental
./search "query"

$ ./search "auth flow"

Describe what you’re looking for in plain English. Cosine similarity finds the closest matches across your entire codebase.

cosinevector
lancedb --init

$ lancedb --init

Embedded vector store — no server, no Docker, no API key. Just works. Qdrant available for team deployments.

zero-depsembedded
chokidar --watch

$ chokidar --watch

Keeps the index fresh as you edit. Save a file → re-indexed in 600ms. Delete → blocks purged automatically.

livedebounce
git --branch-aware

$ git --branch-aware

Opt-in branch polling. Switch branches → auto re-index with hash caching. No stale blocks from the wrong branch.

opt-inpolling

languages --supported

parser --list
Tree-sitter AST (semantic blocks)Line-based (fallback)
TypeScript (.ts, .tsx)Ruby, Go, Rust, Java, Kotlin
JavaScript (.js, .jsx, .mjs, .cjs)C, C++, Swift, Zig
Python (.py)CSS, SCSS, HTML, Vue, Svelte
PHP (.php)Markdown, JSON, YAML, TOML, Bash

install --global

install.sh
$git clone https://github.com/jbpraxxys/opencode-indexer.git ~/opencode-indexer
$cd ~/opencode-indexer
$npm install
$npm run build
✓ 3 packages installed in 4.2s
// add to ~/.config/opencode/opencode.json
"plugin": [["~/opencode-indexer", {
  "embedder": "openai",
  "openaiApiKey": "sk-...",
  "model": "text-embedding-3-small"
}]]
quickstart.sh
# opt in your project
$touch .codebase-index
# restart OpenCode, then ask:
$codebase_search "how does auth work"
# install the agent skill
$mkdir -p ~/.config/opencode/skills/opencode-indexer
$cp skills/opencode-indexer/SKILL.md ~/.config/opencode/skills/opencode-indexer/
✓ Index built: 142 files → 847 blocks
⚡ Search complete in 47ms

config --list

env
OptionDefaultDescription
embedder"ollama""openai" or "ollama"
model"nomic-embed-text"Embedding model name
vectorStore"lancedb""qdrant" or "lancedb"
batchSize20Embedding batch size
maxResults20Max search results returned
branchAwarefalseAuto re-index on git branch switch

cli --help

cli.mjs
$node cli.mjs index ~/Sites/my-project
# Full index with tree-sitter parsing + hash caching
$node cli.mjs search ~/Sites/my-project "auth flow"
# Semantic search across indexed code
$node cli.mjs status ~/Sites/my-project
# Check index stats and project opt-in
$node cli.mjs clear ~/Sites/my-project
# Delete index for a project