Repo Indexer
@twonines/repo-indexerv2026.07.13.1
01README
Clones a GitLab repository, chunks all text files, embeds them via an OpenAI-compatible API, and writes a SQLite database supporting hybrid search (FTS5 keyword + vector cosine with RRF reranking). Methods: index, index_batch, search, reindex, status, discover, list-indexed, list-searches.
02Models
@twonines/repo-indexerv2026.07.13.1mod.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| gitlabUrl | string | GitLab instance base URL (e.g. https://gitlab.example.com) |
| gitlabToken | string | Personal access token with read_repository + read_api scope. |
| embedUrl | string | OpenAI-compatible embeddings endpoint base URL. |
| embedToken | string | Bearer token for the embeddings API. |
| embedModel? | string | Embedding model ID (default: text-embedding-3-small). |
| embedDim? | number | Vector dimension (default: 1536). |
| excludePatterns? | array | Glob patterns for files to exclude from indexing (e.g. ['*-lock.*', '*.lock', 'static/data/**']). |
fn index(projectPath: string)
Clone a repository, chunk all text files, embed them, and write
| Argument | Type | Description |
|---|---|---|
| projectPath | string | Repository path (e.g. mygroup/myrepo) |
fn index_batch(projectPaths: array)
Index multiple repositories in a single call. Clones, chunks,
| Argument | Type | Description |
|---|---|---|
| projectPaths | array | Repository paths to index (e.g. ['group/repo1', 'group/repo2']) |
fn search(repo: string, query: string, limit?: number, chunkTypes?: array)
Search a repository's index with hybrid FTS5 + vector search.
| Argument | Type | Description |
|---|---|---|
| repo | string | Repository path (e.g. mygroup/myrepo) |
| query | string | Search query — natural language or keywords |
| limit? | number | Max results to return (default: 10) |
| chunkTypes? | array | Filter by chunk type: doc, config, code, ci, schema, other |
fn reindex(projectPath: string)
Incrementally reindex a repository. Compares file hashes to detect
| Argument | Type | Description |
|---|---|---|
| projectPath | string | Repository path (e.g. mygroup/myrepo) |
fn status(repo: string)
Return index metadata for a repository: commit SHA, chunk count,
| Argument | Type | Description |
|---|---|---|
| repo | string | Repository path (e.g. mygroup/myrepo) |
fn discover(groups?: array, activeSince?: string, perPage?: number, maxPages?: number)
Discover active repositories from the GitLab instance. Returns
| Argument | Type | Description |
|---|---|---|
| groups? | array | Limit to these group paths (e.g. ['engineering', 'platform']) |
| activeSince? | string | ISO date — only repos with activity after this date (default: 90 days ago) |
| perPage? | number | Results per page (default: 100, max: 100) |
| maxPages? | number | Max pages to fetch (default: 10) |
Resources
index(infinite)— SQLite index database for a repository
search(1h)— Search results from a hybrid query
status(1h)— Index metadata for a repository
discovery(infinite)— List of discovered repos matching filters
list-indexed(1h)— List of all repos with an existing index
list-searches(1h)— Recent search results, optionally filtered by repo
index-batch-result(1h)— Summary of an index_batch call: which repos succeeded, which failed and why
03Previous Versions
2026.07.10.1
Modified 1 models
2026.07.08.1
Modified 1 models
2026.07.07.1
04Stats
A
100 / 100
Downloads
3
Archive size
125.9 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
05Platforms
06Labels