Skip to content

Sourcegraph Cody Integration

Overview

Sourcegraph Cody is a sophisticated AI coding assistant that understands your entire codebase and development context. It provides intelligent code navigation, generation, and question answering capabilities.

Key Features

  • Repository-Wide Understanding: Comprehends entire codebases
  • Semantic Code Search: Find code by describing functionality
  • Context-Aware Generation: Creates code that fits your project
  • Automated Refactoring: Intelligent code restructuring
  • Documentation Generation: Creates thorough code documentation

Use Cases

  • Exploring and understanding large codebases
  • Generating code based on natural language descriptions
  • Answering technical questions about your code
  • Automated refactoring of legacy code
  • Creating and maintaining documentation

Note: Custom LLM integration available in Sourcegraph Enterprise.

Setup Instructions

  1. Open the extension settings in your IDE and install the Sourcegraph Cody extension.

    Sourcegraph Cody Extension

  2. Navigate to user settings JSON configuration and add the following.

  3. Add a custom LLM provider:

    {
    "cody.dev.models": [
    {
    "provider": "openai",
    "model": "<model name>",
    "inputTokens": 32000,
    "outputTokens": 4000,
    "apiKey": "relaxai_api_key",
    "options": {
    "temperature": 0.0
    },
    "apiEndpoint": "https://api.relax.ai/v1"
    }
    ]
    }
  4. Save settings and restart Cody to see the new model in action.

Using Cody

Sourcegraph Cody offers several powerful features:

  1. Ask Cody: Ask questions about your code
  2. Explain Code: Get detailed explanations of selected code
  3. Generate Code: Create code from natural language descriptions
  4. Command Palette: Access all features through commands
  5. Documentation: Generate documentation for functions and classes

Resources