# Cody — AI Coding Assistant by Sourcegraph > AI coding assistant with full codebase context. Cody searches your entire repo, reads relevant files, and answers questions or generates code with deep understanding. ## Install Save as a script file and run: ## Quick Use 1. Install the VS Code extension: Search "Cody" in Extensions 2. Sign in with Sourcegraph account (free tier available) 3. Start chatting about your codebase or use inline completions ## What is Cody? Cody is an AI coding assistant by Sourcegraph that has deep understanding of your entire codebase. Unlike simple autocomplete tools, Cody uses Sourcegraph's code intelligence to search across your whole repository, read relevant files, and provide answers grounded in your actual code — not generic patterns. **Answer-Ready**: Cody is Sourcegraph's AI coding assistant with full codebase context. It searches your entire repository using code intelligence, reads relevant files, and provides accurate answers and code generation grounded in your actual codebase. Works with Claude, GPT, and Gemini. **Best for**: Developers working on large codebases who need context-aware AI assistance. **Works with**: VS Code, JetBrains, Neovim, web. **Setup time**: Under 3 minutes. ## Core Features ### 1. Full Codebase Context Cody searches your entire repository to answer questions: ``` You: "How does authentication work in this project?" Cody: Searches repo → finds auth middleware, JWT config, user model → explains the full auth flow with file references ``` ### 2. Code Search Integration Powered by Sourcegraph's code intelligence: ``` You: "Where is the payment processing logic?" Cody: Found in 3 files: - src/services/payment.ts (main logic) - src/api/routes/checkout.ts (API endpoint) - src/workers/payment-processor.ts (async processing) ``` ### 3. Inline Completions Context-aware autocomplete as you type: ```typescript // Cody knows your project's patterns function createUser(data: CreateUserInput) { // Cody suggests based on your existing code patterns, // not generic boilerplate } ``` ### 4. Multi-Model Support | Model | Provider | |-------|----------| | Claude Sonnet/Opus | Anthropic | | GPT-4o | OpenAI | | Gemini 2.5 | Google | | Mixtral | Mistral | ### 5. Commands Built-in commands for common tasks: | Command | Action | |---------|--------| | `/explain` | Explain selected code | | `/edit` | Edit code with instructions | | `/test` | Generate unit tests | | `/doc` | Add documentation | | `/smell` | Find code smells | ### 6. Context Sources ``` Cody pulls context from: ├── Current file ├── Open files in editor ├── Repository-wide search ├── @-mentions (specific files/symbols) └── Sourcegraph code graph (enterprise) ``` ### 7. @-Mentions for Precise Context ``` You: @src/auth/middleware.ts explain the rate limiting logic You: @UserService how does user deletion cascade? ``` ## Cody Free vs Pro vs Enterprise | Feature | Free | Pro | Enterprise | |---------|------|-----|-----------| | Chat | Unlimited | Unlimited | Unlimited | | Autocomplete | 500/mo | Unlimited | Unlimited | | Models | Claude Sonnet | All models | All + custom | | Context | Local repo | Local repo | Multi-repo | ## FAQ **Q: How does Cody compare to GitHub Copilot?** A: Copilot focuses on inline completions. Cody adds full codebase search and chat with deep repo understanding. Cody also supports multiple LLM providers. **Q: Does my code leave my machine?** A: Chat queries are sent to LLM providers. Enterprise plan supports self-hosted deployment with no data leaving your network. **Q: Can it work with monorepos?** A: Yes, Sourcegraph's code intelligence is designed for large monorepos and multi-repo setups. ## Source & Thanks > Created by [Sourcegraph](https://github.com/sourcegraph). Licensed under Apache 2.0. > > [sourcegraph/cody](https://github.com/sourcegraph/cody) — 5k+ stars ## 快速使用 VS Code 扩展商店搜索 "Cody",安装后登录 Sourcegraph 账号即可使用。 ## 什么是 Cody? Cody 是 Sourcegraph 的 AI 编码助手,基于代码智能搜索整个代码库,提供基于实际代码的回答和生成。 **一句话总结**:Sourcegraph 的 AI 编码助手,搜索整个代码库,基于实际代码提供上下文感知的回答和代码生成。 **适合人群**:在大型代码库工作需要上下文感知 AI 的开发者。**支持**:VS Code、JetBrains、Neovim。 ## 核心功能 ### 1. 全代码库上下文 搜索整个仓库回答问题,引用具体文件。 ### 2. 代码搜索集成 Sourcegraph 代码智能驱动。 ### 3. 内联补全 基于项目模式的上下文感知自动补全。 ### 4. 多模型支持 Claude、GPT-4o、Gemini、Mixtral 可选。 ### 5. @提及 精确指定文件或符号作为上下文。 ## 常见问题 **Q: 和 GitHub Copilot 比较?** A: Copilot 专注补全,Cody 增加全库搜索和深度对话。 **Q: 支持大型仓库?** A: 支持,Sourcegraph 专为大型单体仓库和多仓库设计。 ## 来源与致谢 > [sourcegraph/cody](https://github.com/sourcegraph/cody) — 5k+ stars, Apache 2.0 --- Source: https://tokrepo.com/en/workflows/9fc7d409-3a97-4a10-9770-959a9dbce67b Author: Script Depot