| title | Overview |
|---|---|
| sidebarTitle | Overview |
import SupportedPlatforms from '/snippets/platform-support.mdx' import ConfigSchema from '/snippets/schemas/v3/index.schema.mdx'
A connection represents Sourcebot's link to a code host platform (GitHub, GitLab, etc). Connections are defined within the config file you provide Sourcebot.
Each connection defines how Sourcebot should authenticate and interact with a particular host, and which repositories to sync and index from that host. Connections are uniquely identified by their name.
{
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
"connections": {
// 1. A connection to GitHub.com
"github-connection": {
"type": "github",
"repos": [
"sourcebot-dev/sourcebot"
],
"token": {
"env": "GITHUB_TOKEN"
}
},
// 2. A self-hosted GitLab instance
"gitlab-connection": {
"type": "gitlab",
"url": "https://gitlab.example.com",
"groups": [
"my-group",
"my-other-group/sub-group"
],
"token": {
"env": "GITLAB_TOKEN"
}
}
}
}Configuration files must conform to the JSON schema.
When a connection is first discovered, or the resyncConnectionIntervalMs setting has exceeded, the connection will be synced. This consists of:
- Fetching the latest changes from
HEAD(and any additional branches) from the code host. - Re-indexing the repository.
This is processed in a job queue, and is parallelized across multiple worker processes. Jobs will take longer to complete the first time a repository is synced, or when a diff is large.
On the home page, you can view the sync status of ongoing jobs:
<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://framerusercontent.com/assets/7YyxK8ctPEy9Rf68X2kIdMI.mp4"
To learn more about how to create a connection for a specific code host, check out the guides below.
Missing your code host? Submit a feature request on GitHub.
By default, Sourcebot will skip indexing files that are larger than 2MB or have more than 20,000 trigrams. You can configure this by setting the maxFileSize and maxTrigramCount settings.
These limits can be ignored for specific files by passing in a comma separated list of glob patterns matching file paths to the ALWAYS_INDEX_FILE_PATTERNS environment variable. For example:
# Always index all .sum and .lock files
ALWAYS_INDEX_FILE_PATTERNS=**/*.sum,**/*.lockFiles that have been skipped are assigned the skipped language. You can view a list of all skipped files by using the following query:
lang:skipped
Binary files cannot be indexed by Sourcebot. See #575 for more information.
[schemas/v3/index.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/index.json)