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

treeseek

v2.1.0

Published

Semantic code search CLI with auto-watching daemon. Uses Ollama + LanceDB — 100% offline and private.

Readme

treeseek

CLI com daemon watcher para busca semântica de código. Indexa codebases com AST-aware chunking, gera embeddings via Ollama e armazena em LanceDB local — 100% offline, gratuito e privado.

Prerequisites

  1. Node.js 20 or 22 (do NOT use Node 24 — incompatible with tree-sitter)
  2. Ollama running locally: https://ollama.com
    ollama serve
  3. Embedding model pulled:
    ollama pull nomic-embed-text

Installation

npm install -g treeseek

Commands

treeseek index <path>              # Index codebase (full or incremental)
treeseek search <query> <path>     # Semantic search
treeseek status <path>             # Check indexing status
treeseek clear <path>              # Remove index
treeseek watch <path>              # Start watching and auto-reindexing
treeseek stop [path]               # Stop watcher (--all for all projects)
treeseek list                       # List watched projects

All commands support --json for machine-readable output.

Examples

# Index and start watching (daemon in background)
treeseek watch /my-project

# Search code semantically
treeseek search "authentication JWT" /my-project
treeseek search "database connection" /my-project --top-k 5 --json

# Check status
treeseek status /my-project

# Stop watching
treeseek stop /my-project

How It Works

  1. AST-Aware Chunking — Tree-sitter parses code in 9 languages (TS, JS, Python, Java, Go, Rust, C++, C#, Scala), splitting by functions, classes and methods
  2. Ollama Embeddings — Generates vectors locally with nomic-embed-text (768 dim). No external APIs
  3. LanceDB — Stores vectors locally in ~/.codebase-indexer/. Cosine similarity search
  4. Merkle DAG — Incremental indexing detects changes via SHA-256 hashes. Only reindexes modified files
  5. Daemon Watcher — treeseek watch monitors file changes with 10s debounce and auto-reindexes

Environment Variables

| Variable | Default | Description | |---|---|---| | OLLAMA_HOST | http://localhost:11434 | Ollama API endpoint | | EMBED_MODEL | nomic-embed-text | Ollama embedding model name | | LANCEDB_PATH | ~/.codebase-indexer | Base directory for LanceDB storage | | EMBEDDING_BATCH_SIZE | 100 | Batch size for embedding generation | | CUSTOM_EXTENSIONS | — | Additional file extensions (comma-separated) | | CUSTOM_IGNORE_PATTERNS | — | Additional ignore patterns (comma-separated) |

Supported Languages

TypeScript, JavaScript, Python, Java, Go, Rust, C, C++, C#, Ruby, PHP, Swift, Kotlin, Scala, Markdown, Jupyter Notebooks.

Architecture

Codebase → Tree-sitter AST → AST Chunker → Ollama Embeddings → LanceDB
                                                           ↓
                                              treeseek search (CLI)
                                                           ↓
                                              Cosine Similarity → Results

Daemon Watcher

treeseek watch <path> starts a background process that:

  • Performs initial indexing if not already indexed
  • Monitors file changes with fs.watchFile (10s debounce)
  • Auto-reindexes only modified/added files
  • Manages PIDs in ~/.treeseek/pids/
  • Logs to ~/.treeseek/logs/
treeseek watch /my-project    # Start daemon
treeseek list                  # List watched projects
treeseek stop /my-project      # Stop specific project
treeseek stop --all            # Stop all watchers