VS Code
Full-featured extension. Recommended for most users.
JetBrains
Plugin for IntelliJ, PyCharm, GoLand, and more.
Visual Studio
Extension for Visual Studio (experimental).
Cody Web
Browser-based chat, no installation required.
Cody CLI
Command-line interface for scripting and exploration.
Enterprise setup
Configure Cody for a self-hosted Sourcegraph instance.
VS Code
The Cody extension for VS Code provides the full set of Cody features: chat, auto-edit, autocomplete, inline edits, prompts, and Smart Apply.Installation
Install the extension
Open VS Code and press
Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows/Linux) to open the Extensions panel.Search for Cody AI and click Install, or install from the VS Code Marketplace.Sign in to Sourcegraph
Click the Cody icon in the Activity Bar. Click Sign In to Your Enterprise Instance and enter your Sourcegraph instance URL.A browser window opens. Click Authorize to grant VS Code access to your account.
Authenticate with an access token (if needed)
If browser authorization does not complete automatically:
- In Sourcegraph, go to Account Settings > Access Tokens
- Click + Generate new token and copy it
- In VS Code, click Sign In to Your Enterprise Instance > Sign In to Sourcegraph Instances v5.1 and above
- Enter your instance URL and paste the token when prompted
VS Code features
| Feature | Details |
|---|---|
| Chat | Sidebar panel with context chips, @-mentions, LLM selection, and chat history |
| Autocomplete | Real-time single/multi-line suggestions with Tab to accept |
| Auto-edit | Context-aware insert/delete suggestions based on cursor and recent edits |
| Inline edit | Opt+K / Alt+K to open edit input on selected code |
| Smart Apply | Applies chat code suggestions directly to the right location in your file |
| Prompts | Access built-in and custom prompts from the chat panel |
| Context filters | Repo-based include/exclude rules for context control |
| Image upload | Drag-and-drop, clipboard paste, or attach button (vision models only) |
Keyboard shortcuts
| Action | macOS | Windows / Linux |
|---|---|---|
| Open / toggle chat | Opt+L | Alt+L |
| New chat session | Shift+Opt+L | Shift+Alt+L |
| Inline edit | Opt+K | Alt+K |
| Quick fix menu | Cmd+. | Ctrl+. |
Selecting context with @-mentions
In the VS Code chat panel:@filename— include a file@filepath:1-50— include a line range@#symbolName— include a function, class, or type definition@repo— include a remote repository
files.exclude, search.exclude, and .gitignore. Cody tracks token usage as you add files, and warns you when approaching the context window limit.
VS Code forks
Cody also works with VS Code forks such as Cursor, Gitpod, and IDX. Select Sign in with URL and access token, generate an access token, and usehttps://sourcegraph.com (or your Enterprise URL) when prompted.
JetBrains
The Cody plugin supports all major JetBrains IDEs.Supported IDEs
- Android Studio
- AppCode
- CLion
- DataGrip
- GoLand
- IntelliJ IDEA (Community and Ultimate)
- PhpStorm
- PyCharm (Community and Professional)
- Rider
- RubyMine
- WebStorm
Installation
Install the plugin
Open your JetBrains IDE and go to Settings (
⌘+, on macOS, Ctrl+Alt+S on Windows/Linux) > Plugins.Search for Cody: AI Coding Assistant with Autocomplete & Chat and click Install.Alternatively, install from the JetBrains Marketplace.Connect to Sourcegraph
After installation, click the Cody icon in the Tool Windows Bar.Click Sign in with an Enterprise Instance and enter your Sourcegraph instance URL. Click Authorize in Browser and complete the authorization.To connect manually, click Show Advanced and enter an access token from Account Settings > Access Tokens in your Sourcegraph instance.
Users must be on JetBrains v2023.2 and Cody plugin v7.0.0 or above to get the updated chat UI. Auto-edit support requires plugin v7.84.0+.
JetBrains features
| Feature | Details |
|---|---|
| Chat | Sidebar panel with @-mention context chips, history, and LLM selection |
| Autocomplete | Single/multi-line suggestions with cycle-through support |
| Auto-edit | Insert/delete suggestions based on context and edits (v7.84.0+) |
| Inline edit | Opt+K / Alt+K on selected code, with Accept / Undo / Show diff |
| Inline fix | Lightbulb > Ask Cody to Fix for detected errors |
| Smart Apply | Click Apply on chat suggestions to insert them at the right location |
| Prompts | Built-in and custom prompts from the Cody panel |
| Image upload | Supported with vision-capable models |
Find Cody actions
PressShift twice in any JetBrains IDE to open Search Everywhere. Type Cody: to see a full list of available Cody actions and commands.
Managing accounts
To add or remove an account:- Click the Cody icon in the toolbar and select the Account icon
- Click Sign Out to remove, or go to Settings > Tools > Sourcegraph & Cody > Authentication to manage multiple accounts
Update channel
To switch between stable and nightly releases:- Open Settings > Tools > Sourcegraph & Cody
- Under Update channel, select
StableorNightly
Visual Studio
The Cody extension for Visual Studio provides chat, autocomplete, auto-edit, and inline edits. It supports Visual Studio 17.6 and above.Installation
Install the extension from the Visual Studio Marketplace by searching for Cody AI by Sourcegraph, or download it directly from the marketplace website. After installation, click the Cody icon in the toolbar and sign in to your Sourcegraph Enterprise instance.Visual Studio features
| Feature | Supported |
|---|---|
| Chat | ✅ |
| Chat history | ✅ |
| Autocomplete | ✅ |
| Auto-edit | ✅ (v17.6+, requires Fireworks) |
| @-file mentions | ✅ |
| @-symbol mentions | ✅ |
| LLM selection | ✅ |
| Image upload | — |
| Smart Apply | — |
Enabling auto-edit in Visual Studio
In the Cody extension settings, enable both:- Automatically trigger completions
- Enable Cody Auto-edit
Cody Web
Cody Web lets you use Cody’s chat features directly in your browser through the Sourcegraph web application — no IDE installation required.Accessing Cody Web
Sign in to your Sourcegraph Enterprise instance and click Cody in the top navigation. The chat interface opens with your repositories available as context. You can also access Cody Web from Code Search: when viewing a file or repository, click the Cody button to open a chat session with that code pre-loaded as context.Cody Web features
| Feature | Supported |
|---|---|
| Chat | ✅ |
| Chat history | ✅ |
| @-file mentions | ✅ |
| @-symbol mentions | ✅ |
| Multi-repo context | ✅ |
| LLM selection | ✅ |
| Prompts | ✅ |
| Promoted prompts | ✅ |
| Image upload | ✅ |
| Autocomplete | — |
| Auto-edit | — |
| Inline edit | — |
Cody CLI
Cody CLI support is experimental for Enterprise accounts.
Installation
- npm
- yarn
- pnpm
Authentication
- Browser (recommended)
- Access token
- Environment variables only
Usage
Basic chat:Enterprise
For organizations running self-hosted or managed Sourcegraph Enterprise, Cody must be enabled by a site administrator.Enabling Cody Enterprise
Site admins enable Cody by adding the following to the site configuration:Model configuration
Enterprise admins configure which LLMs are available to users by editing themodelConfiguration section:
Context filters
Admins can restrict which repositories Cody uses as context:Feature comparison
Chat features
| Feature | VS Code | JetBrains | Visual Studio | Web | CLI |
|---|---|---|---|---|---|
| Chat | ✅ | ✅ | ✅ | ✅ | ✅ |
| Chat history | ✅ | ✅ | ✅ | ✅ | — |
| Edit sent messages | ✅ | ✅ | ✅ | ✅ | — |
| Smart Apply / Execute | ✅ | — | — | — | — |
| @-file | ✅ | ✅ | ✅ | ✅ | — |
| @-symbol | ✅ | — | ✅ | ✅ | — |
| @-directories | ✅ | ✅ | ✅ | ✅ | — |
| Image upload | ✅ | ✅ | — | ✅ | — |
| LLM selection | ✅ | ✅ | ✅ | ✅ | — |
| Multi-repo context | ✅ | ✅ | ✅ | ✅ | — |
| Prompts | ✅ | ✅ | ✅ | ✅ | — |
| Promoted prompts | ✅ | — | — | ✅ | — |
Autocomplete and auto-edit features
| Feature | VS Code | JetBrains | Visual Studio |
|---|---|---|---|
| Single and multi-line autocomplete | ✅ | ✅ | ✅ |
| Cycle through suggestions | ✅ | ✅ | ✅ |
| Accept word-by-word | ✅ | — | — |
| Auto-edit (cursor-based suggestions) | ✅ | ✅ | — |