Overview
Sourcebot is an open-source (GitHub), self-hosted code search tool that is purpose built to help teams find and navigate code quickly, at scale.
Deployment guide
Learn how to self-host Sourcebot in a few simple steps.
Public demo
Check out Sourcebot’s features on our public demo instance.
Why Sourcebot?
Why Sourcebot?
- Full-featured search: Fast indexed-based search with regex support, filters, branch search, boolean logic, and more.
- Self-hosted: Ships as a single docker container that can be deployed anywhere.
- Modern design: Light/Dark mode, vim keybindings, keyboard shortcuts, syntax highlighting, etc.
- Scalable: Scales to millions of lines of code.
- Open-source: Core features are MIT licensed, no vendor lock-in.
Features
Find an overview of all Sourcebot features below. For details, see the individual documentation pages.
Fast indexed based search
Search across millions of lines of code instantly using Sourcebot’s blazingly fast indexed search. Find exactly what you are looking for with regular expressions, search filters, boolean logic, and more.
Key benefits
Key benefits
- Regex support: Use regular expressions to find code with precision.
- Query language: Scope searches to specific files, repos, languages, symbol definitions and more using a rich query language.
- Branch search: Specify a list of branches to search across (docs).
- Fast & scalable: Sourcebot uses trigram indexing, allowing it to scale to massive codebases.
- Syntax highlighting: Syntax highlighting support for over 100+ languages.
- Multi-repository: Search across all of your repositories in a single search.
- Search suggestions: Get search suggestions as you craft your query.
- Filter panel: Filter results by repository or by language.
Code Navigation
Code navigation helps you jump between symbol definitions and references quickly when browsing source code in Sourcebot.
Key benefits
Key benefits
- Hover popover: Hovering over a symbol reveals the symbol’s definition signature in a inline preview.
- Go to definition: Navigate to a symbol’s definition(s).
- Find references: Get all references to a symbol.
- Cross-repository: Sourcebot can resolve references and definitions across repositories.
Cross code-host support
Connect your code from multiple code-host platforms and search across all of them from a single interface.
Key benefits
Key benefits
- Auto re-syncing: Sourcebot will periodically sync with code hosts to pull the latest changes.
- Flexible configuration: Sourcebot uses an expressive JSON schema config format to specify exactly what repositories to index (and what not to index).
- Parallel indexing: Repositories are indexed in parallel.
Authentication
Sourcebot comes with built-in support for authentication via email/password, email codes, and various SSO providers.
Key benefits
Key benefits
- Configurable auth providers: Configure the auth providers that are available to your team.
- SSO: Support for various SSO providers.
- (coming soon) RBAC: Role-based access control for managing user permissions.
- (coming soon) Code host permission syncing: Sync permissions from GitHub, Gitlab, etc. to Sourcebot.
- (coming soon) Audit logs: Audit logs for all actions performed on Sourcebot, such as user login, search, etc.
Self-hosted
Sourcebot is designed to be easily self-hosted, allowing you to deploy it onto your own infrastructure, keeping your code private and secure.
Key benefits
Key benefits
- Easy deployment: Sourcebot is shipped as a single docker container that can be deployed to a k8s cluster, a VM, or any other platform that supports docker.
- Secure: Your code never leaves your infrastructure.
- No-vendor lock-in: Avoid dependency on a third-party SaaS provider; you can modify, extend, or migrate your deployment as needed.
Get started
Architecture
Sourcebot is shipped as a single docker container that runs a collection of services using supervisord:
Sourcebot consists of the following components:
- Web Server : main Next.js web application serving the Sourcebot UI.
- Backend Worker : Node.js process that incrementally syncs with code hosts (e.g., GitHub, GitLab etc.) and asynchronously indexes configured repositories.
- Zoekt : the open-source, trigram indexing code search engine that powers Sourcebot under the hood.
- Postgres : transactional database for storing business-logic data.
- Redis Job Queue : fast in-memory store. Used with BullMQ for queuing asynchronous work.
.sourcebot/
cache : file-system cache where persistent data is written.
You can use managed Redis / Postgres services that run outside of the Sourcebot container by providing the REDIS_URL
and DATABASE_URL
environment variables, respectively. See the environment variables doc for more configuration options.
Scalability
One of our design philosophies for Sourcebot is to keep our infrastructure radically simple while balancing scalability concerns. Depending on the number of repositories you have indexed and the instance you are running Sourcebot on, you may experience slow search times or other performance degradations. Our recommendation is to vertically scale your instance by increasing the number of CPU cores and memory.
Sourcebot does not support horizontal scaling at this time, but it is on our roadmap. If this is something your team would be interested in, please contact us at team@sourcebot.dev.
License key
Sourcebot’s core features are available under an MIT license without any limits. Some additional features such as SSO and code navigation require a license key.
Telemetry
By default, Sourcebot collects anonymized usage data through PostHog to help us improve the performance and reliability of our tool. We don’t collect or transmit any information related to your codebase. In addition, all events are sanitized to ensure that no sensitive details (ex. ip address, query info) 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 true
:
If you disabled telemetry correctly, you’ll see the following log when starting Sourcebot: