Skip to main content

Repo Indexer

@twonines/repo-indexerv2026.07.13.1· 11d agoMODELS
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.

02Models1
@twonines/repo-indexerv2026.07.13.1mod.ts

Global Arguments

ArgumentTypeDescription
gitlabUrlstringGitLab instance base URL (e.g. https://gitlab.example.com)
gitlabTokenstringPersonal access token with read_repository + read_api scope.
embedUrlstringOpenAI-compatible embeddings endpoint base URL.
embedTokenstringBearer token for the embeddings API.
embedModel?stringEmbedding model ID (default: text-embedding-3-small).
embedDim?numberVector dimension (default: 1536).
excludePatterns?arrayGlob 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
ArgumentTypeDescription
projectPathstringRepository path (e.g. mygroup/myrepo)
fn index_batch(projectPaths: array)
Index multiple repositories in a single call. Clones, chunks,
ArgumentTypeDescription
projectPathsarrayRepository 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.
ArgumentTypeDescription
repostringRepository path (e.g. mygroup/myrepo)
querystringSearch query — natural language or keywords
limit?numberMax results to return (default: 10)
chunkTypes?arrayFilter by chunk type: doc, config, code, ci, schema, other
fn reindex(projectPath: string)
Incrementally reindex a repository. Compares file hashes to detect
ArgumentTypeDescription
projectPathstringRepository path (e.g. mygroup/myrepo)
fn status(repo: string)
Return index metadata for a repository: commit SHA, chunk count,
ArgumentTypeDescription
repostringRepository path (e.g. mygroup/myrepo)
fn discover(groups?: array, activeSince?: string, perPage?: number, maxPages?: number)
Discover active repositories from the GitLab instance. Returns
ArgumentTypeDescription
groups?arrayLimit to these group paths (e.g. ['engineering', 'platform'])
activeSince?stringISO date — only repos with activity after this date (default: 90 days ago)
perPage?numberResults per page (default: 100, max: 100)
maxPages?numberMax 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 Versions3
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