Sourcegraph is a fast and featureful code search and navigation engine.
Features
- Fast global code search with a hybrid backend that combines a trigram index with in-memory streaming.
- Code intelligence for many languages via the Language Server Index Format.
- Enhances GitHub, GitLab, Phabricator, and other code hosts and code review tools via the Sourcegraph browser extension.
- Integration with third-party developer tools via the Sourcegraph extension API.
Sourcegraph has three editions:
- Sourcegraph Cloud lets you search over the open-source ecosystem plus your private code. Search strings, search patterns, search symbols and find references across your entire codebase and the open-source world.
- Sourcegraph Enterprise lets you run your own Sourcegraph instance in your own environment.
- Sourcegraph OSS is an open-source version of Sourcegraph that provides the core functionality of Sourcegraph (code search, code browsing, basic code navigation), but lacks more advanced features (enterprise authentication, repository permissions, admin controls, advanced code navigation, etc.)
Source code for all three editions is contained in this repository. See the License section for more details.
More:
- Install the open-source browser extension to add Sourcegraph-like powers to your code review and code host.
- File feature requests and bug reports in our issue tracker.
- Visit about.sourcegraph.com for more information about features, use cases, and organizations that use Sourcegraph.
The fastest way to run Sourcegraph self-hosted is with the Docker container. See the quickstart installation guide. There are also several additional ways of running a production instance.
- Go through Quickstart to install
sg
and dependencies - Start the development environment in OSS mode:
sg start oss
Sourcegraph should now be running at https://sourcegraph.test:3443.
For detailed instructions and troubleshooting, see the local development documentation.
Refer to the Developing Sourcegraph guide to get started.
The doc
directory has additional documentation for developing and understanding Sourcegraph:
- Project FAQ
- Architecture: high-level architecture
- Database setup: database best practices
- Go style guide
- Documentation style guide
- GraphQL API: useful tips when modifying the GraphQL API
- Contributing
This repository contains both OSS-licensed and non-OSS-licensed files. We maintain one repository rather than two separate repositories mainly for development convenience.
All files in the enterprise
and client/web/src/enterprise
fall under LICENSE.enterprise.
The remaining files fall under the Apache 2 license. Sourcegraph OSS is built only from the Apache-licensed files in this repository.