You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blazingly fast code search ποΈ Deployed as a single Docker image π¦ Search million+ lines of code in your GitHub and GitLab repositories πͺ MIT licensed β
Sourcebot is a fast code indexing and search tool for your codebases. It is built ontop of the zoekt indexer, originally authored by Han-Wen Nienhuys and now maintained by Sourcegraph.
demo.mp4
Features
π» One-command deployment: Get started instantly using Docker on your own machine.
π Multi-repo search: Effortlessly index and search through multiple public and private repositories in GitHub or GitLab.
β‘Lightning fast performance: Built on top of the powerful Zoekt search engine.
π Full file visualization: Instantly view the entire file when selecting any search result.
π¨ Modern web app: Enjoy a sleek interface with features like syntax highlighting, light/dark mode, and vim-style navigation
Read the repos listed in default config and start indexing them.
Map port 3000 between your machine and the docker image.
Starts the web server on port 3000.
Configuring Sourcebot
Sourcebot supports indexing and searching through public and private repositories hosted on
GitHub and GitLab. This section will guide you through configuring the repositories that Sourcebot indexes.
Create a new folder on your machine that stores your configs and .sourcebot cache, and navigate into it:
mkdir sourcebot_workspace
cd sourcebot_workspace
Create a new config following the configuration schema to specify which repositories Sourcebot should index. For example, to index llama.cpp:
Mount the current directory (-v $(pwd):/data) to allow Sourcebot to persist the .sourcebot cache.
Mirrors (clones) llama.cpp at HEAD into .sourcebot/github/ggerganov/llama.cpp.
Indexes llama.cpp into a .zoekt index file in .sourcebot/index/.
Map port 3000 between your machine and the docker image.
Starts the web server on port 3000.
You should see a .sourcebot folder in your current directory. This folder stores a cache of the repositories zoekt has indexed. The HEAD commit of a repository is re-indexed every hour. Indexing private repos? See Providing an access token.
[!WARNING]
Depending on the size of your repo(s), SourceBot could take a couple of minutes to finish indexing. SourceBot doesn't currently support displaying indexing progress in real-time, so please be patient while it finishes. You can track the progress manually by investigating the .sourcebot cache in your workspace.
Using GitLab?
tl;dr: A GITLAB_TOKEN is required to index GitLab repositories (both private & public). See Providing an access token.
Currently, the GitLab indexer is restricted to only indexing repositories that the associated GITLAB_TOKEN has access to. For example, if the token has access to foo, bar, and baz repositories, the following config will index all three:
This will depend on the code hosting platform you're using:
GitHub
In order to index private repositories, you'll need to generate a GitHub Personal Access Token (PAT) and pass it to Sourcebot. Create a new PAT here and make sure you select the repo scope:
You'll need to pass this PAT each time you run Sourcebot by setting the GITHUB_TOKEN environment variable:
[!NOTE]
An access token is required to index GitLab repositories (both private & public) since the GitLab indexer needs the token to determine which repositories to index. See example-config.json for example usage.
Generate a GitLab Personal Access Token (PAT) here and make sure you select the read_api scope:
You'll need to pass this PAT each time you run Sourcebot by setting the GITLAB_TOKEN environment variable:
A .sourcebot directory will be created and zoekt will begin to index the repositories found given config.json.
Start searching at http://localhost:3000.
Telemetry
By default, Sourcebot collects anonymized usage data through PostHog to help us improve the performance and reliability of our tool. We do not collect or transmit any information related to your codebase. In addition, all events are sanitized to ensure that no sensitive or identifying details leave your machine. The data we collect includes general usage statistics and metadata such as query performance (e.g., search duration, error rates) to monitor the application's health and functionality. This information helps us better understand how Sourcebot is used and where improvements can be made :)
If you'd like to disable all telemetry, you can do so by setting the environment variable SOURCEBOT_TELEMETRY_DISABLED to 1 in the docker run command:
docker run -e SOURCEBOT_TELEMETRY_DISABLED=1 /* additional args */ ghcr.io/sourcebot-dev/sourcebot:latest
Or if you are building locally, create a .env.local file at the repository root with the following contents:
Blazingly fast code search ποΈ Deployed as a single Docker image π¦ Search million+ lines of code in your GitHub and GitLab repositories πͺ MIT licensed β