npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-codebase-indexing

v0.4.0

Published

OpenCode plugin for Kilo-style codebase indexing and semantic search.

Readme

OpenCode Codebase Indexing

OpenCode plugin for Kilo-style semantic codebase indexing. It indexes the workspace on startup, keeps the index fresh with a file watcher, stores vectors in Qdrant, and exposes semantic search as OpenCode tools.

Features

  • Auto-index on plugin startup.
  • Incremental updates on file create, edit, and delete.
  • Public statuses: indexing, complete, and error.
  • Qdrant-compatible vector storage.
  • Embedding providers: ollama, openai, openrouter, and custom.
  • Custom tools:
    • semantic_search
    • codebase_index_status
    • codebase_reindex
    • codebase_index_config

Local Development

Install dependencies:

npm install

Build:

npm run build

Use the included local plugin shim at:

.opencode/plugins/codebase-indexing.ts

OpenCode loads local plugins from .opencode/plugins/ at startup.

Configuration

You can configure indexing globally once, then let every project use the same settings. Each project still gets its own Qdrant collection because the plugin hashes the workspace path into the collection name.

Global config path:

~/.config/opencode/codebase-indexing.json

On Windows, that is usually:

C:\Users\<you>\.config\opencode\codebase-indexing.json

Project overrides are optional:

<project>/.opencode/codebase-indexing.json

Precedence is:

environment variables > project config > global config > defaults

Example global config:

{
  "enabled": true,
  "provider": "openrouter",
  "model": "qwen/qwen3-embedding",
  "dimension": 1024,
  "qdrant": {
    "url": "http://localhost:6333"
  },
  "searchMinScore": 0.6,
  "searchMaxResults": 50,
  "embeddingBatchSize": 60,
  "scannerMaxBatchRetries": 3
}

You can also point at a custom shared config file with:

OPENCODE_INDEX_CONFIG

Supported providers:

  • ollama
  • openai
  • openrouter
  • custom

custom means any OpenAI-compatible embedding endpoint.

Environment Variables

Environment variables override config for secrets and deployment-specific endpoints.

OPENCODE_INDEX_EMBEDDER
OPENCODE_INDEX_MODEL
OPENCODE_INDEX_DIMENSION
OPENAI_API_KEY
OPENCODE_INDEX_OPENROUTER_API_KEY
OPENCODE_INDEX_OPENROUTER_BASE_URL
OPENCODE_INDEX_OPENROUTER_SPECIFIC_PROVIDER
OPENCODE_INDEX_CUSTOM_BASE_URL
OPENCODE_INDEX_CUSTOM_API_KEY
OPENCODE_INDEX_OLLAMA_BASE_URL
OPENCODE_INDEX_QDRANT_URL
OPENCODE_INDEX_QDRANT_API_KEY
OPENCODE_INDEX_SEARCH_MIN_SCORE
OPENCODE_INDEX_SEARCH_MAX_RESULTS
OPENCODE_INDEX_EMBEDDING_BATCH_SIZE
OPENCODE_INDEX_SCANNER_MAX_BATCH_RETRIES

Defaults:

  • Qdrant URL: http://localhost:6333
  • Ollama base URL: http://localhost:11434
  • OpenRouter base URL: https://openrouter.ai/api/v1
  • Search min score: 0.4
  • Search max results: 50
  • Embedding batch size: 60
  • Scanner max batch retries: 3

Qdrant

Start a local Qdrant instance:

docker run -p 6333:6333 qdrant/qdrant

For hosted Qdrant, set OPENCODE_INDEX_QDRANT_URL and OPENCODE_INDEX_QDRANT_API_KEY.

Attribution

This plugin mirrors Kilo Code's codebase indexing behavior and architecture. Kilo Code is MIT-licensed:

https://github.com/Kilo-Org/kilocode