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

Keyboard shortcuts

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

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

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


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

Confirm the installation:

Authentication

Verify authentication:

Usage

Basic chat:
Chat with file context:
Chat with remote repository context:
Pipe input from stdin:
Generate a commit message from a diff:
Sign out:

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 the modelConfiguration section:

Context filters

Admins can restrict which repositories Cody uses as context:

Feature comparison

Chat features

Autocomplete and auto-edit features