Welcome to Sourcegraph docs!
What is Sourcegraph?
Sourcegraph is a code intelligence platform that helps devs answer questions in their code by searching and understanding across their organization's codebase.
Who should use Sourcegraph?
In addition to the companies listed on sourcegraph.com, companies with a few hundred developers all the way up to those with more than 40,000 use Sourcegraph daily.
More specifically, Sourcegraph is great for all developers, except:
- those on smaller teams with a small amount of code
- those that rarely search, read, or review code
Why do I need code search?
Both Facebook and Google provide an in-house Sourcegraph-like code search and intelligence tool to their employees. A published research paper from Google and a Google developer survey showed that 98% of developers surveyed consider their Sourcegraph-like internal tool to be critical. Developers use it on average for 5.3 sessions each day. (Facebook's and Google's in-house tools are not available to other companies; use Sourcegraph instead.)
What do I use Sourcegraph for?
Sourcegraph helps you:
- Find example code
- Explore/read code (including during a code review)
- Debug issues
- Locate a specific piece of code
- Determine the impact of changes
- And more!
Sourcegraph makes it faster and easier to perform these tasks, for you and everyone else at your organization.
What does Sourcegraph do?
Sourcegraph's main features are:
- Code navigation: jump-to-definition, find references, and other smart, IDE-like code browsing features on any branch, commit, or PR/code review
- Code search: fast, up-to-date, and scalable, with regexp support on any branch or commit without an indexing delay (and diff search)
- Notebooks: pair code and markdown to create powerful live and persistent documentation
- Cody: read and write code with the help of a context-aware AI code assistant
- Code Insights: reveal high-level information about your codebase at its current state and over time, to track migrations, version usage, vulnerability remediation, ownership, and anything else you can search in Sourcegraph
- Batch Changes: make large-scale code changes across many repositories and code hosts
- Integrations with code hosts, code review tools, editors, web browsers, etc.
How do I start using Sourcegraph?
- Deploy and Configure Sourcegraph inside your organization on your internal code, if nobody else has yet
- Install and configure the web browser code host integrations (recommended)
- Start searching and browsing code on Sourcegraph by visiting the URL of your organization's internal Sourcegraph instance
- Personalize Sourcegraph with themes, quick links, and badges!
You can also try Sourcegraph.com, which is a public instance of Sourcegraph for use on open-source code only.
How is Sourcegraph licensed?
Sourcegraph Enterprise is Sourcegraph’s primary offering and includes all code intelligence platform features. Sourcegraph Enterprise is the best solution for enterprises who want to use Sourcegraph with their organization’s code.
Sourcegraph extensions are also OSS licensed (Apache 2), such as:
How is Sourcegraph different than GitHub code search?
Sourcegraph code search is fast, works across all your repositories at any commit, and has minimal indexing delay. Code search also includes advanced features, including:
- Powerful, flexible query syntax
- Commit diff search
- Commit message search
- Saved search scopes
- Search contexts to search across a set of repositories at specific revisions
- Saved search monitoring
Read the code search documentation to learn more and discover the full feature set. Here's a video to help you get started:
Sourcegraph gives your development team cross-repository IDE-like features on your code:
- Hover tooltips
- Find references
- Symbol search
Sourcegraph gives you code navigation in:
- code files in Sourcegraph's web UI
- diffs in your code review tool, via integrations
- code files on your code host, via integrations
Read the code navigation documentation to learn more and to set it up.
Cody is an AI code assistant that uses Sourcegraph code search, the code graph, and LLMs to provide context-aware answers about your codebase. Cody can explain code, refactor code, and write code, all within the context of your existing codebase.
Note: GA in version 3.39 or later
Increase dev collaboration and self-service through live documentation covering best practice, shared code and processes.
Note: Enterprise Feature
Automate changes to your codebase. Reduce effort, reduce errors and enable developers to focus on high value work.
Note: Enterprise Feature
Sourcegraph lets you understand and analyze code trends by visualizing how the codebase is changing over time. Measure and act on engineering goals such as migration and component deprecation.
Read the code insights documentation to learn more, including useful how-to guides.
Sourcegraph allows you to get code navigation and code search on code files and code review diffs in your code host and review tool or from your IDE.
Sourcegraph’s editor integrations allow you search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. Learn more about how to set them up here.
Our browser extension add code navigation within your code hosts (GitHub, GitLab, Bitbucket, and Phabricator) directly via Chrome, Safari, and Firefox browsers. Learn more about how to set up the browser extension here.