Introduction
The Continue VS Code extension transforms your editor into an AI-powered coding companion by allowing you to define custom AI agents that assist with code generation, refactoring, documentation, and more. At the heart of this customization is the
config.yaml file — a simple yet powerful configuration file that lets you tailor the behavior, model, prompts, and tools of your AI agent.This guide walks you through creating a custom AI agent in VS Code using Continue’s
config.yaml, enabling you to build a developer assistant tuned to your team’s coding standards, frameworks, or workflows.Prerequisites
- Continue Extension installed from the VS Code Marketplace
- An API key for a supported LLM provider (e.g., OpenAI, Anthropic, Ollama, or local models)
Step 1: Locate or Create config.yaml
When you first open Continue in VS Code, it automatically creates a
.continue folder in your project root. Inside this folder, you’ll find a default config.yaml.💡 If the folder doesn’t exist, open VS Code, press Ctrl+Shift+P (or Cmd+Shift+P), type Continue: Open Config, and select it. This will generate the folder and file.
The default
config.yaml looks like this:yaml
Step 2: Secure Your API Key
Never hardcode API keys directly in
config.yaml. Instead, store them securely in a .env file and load them as environment variables.Create .env
Create a
.env file in the same path of config.yaml (add it to .gitignore!):json
Add this line to your .gitignore to prevent leaks:plain
Reload configuration
At top-right corner of Continue chat box, drop down
Local Config, select ReloadThen you could use your private ai agent in vscode!
Continue will automatically read
${{MY_AI_SECRET_KEY}} from your environment — no secrets are stored in version control.🔐 Security Note: Never commit secrets.json or .env files. Always use .gitignore to protect them.
Further Reading
inception/mercury-coder
inception/mercury-coder
Mercury Coder is the first diffusion large language model (dLLM). Applying a breakthrough discrete diffusion approach, the model runs 5-10x faster than even speed optimized models.
上一篇
How to Customize VSCode Theme Colors and Identify Color Keys
下一篇
使用不同顏色主題區分本地 VSCode 與 Remote SSH 視窗
- 作者:JK Yang
- 網址:https://jk1124.netlify.app/article/2b1d03e5-8529-80b6-96dd-dc5daeb90fc4
- 著作權聲明:本文使用 CC BY-NC-SA 4.0 著作權許可,使用請標注出處。

