What is Sourcegraph Cody?
Cody is an AI code assistant that is designed to help developers write code and find answers to their coding questions. It utilizes Sourcegraph's code graph and Large Language Models (LLMs) to provide assistance. Cody has the ability to read through your entire codebase and other external resources like open-source code and StackOverflow questions to offer suggestions and answers based on prior knowledge.Some key features of Cody include:1. Chatbot that knows your code: Cody can write code and answer questions related to your project's codebase, following your coding standards and architecture better than other AI chatbots.2. Fixup code: Cody can interactively write and refactor code based on quick natural-language instructions provided by the developer.3. Recipes: Cody can generate unit tests, documentation, and more, considering the context of your entire codebase.4. Experimental completions: Cody can provide suggestions as you code.Cody can be used in various ways, such as through the Cody app, as an editor extension for VS Code and JetBrains, or by connecting it to a Sourcegraph enterprise instance. Developers can chat with Cody in the editor or the Sourcegraph sidebar to ask questions or provide fixup instructions. Cody will provide responses based on the code files it has read, and if it gives incorrect answers, feedback can be shared to help improve its accuracy.Overall, Cody aims to reduce toil and enhance developers' productivity by providing reliable code assistance and answering coding queries based on its extensive knowledge base.
Pros
- Chatbot knows your code
- Interactive code writing and refactoring
- Generates unit tests and documentation
- Assistive code suggestions
- App for code local on device
- VS Code and JetBrains extensions
- Integrated with Sourcegraph enterprise instance
- Chat interface in editor or sidebar
- Feedback for response improvement
- Generates code answering queries
- Follows your coding standards
- Uses your project's architecture
- Considers codebase context
- Translates natural-language instructions
- Improves variable names
- Translates code to different languages
- Summarizes recent code changes
- Detects code smells
- Generates release notes
- Enterprise and open source enabling
- Troubleshooting guide available
- Configurable code graph context
Cons
- Requires feedback for accuracy
- Limited editor extensions
- JetBrains extension is experimental
- Limited to Sourcegraph enterprise
- Requires full codebase access
- Dependency on open-source data
- Limited to pre-defined recipes
- Depends on existing coding conventions
- Context dependent fixup instructions
- Relies on Sourcegraph's code graph
Sourcegraph Cody FAQ
What is Sourcegraph Cody?
Sourcegraph Cody, referred to as Cody, is an AI code assistant designed to assist developers in their coding processes. It provides support in writing codes and answering coding queries by perusing the developers' code base and additional coding graph resources.
How does Cody utilize Sourcegraph's code graph and Large Language Models?
Cody utilizes Sourcegraph's code graph and Large Language Models (LLMs) to enhance its tasks of providing assistance for coding queries and suggesting modifications. The code graph informs it about the coding structure and interconnections, and the LLMs equip it with extensive linguistic understanding to analyze, understand, and communicate around coding contexts and terminologies.
What makes Cody different from other AI chatbots?
Cody differs from other AI chatbots as it has the capability to understand the codebase of your project. It understands and follows coding standards and architecture which sets it apart from other chatbots. Rather than operating based on generic programming principles, it takes a more personalized approach for each project.
How can Cody interactively write and refactor code?
Cody interacts with the code by understanding natural language instructions provided by the developer. It will then perform the required edits in response to the instructions. Examples of fixup responses include factoring out common helper functions, using imported CSS module's class names or extracting a list item to a separate React component.
Can Cody generate unit tests and documentation?
Yes, Cody can generate unit tests and documentation. This is done with full awareness of the entire codebase which enables contextually relevant and comprehensive outputs. Developers can select a particular code and ask Cody to generate unit tests or documentation based on the selected code.
What are experimental completions in Cody?
Experimental completions in Cody refers to the feature where Cody provides suggestions while the developer is still coding. This is possible due to Cody's ability to understand and interpret the code that is being written.
How can Cody be used in various ways?
Cody is highly versatile and can be used in several ways. It can be used via the Cody app, as an editor extension within VS Code and JetBrains, or by connecting it to a Sourcegraph enterprise instance. Developers can communicate with Cody directly within the editor or through the Sourcegraph sidebar.
What platforms can Cody be integrated with?
Cody can be integrated with various platforms including VS Code, JetBrains, and Sourcegraph.com. Developers can use the Cody app or connect it with an existing Sourcegraph enterprise instance.