# Cody by Sourcegraph — AI with Full Codebase Context > AI code assistant that understands your entire codebase. Chat, completions, edits, and deep search across repos. Enterprise-grade. ## Install Save in your project root: # Cody by Sourcegraph — AI with Full Codebase Context ## Quick Use 1. Open VS Code Extensions panel (Ctrl+Shift+X) 2. Search "Cody" and install **Cody AI by Sourcegraph** 3. Or install via CLI: ```bash code --install-extension sourcegraph.cody-ai ``` 4. Sign in with your Sourcegraph or GitHub account 5. Open any project — Cody automatically indexes your codebase Also available for: JetBrains, Visual Studio, Neovim, Emacs. --- ## Intro Cody is Sourcegraph's AI code assistant that stands apart by understanding your **entire codebase**, not just the open file. Powered by Sourcegraph's code intelligence platform, it provides AI chat, inline completions, code edits, and deep search across all your repositories. Unlike generic AI assistants that only see the current file, Cody builds a semantic understanding of your codebase to give contextually accurate answers. Available for VS Code, JetBrains, Visual Studio, Neovim, and Emacs, with enterprise self-hosted deployment options. Works with: VS Code, JetBrains, Visual Studio, Neovim, Emacs, Claude, GPT-4, Gemini. Best for teams working on large codebases who need AI that understands cross-file dependencies. Setup time: under 3 minutes. --- ## Cody Features & Capabilities ### Full Codebase Context The key differentiator: Cody uses Sourcegraph's code graph to understand: - Cross-file dependencies and imports - Type definitions across the monorepo - Historical changes and patterns - Symbol references across repositories This means Cody's answers reference actual code in your project, not generic examples. ### AI Chat Ask questions about your codebase in natural language: - "How does the authentication flow work?" - "What functions call the `processPayment` method?" - "Explain the database migration strategy" - "Find all API endpoints that don't have rate limiting" Cody pulls relevant code from across your repos to answer accurately. ### Code Completions Context-aware inline completions that understand: - Your project's coding patterns and conventions - Type definitions and interfaces - Import graphs and module boundaries - Test patterns in your codebase ### Code Edits Select code and ask Cody to: - Refactor to a new pattern - Add error handling - Write tests for the selected function - Migrate from one API to another - Add TypeScript types ### Deep Search A dedicated search agent that: - Analyzes your query to understand intent - Searches across all connected repositories - Finds relevant files, functions, and patterns - Supports image analysis for UI-related queries ### Customizable Prompts Create reusable prompt templates for your team: ```json { "commands": { "review": { "prompt": "Review this code for security issues, performance problems, and adherence to our style guide.", "context": { "selection": true, "currentFile": true } } } } ``` ### Enterprise Features - **Self-hosted deployment** — Run entirely on your infrastructure - **SSO/SAML** — Enterprise authentication - **RBAC** — Repository-level access control - **Audit logs** — Track all AI interactions - **Custom models** — Bring your own LLM --- ## FAQ **Q: What is Sourcegraph Cody?** A: Cody is an AI code assistant by Sourcegraph that understands your entire codebase using code intelligence, providing contextually accurate chat, completions, edits, and deep search across all your repositories. **Q: Is Cody free?** A: Yes, Cody offers a generous free tier for individual developers. Enterprise plans with self-hosted deployment and advanced features are paid. The VS Code extension is free to install. **Q: How is Cody different from GitHub Copilot?** A: Cody's key advantage is full codebase context via Sourcegraph's code graph. Copilot primarily uses the current file and open tabs. Cody can answer questions about code across your entire organization's repositories. --- ## Source & Thanks > Created by [Sourcegraph](https://github.com/sourcegraph). Licensed under Apache-2.0. > > [Cody](https://sourcegraph.com/cody) — Available on VS Code, JetBrains, Visual Studio, Neovim, Emacs Thanks to Sourcegraph for building an AI assistant that truly understands codebases at scale. --- ## 快速使用 1. 打开 VS Code 扩展面板(Ctrl+Shift+X) 2. 搜索 "Cody" 并安装 **Cody AI by Sourcegraph** 3. 或使用命令行安装: ```bash code --install-extension sourcegraph.cody-ai ``` 4. 使用 Sourcegraph 或 GitHub 账号登录 5. 打开任意项目 — Cody 自动索引你的代码库 --- ## 简介 Cody 是 Sourcegraph 的 AI 代码助手,最大特点是能理解你的**整个代码库**,而不仅仅是当前打开的文件。基于 Sourcegraph 的代码智能平台,提供 AI 对话、内联补全、代码编辑和跨仓库深度搜索。与只看当前文件的通用 AI 助手不同,Cody 构建代码库的语义理解,给出上下文准确的回答。 适用于:VS Code、JetBrains、Visual Studio、Neovim、Emacs。适合在大型代码库中工作、需要 AI 理解跨文件依赖的团队。 --- ## 核心功能 ### 全代码库上下文 利用 Sourcegraph 代码图谱理解跨文件依赖、类型定义和历史变更模式。 ### AI 对话 用自然语言提问,Cody 从所有仓库中提取相关代码回答。 ### 代码补全 上下文感知的内联补全,理解项目的编码模式和类型系统。 ### 深度搜索 专用搜索代理,分析查询意图,跨仓库查找相关文件和函数。 ### 企业级特性 自托管部署、SSO、RBAC、审计日志和自定义模型支持。 --- ## 来源与感谢 > Created by [Sourcegraph](https://github.com/sourcegraph). Licensed under Apache-2.0. > > [Cody](https://sourcegraph.com/cody) — VS Code, JetBrains, Visual Studio, Neovim, Emacs --- Source: https://tokrepo.com/en/workflows/c00d464a-5aa1-44be-a473-e96b0a3cd992 Author: AI Open Source