Cody uses Sourcegraph to fetch relevant context to generate answers and code. These instructions walk through installing Cody in your editor and connecting it to Sourcegraph.com and is the best option if you're interested in using Cody on public code. To use Cody on your local code, download the Cody App or see this page about enabling Cody for Enterprise.
- Create a Sourcegraph.com account
- Install the Cody VS Code extension
- Open the Cody extension
- Click on Continue with Sourcegraph.com and follow the instructions
You're now ready to use Cody in VS Code!
After installing, 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. See the list of repositories with embeddings and request any that you'd like to add by pinging a Sourcegraph team member in Discord.
If you want to use Cody with code graph context on private code, consider downloading the Cody App or moving to a Sourcegraph Enterprise instance.
The Cody: Codebase
setting in VS Code enables codebase-aware answers for the Cody extension. By setting this configuration option to the name of a repository with embeddings, Cody will be able to provide more accurate and relevant answers to your coding questions based on that repository's content.
- Open the VS Code workspace settings by pressing Cmd/Ctrl+,, (or File > Preferences (Settings) on Windows & Linux).
- Search for the
Cody: Codebase
setting. - Enter the repository name.
- For example:
github.com/sourcegraph/sourcegraph
without thehttps
protocol
- For example:
Please spread the word online and send us your feedback in Discord! Cody is open source and we'd love to hear from you if you have bug reports or feature requests.