Skip to main content
Cody is available as an extension for VS Code, JetBrains IDEs, and Visual Studio, as well as via the Sourcegraph web app and a command-line interface. Choose the client that fits your workflow.

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

1

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.
2

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.
3

Authenticate with an access token (if needed)

If browser authorization does not complete automatically:
  1. In Sourcegraph, go to Account Settings > Access Tokens
  2. Click + Generate new token and copy it
  3. In VS Code, click Sign In to Your Enterprise Instance > Sign In to Sourcegraph Instances v5.1 and above
  4. Enter your instance URL and paste the token when prompted

VS Code features

FeatureDetails
ChatSidebar panel with context chips, @-mentions, LLM selection, and chat history
AutocompleteReal-time single/multi-line suggestions with Tab to accept
Auto-editContext-aware insert/delete suggestions based on cursor and recent edits
Inline editOpt+K / Alt+K to open edit input on selected code
Smart ApplyApplies chat code suggestions directly to the right location in your file
PromptsAccess built-in and custom prompts from the chat panel
Context filtersRepo-based include/exclude rules for context control
Image uploadDrag-and-drop, clipboard paste, or attach button (vision models only)

Keyboard shortcuts

ActionmacOSWindows / Linux
Open / toggle chatOpt+LAlt+L
New chat sessionShift+Opt+LShift+Alt+L
Inline editOpt+KAlt+K
Quick fix menuCmd+.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
File lookups respect 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 use https://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

1

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.
2

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

FeatureDetails
ChatSidebar panel with @-mention context chips, history, and LLM selection
AutocompleteSingle/multi-line suggestions with cycle-through support
Auto-editInsert/delete suggestions based on context and edits (v7.84.0+)
Inline editOpt+K / Alt+K on selected code, with Accept / Undo / Show diff
Inline fixLightbulb > Ask Cody to Fix for detected errors
Smart ApplyClick Apply on chat suggestions to insert them at the right location
PromptsBuilt-in and custom prompts from the Cody panel
Image uploadSupported with vision-capable models

Find Cody actions

Press Shift 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:
  1. Click the Cody icon in the toolbar and select the Account icon
  2. 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:
  1. Open Settings > Tools > Sourcegraph & Cody
  2. Under Update channel, select Stable or Nightly

Visual Studio

Cody for Visual Studio is experimental. Some features available in VS Code and JetBrains may not yet be supported.
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

FeatureSupported
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:
  1. Automatically trigger completions
  2. Enable Cody Auto-edit
To switch back to autocomplete, deselect 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

FeatureSupported
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.
The Cody CLI uses the same underlying technology as the IDE plugins but runs from your terminal. Use it for ad-hoc exploration or to automate workflows with scripts.

Installation

npm install -g @sourcegraph/cody
Confirm the installation:
cody help

Authentication

Verify authentication:
cody auth whoami
# ✔ Authenticated as USERNAME on ENDPOINT

Usage

Basic chat:
cody chat -m 'Explain React hooks'
Chat with file context:
cody chat --context-file src/controller.ts -m 'Are there code smells in this file?'
Chat with remote repository context:
cody chat --context-repo github.com/sourcegraph/cody -m 'What is the agent?'
Pipe input from stdin:
echo 'Explain React hooks' | cody chat --stdin
Generate a commit message from a diff:
git diff | cody chat --stdin -m 'Write a commit message for this diff'
Sign out:
cody auth logout

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:
"cody.enabled": true

Model configuration

Enterprise admins configure which LLMs are available to users by editing the modelConfiguration section:
"modelConfiguration": {
  "sourcegraph": {
    "modelFilters": {
      "statusFilter": ["beta", "stable"],
      "allow": [
        "anthropic::*",
        "openai::*",
        "google::*",
        "fireworks::*"
      ]
    }
  }
}

Context filters

Admins can restrict which repositories Cody uses as context:
"cody.contextFilters": {
  "include": [
    { "repoNamePattern": "^github.com/my-org/.*" }
  ],
  "exclude": [
    { "repoNamePattern": "^github.com/my-org/internal-secrets$" }
  ]
}

Feature comparison

Chat features

FeatureVS CodeJetBrainsVisual StudioWebCLI
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

FeatureVS CodeJetBrainsVisual Studio
Single and multi-line autocomplete
Cycle through suggestions
Accept word-by-word
Auto-edit (cursor-based suggestions)

Build docs developers (and LLMs) love