Welcome to the Continue Wiki
Relevant source files
The following files were used as context for generating this wiki page:
Continue is an open-source AI coding assistant designed to help developers ship faster. It integrates into your development environment to provide a suite of tools for building and running custom AI agents across your IDE, terminal, and CI pipelines. Continue can be used through extensions for VS Code and JetBrains, as well as a Command Line Interface (CLI).
The core philosophy is to provide a "Continuous AI" experience, where AI assists throughout the entire development lifecycle. This is achieved through several key features that allow you to chat with an AI, edit code with its help, receive autocompletions, and define custom, reusable AI agents tailored to your codebase.
Sources: README.md, extensions/vscode/README.md, extensions/intellij/README.md
Core Features
Continue offers a set of features that integrate directly into the developer's workflow.
| Feature | Description |
|---|---|
| Agent | Work on development tasks collaboratively with an AI. You can define custom agents to automate workflows. |
| Chat | Ask general programming questions, get explanations for code sections, and brainstorm ideas. |
| Edit | Modify a section of code without leaving the current file, using natural language instructions. |
| Autocomplete | Receive inline code suggestions as you type, powered by various LLMs. |
Sources: README.md
Architecture Overview
The Continue project is structured as a monorepo, containing shared logic and specific implementations for each supported platform.
The diagram below shows the high-level architecture of the Continue project.
core: Contains the shared business logic, including LLM integrations, configuration management, and core functionalities that are common across all extensions.gui: A React-based webview that provides the user interface for the VS Code and JetBrains extensions. It communicates with thecoremodule.extensions: Contains the platform-specific code for each integration:vscode: The VS Code extension.intellij: The JetBrains extension (for IDEs like IntelliJ IDEA, PyCharm, etc.).cli: The command-line interface for using Continue in the terminal.
Sources: CONTRIBUTING.md:126-130, extensions/intellij/CONTRIBUTING.md:29-31
CLI Architecture
The CLI is a standalone tool that provides an interactive AI-assisted development experience in the terminal.
The diagram below illustrates the main components of the CLI.
- Entry Point (
src/index.ts): Handles the main CLI logic and routing between different operational modes. - Authentication (
src/auth/): Manages WorkOS-based authentication. - Continue SDK Integration (
src/continueSDK.ts): Initializes and configures the connection to the Continue backend services. - Terminal UI (
src/ui/): Contains the React/Ink components for the interactive Terminal User Interface (TUI). - Tools System (
src/tools/): A collection of built-in functions the AI can use, such as file operations, code search, and command execution. - MCP Integration (
src/mcp.ts): Integrates with the Model Context Protocol for extended tool capabilities.
Sources: extensions/cli/AGENTS.md:15-43
Contributing to Continue
Contributions are welcome from all developers. The project has a defined process for reporting bugs, suggesting features, and contributing code.
Sources: CONTRIBUTING.md:18-20, CODE_OF_CONDUCT.md
Contribution Workflow
The general workflow for contributing code is as follows.
Sources: CONTRIBUTING.md:22-25, 61-125
Environment Setup
To start contributing, you need Node.js (version 20.19.0 or higher). After cloning your fork, you can install all dependencies by running a script.
- For Unix-based systems:
./scripts/install-dependencies.sh - For Windows:
.\scripts\install-dependencies.ps1
Once dependencies are installed, you can start the extension in debug mode from your IDE (VS Code or JetBrains).
Sources: CONTRIBUTING.md:65-74, extensions/intellij/CONTRIBUTING.md:46-54, scripts/install-dependencies.ps1
Git Workflow
The project uses a simple Git workflow based on a single permanent main branch.
- Pre-releases: A tag like
v1.3.x-vscodeonmaintriggers a pre-release build. - Main releases: A tag like
v1.2.x-vscodetriggers a main release build. - Hotfixes: Created from a feature branch based on the specific release tag.
This workflow is designed to be simple and is well-explained by releaseflow.org.
Sources: CONTRIBUTING.md:104-111
Adding New LLM Providers
Continue supports numerous LLM providers. You can add a new one by following these steps:
- Create a new file in
core/llm/llmsthat exports a class extendingBaseLLM. - Add the new provider to the
LLMsarray incore/llm/llms/index.ts. - If the provider supports images, add it to the
PROVIDER_SUPPORTS_IMAGESarray incore/llm/autodetect.ts. - Add a documentation page in
docs/customize/model-providers/more.
Sources: CONTRIBUTING.md:144-158
AI Agent Configuration
The behavior of the AI agent can be customized and guided through system messages and configuration files.
System Messages
Continue uses different system messages depending on the active mode to guide the LLM's behavior. These messages define the "rules of engagement" for the AI.
DEFAULT_CHAT_SYSTEM_MESSAGE: Instructs the AI to be helpful in a chat context, offering to apply changes via the UI.DEFAULT_AGENT_SYSTEM_MESSAGE: Used in "agent mode," where the AI is expected to use tools to accomplish tasks. It can call multiple read-only tools simultaneously.DEFAULT_PLAN_SYSTEM_MESSAGE: Used in "plan mode," where the AI's goal is to help the user construct a plan using only read-only tools.
All system messages include instructions for formatting code blocks with the language and file path.
Sources: core/llm/defaultSystemMessages.ts
CLI System Message Construction
The CLI dynamically constructs a system message to provide the AI with relevant context about the current environment.
This diagram shows how the final system message is assembled in the CLI.
This process involves gathering environment details, directory structure, git status, and user-defined rules from files like AGENTS.md or config.yaml to create a comprehensive prompt for the AI.
Sources: extensions/cli/src/systemMessage.ts:68-183
The AGENTS.md File
You can create an AGENTS.md file in the root of your repository to provide project-specific instructions to the AI agent. The CLI automatically detects and includes the content of this file in the system message. This allows you to guide the AI on architecture, development workflows, and important rules for your specific codebase.
The cn init command can be used to automatically generate a comprehensive AGENTS.md file by analyzing the repository.
Sources: extensions/cli/AGENTS.md, extensions/cli/src/systemMessage.ts:111-122, extensions/cli/src/commands/init.ts:6-33
GitHub Actions for PR Review
Continue provides a GitHub Action for automated code reviews on pull requests. This action uses the Continue CLI to analyze code changes and post a review comment.
Workflow
- Trigger: The action can be triggered on
pull_requestevents or by commenting@continue-reviewon a PR. - Authorization: It checks if the author or commenter has appropriate permissions (Owner, Member, Collaborator).
- Setup: It installs Node.js and the Continue CLI.
- Prompt Building: It constructs a detailed prompt for the AI, including the PR title, body, author, and the full
git diff. - Run Review: It executes the
cncommand with the generated prompt and a specified configuration. - Post Comment: It posts the AI-generated review as a comment on the pull request, updating an existing comment if one is present.
Sources: actions/general-review/action.yml