Getting Started
LENS indexes your codebase locally and serves context packs to AI agents. No API keys required for local-only usage.
Install
Install LENS globally via npm.
$ npm install -g lens-engine
Quick Start
Start the daemon, register your repo, and query in seconds.
$ lens daemon start LENS daemon running on http://localhost:4111 $ lens repo register Registered: my-project Scanning files... 847 files Building import graph... done Analyzing git history... done Index complete in 2.3s $ lens context "add auth middleware" Context pack: 12 files, 3.2KB src/middleware/auth.ts src/routes/login.ts src/lib/tokens.ts ...
Daemon Mode
The daemon runs on port 4111 and serves the REST API, MCP stdio, and local dashboard.
$ lens daemon start
LENS daemon running on http://localhost:4111
$ lens dashboard
Opening http://localhost:4111/dashboard/
$ curl http://localhost:4111/context \
-H "Content-Type: application/json" \
-d '{"goal": "add auth middleware"}'Pro Features
Authenticate to unlock Voyage semantic embeddings, purpose summaries, and vocab clusters.
$ lens login --github Authenticated as [email protected] $ lens status Pro: active Embeddings: 847/847 files Vocab clusters: 42 clusters
MCP Integration
Claude Code auto-discovers LENS via .mcp.json in your project root. Create the file:
{
"mcpServers": {
"lens": {
"command": "lens-daemon",
"args": ["--stdio"]
}
}
}Claude Code will spawn the daemon in MCP stdio mode and use it for context lookups automatically. No manual configuration needed.
CLI Reference
All commands support --json for machine-readable output.
| Command | Description |
|---|---|
| lens daemon start | Start the HTTP daemon on :4111 |
| lens daemon stop | Stop the running daemon |
| lens daemon stats | Show global statistics |
| lens repo register | Register current repo for indexing |
| lens repo list | List registered repos |
| lens repo remove | Remove current repo |
| lens repo watch | Start file watcher for current repo |
| lens repo unwatch | Stop file watcher for current repo |
| lens repo watch-status | Show watcher status |
| lens index | Index the current repo |
| lens context "<goal>" | Build a context pack for a goal |
| lens status | Show repo index/embedding status |
| lens dashboard | Open local dashboard in browser |
| lens login | Authenticate via OAuth (GitHub/Google) |
| lens logout | Clear cloud authentication |
| lens config get <key> | Get a config value |
| lens config set <key> <val> | Set a config value |