Enabling Cody with Sourcegraph.com

Learn how to connect and use Cody with the Sourcegraph instance.

Cody uses Sourcegraph to provide contextually relevant answers and code. To install and use Cody with your code editor or desktop app, you must connect it to your Sourcegraph.com account. For more advanced and customized usage, it's recommended to enable Cody for Enterprise.

Initial setup

You've now successfully connected Cody to your Sourcegraph.com instance.

Configure code graph context for code-aware answers

After connecting Cody to Sourcegraph.com, you can optionally use code graph context to improve Cody's context of existing code. Note that code graph context is only available for public repositories on sourcegraph.com, which have embeddings.

You can view the list of repositories with embeddings here. To add any of these to your dev environment, contact a Sourcegraph team member via Discord to get help with the access and setup.

To use Cody with code graph on private code, it's recommended to download the Cody App or enable Cody for Enterprise.

Enable code graph context

The Cody: Codebase setting in VS Code enables codebase-aware answers for the Cody extension. Enter the repository's name with embeddings, and Cody can provide more accurate and relevant answers to your coding questions based on that repository's content. To configure this setting in VS Code:

  • Open the Cody Extension Settings
  • Search for the Cody: Codebase
  • Enter the repository name
  • For example: github.com/sourcegraph/sourcegraph without the https protocol

More benefits

Read more about Cody capabilities to learn about all the features it provides to boost your development productivity.

More resources

For more information on what to do next, we recommend the following resources: