@gotgenes/pi-colgrep

Pi extension that integrates ColGrep semantic code search as an agent tool.

Packages

Package details

extensionskill

Install @gotgenes/pi-colgrep from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@gotgenes/pi-colgrep
Package
@gotgenes/pi-colgrep
Version
1.5.1
Published
Jun 12, 2026
Downloads
1,588/mo · 76/wk
Author
gotgenes
License
MIT
Types
extension, skill
Size
57.4 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/extension.ts"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@gotgenes/pi-colgrep

npm version CI License: MIT TypeScript pnpm Pi Package

Pi extension that integrates ColGrep semantic code search as a tool available to the agent.

ColGrep is a fully local semantic code search CLI built on multi-vector ColBERT embeddings and tree-sitter parsing. It combines regex filtering with semantic ranking, supports 25 languages, and runs entirely on the user's machine. This package exposes ColGrep as a Pi tool that complements (not replaces) the built-in grep.

Prerequisites

  • ColGrep installed and available on PATH
  • Node.js ≥ 22

Install

pi install npm:@gotgenes/pi-colgrep

Or add it to your Pi settings (~/.pi/agent/settings.json):

{
  "packages": ["npm:@gotgenes/pi-colgrep"]
}

Indexing

The extension keeps a semantic index current for the agent:

  • On session start it builds the index in the background (colgrep init), so it never blocks Pi startup.
  • After each successful write/edit it schedules a debounced reindex — but only when an index already exists for the directory, so a directory you never search is never indexed proactively.
  • Run /colgrep-reindex to build or refresh the index on demand. This also re-enables the write/edit auto-reindex for the rest of the session.

If no index exists and startup indexing is disabled, the extension skips the auto-reindex and notifies you once. A real colgrep search still auto-indexes on demand regardless.

Configuration

Optional configuration is read from a JSON file at two locations, with the project file overriding the global one:

Scope Path
Global <agentDir>/extensions/pi-colgrep/config.json
Project <cwd>/.pi/extensions/pi-colgrep/config.json
Key Type Default Description
indexOnStartup boolean true Build the index in the background on session start. Set to false to skip startup indexing entirely (the index is then built lazily on the first real search or via /colgrep-reindex).

Example — disable startup indexing for a large non-code directory:

{
  "indexOnStartup": false
}

A missing config file is fine (defaults apply); a malformed file is ignored with a warning.

License

MIT