Installer Sourcegraph Cody dans VS Code : connexion, éditions inline et chat codebase

Installer l’extension Cody, terminer la connexion Enterprise, puis obtenir la première suggestion inline ou poser une question codebase avec @ dans votre dépôt.

The first hour with Sourcegraph Cody in VS Code usually breaks on the wrong extension, never finishing Enterprise instance sign-in, or never seeing inline completions, Edit Code, and chat with @ codebase context connect. Install from official docs, authenticate in the browser, then trigger one suggestion or ask one codebase question in a repo you own.

La requête est installer et utiliser Sourcegraph Cody dans VS Code. Cette page suit Sourcegraph docs at sourcegraph.com/docs/cody/clients/install-vscode, the quickstart at sourcegraph.com/docs/cody/quickstart, and Marketplace item sourcegraph.cody-ai. C’est l’assistant IDE Sourcegraph, pas le produit réunion de ce site. Huddle court : salle sur wbmeet; see créer et rejoindre une salle.

Installer l’extensionSe connecter à l’instanceSuggestions & chat

Vérifier l’accès Enterprise Cody

Cody is Sourcegraph’s AI assistant in the IDE: inline autocomplete, sidebar chat, Edit Code inline edits, and codebase context fetched through the Sourcegraph search engine. The VS Code extension is published by Sourcegraph as sourcegraph.cody-ai. Marketplace and official docs state Cody now requires a Sourcegraph Enterprise account with Cody enabled on the instance; non-enterprise personal use is no longer available. Self-hosted instances need cody.enabled: true in site configuration plus an LLM provider.

1 ext
Marketplace: sourcegraph.cody-ai
@ ctx
@-file / @#symbol chat context
⌥K edit
Edit Code inline (macOS)

Première heure : installer, se connecter, suggestions, Edit Code, chat

  1. 1

    Install Cody from the Marketplace

    Open VS Code. Cmd+Shift+X or Ctrl+Shift+X. Search Cody AI, publisher Sourcegraph, Install. Or Quick Open (Cmd+P / Ctrl+P): ext install sourcegraph.cody-ai. Reload if prompted. The Cody icon appears in the Activity Bar.

  2. 2

    Sign in to your Sourcegraph Enterprise instance

    Click the Cody icon, choose Sign In to Your Enterprise Instance, enter the admin-provided URL (self-hosted like https://sourcegraph.example.com, or cloud URL from your account team). Authorize in the browser, return to VS Code and click Open. If browser auth fails: generate a token under Account Settings → Access Tokens, then choose Sign In to Sourcegraph Instances v5.1 and above and paste the token.

  3. 3

    Verify inline autocomplete

    File → Open Folder on a project you can roll back. Open a source file and type normally. Gray inline completions should appear after a few seconds; Tab to accept, Esc to dismiss. Official docs suggest typing in an empty function like function bubbleSort(array) {} to test context-aware suggestions.

  4. 4

    Run your first Edit Code inline edit

    Select code (or place the cursor in a function), press Opt+K (macOS) or Alt+K (Windows/Linux), or right-click Cody → Edit Code. Describe the change, e.g. “Add JSDoc to this function.” Review the diff before accepting. The first-hour goal is confirming Edit responds—not shipping to production.

  5. 5

    Chat with @-mention codebase context

    Press Opt+L / Alt+L to open Cody chat. New chats show default context chips for the current repo and file. Type @ plus a filename or @# plus a symbol name. Start read-only: “Where is the main entry point in this repo?” or “Explain @#main.” Smart Apply can insert chat suggestions into files. Do not paste secrets into prompts.

# First hour · Sourcegraph Cody in VS Code · as of 2026-09
# 1. Extensions → Cody AI (publisher Sourcegraph)
#    id: sourcegraph.cody-ai
# 2. Cody icon → Sign In to Your Enterprise Instance
#    URL from admin · browser Authorize · or access token (v5.1+)
# 3. Open your repo. Type in a source file → Tab to accept ghost text
# 4. Select code → Opt+K / Alt+K → "Add error handling to this function"
# 5. Opt+L chat: "@src/index.ts where is the main entry point?"
# Do not commit access tokens. Cody requires Enterprise access.

Sign-in paths, features, pitfalls

FeatureWhat official docs sayFirst-hour note
Inline autocompleteGhost text while typing; Tab to acceptConfirm sign-in and Cody enabled first
Edit CodeOpt+K / Alt+K or Cody → Edit CodeSelect code, review diffs
Chat + context@file, @#symbol, default repo/file chipsStart with a read-only question
Smart ApplyApply button on chat code blocksApply blocks one at a time
Access tokenAccount Settings → Access TokensTreat like a password; never commit
01

Installed but no sign-in option

Confirm you have the latest sourcegraph.cody-ai. Uninstall older Cody builds, reload VS Code. Enterprise users choose Sign In to Your Enterprise Instance—not the retired personal free path.

02

Unsure of the instance URL

Ask your Sourcegraph admin or account manager. Self-hosted and Sourcegraph Cloud URLs differ; a wrong URL breaks browser authorization.

03

Chat cannot find repo context

Check Cody Context Filters and whether cody.enabled is on. Excluded repos cannot be @-mentioned.

Official install path: Marketplace Cody AI → Cody icon → Sign In to Your Enterprise Instance → browser Authorize → type to test completions → Opt+K for Edit → Opt+L chat with @ context. Plans follow Sourcegraph Enterprise docs and cody.dev.

Enterprise is required
Marketplace states Cody is no longer for non-enterprise users. Contact your org admin or Sourcegraph sales—do not use shared or stolen accounts.
@ context has token limits
@-mentioning large files fills the model context window and may show File too large. Prefer symbols or line ranges like @file:1-50.
This is not a meeting-product guide
Only Cody’s first hour. Short whiteboard call: wbmeet or quand ne pas ouvrir une appli de réunion lourde.

Questions à recouper

Cody gratuit en personnel ?

No. Sourcegraph Marketplace and docs require a Sourcegraph Enterprise account with Cody enabled on the instance. Individual developers need a company subscription or contact Sourcegraph sales about Enterprise plans.

Autorisation navigateur échouée ?

Generate a token under Account Settings → Access Tokens on your instance, return to VS Code, choose Sign In to Sourcegraph Instances v5.1 and above, and paste the token. Never commit tokens to source control.

Inline vs Edit Code ?

Inline completions are gray ghost text while typing; Tab accepts. Edit Code (Opt+K) targets a selected block with a natural-language instruction and produces a focused diff. Chat is for cross-file questions with @-mention codebase context.

Première tâche en prod ?

No. Test completions in a small file, try Edit Code on a comment or type, then ask a read-only chat question. After it works, make one reversible change and review every line.

Démarrer une réunion gratuite