Greptile
AI-powered codebase search and Q&A
Query and search codebases using natural language with Greptile. Get AI-generated answers about your code, find relevant files, and understand complex codebases.
Query repositories in natural language and get answers with relevant code references. Greptile uses AI to understand your codebase and answer questions.
| Parameter | Type | Required | Description |
|---|
query | string | Yes | Natural language question about the codebase. Example: "How does authentication work?" or "Where is the payment processing logic?" |
repositories | string | Yes | Comma-separated list of repositories. Format: "github:branch:owner/repo" or just "owner/repo" (defaults to github:main). Example: "facebook/react" or "github:main:facebook/react,github:main:facebook/relay" |
sessionId | string | No | Session ID for conversation continuity. Use the same sessionId across multiple queries to maintain context. Example: "session-abc123" |
genius | boolean | No | No description |
apiKey | string | Yes | No description |
githubToken | string | Yes | No description |
| Parameter | Type | Description |
|---|
message | string | AI-generated answer to the query |
sources | array | Relevant code references that support the answer |
↳ repository | string | Repository name (owner/repo) |
↳ remote | string | Git remote (github/gitlab) |
↳ branch | string | Branch name |
↳ filepath | string | Path to the file |
↳ linestart | number | Starting line number |
↳ lineend | number | Ending line number |
↳ summary | string | Summary of the code section |
↳ distance | number | Similarity score (lower = more relevant) |
Search repositories in natural language and get relevant code references without generating an answer. Useful for finding specific code locations.
| Parameter | Type | Required | Description |
|---|
query | string | Yes | Natural language search query to find relevant code. Example: "authentication middleware" or "database connection handling" |
repositories | string | Yes | Comma-separated list of repositories. Format: "github:branch:owner/repo" or just "owner/repo" (defaults to github:main). Example: "facebook/react" or "github:main:facebook/react,github:main:facebook/relay" |
sessionId | string | No | Session ID for conversation continuity. Use the same sessionId across multiple searches to maintain context. Example: "session-abc123" |
genius | boolean | No | No description |
apiKey | string | Yes | No description |
githubToken | string | Yes | No description |
| Parameter | Type | Description |
|---|
sources | array | Relevant code references matching the search query |
↳ repository | string | Repository name (owner/repo) |
↳ remote | string | Git remote (github/gitlab) |
↳ branch | string | Branch name |
↳ filepath | string | Path to the file |
↳ linestart | number | Starting line number |
↳ lineend | number | Ending line number |
↳ summary | string | Summary of the code section |
↳ distance | number | Similarity score (lower = more relevant) |
Submit a repository to be indexed by Greptile. Indexing must complete before the repository can be queried. Small repos take 3-5 minutes, larger ones can take over an hour.
| Parameter | Type | Required | Description |
|---|
remote | string | Yes | No description |
repository | string | Yes | Repository in owner/repo format. Example: "facebook/react" or "vercel/next.js" |
branch | string | Yes | Branch to index (e.g., "main" or "master") |
reload | boolean | No | No description |
notify | boolean | No | No description |
apiKey | string | Yes | No description |
githubToken | string | Yes | No description |
| Parameter | Type | Description |
|---|
repositoryId | string | Unique identifier for the indexed repository (format: remote:branch:owner/repo) |
statusEndpoint | string | URL endpoint to check indexing status |
message | string | Status message about the indexing operation |
Check the indexing status of a repository. Use this to verify if a repository is ready to be queried or to monitor indexing progress.
| Parameter | Type | Required | Description |
|---|
remote | string | Yes | No description |
repository | string | Yes | Repository in owner/repo format. Example: "facebook/react" or "vercel/next.js" |
branch | string | Yes | Branch name (e.g., "main" or "master") |
apiKey | string | Yes | No description |
githubToken | string | Yes | No description |
| Parameter | Type | Description |
|---|
repository | string | Repository name (owner/repo) |
remote | string | Git remote (github/gitlab) |
branch | string | Branch name |
private | boolean | Whether the repository is private |
status | string | Indexing status: submitted, cloning, processing, completed, or failed |
filesProcessed | number | Number of files processed so far |
numFiles | number | Total number of files in the repository |
sampleQuestions | array | Sample questions for the indexed repository |
sha | string | Git commit SHA of the indexed version |