Changesets · Branches · Tags · Compare
| Changeset | 1277cc89cc42ea1f5e972535f01ca713ae9c28c2efa0c6b632265b94ecdb0105 |
|---|---|
| Author | Patrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-09-18 19:48 -07:00 |
| Committer | Patrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-09-18 19:48 -07:00 |
| Parents | 2b37ea847073 |
2 files changed
added docs/guides/understanding-blocks.mdx +157 −0
| @@ -0,0 +1,157 @@ | ||
| 1 | +--- | |
| 2 | +title: "Understanding Blocks" | |
| 3 | +description: "Learn how to work with Continue's composable block system. Understand how to use hub blocks, create local blocks, and organize your configurations for maximum reusability." | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# Understanding Blocks | |
| 7 | + | |
| 8 | +Continue uses composable **blocks** - reusable building components like models, context providers, rules, and documentation sources. Think of blocks as LEGO pieces that you can mix and match to create powerful coding agents tailored to your needs. | |
| 9 | + | |
| 10 | +## What Are Blocks? | |
| 11 | + | |
| 12 | +**Blocks** are individual building components that agents use. Each block handles one specific function - for example, one language model, one documentation source, or one set of rules. Agents combine multiple blocks to create complete coding assistants. | |
| 13 | + | |
| 14 | +## Where Agents Live | |
| 15 | + | |
| 16 | +Agents can be loaded from two places: | |
| 17 | + | |
| 18 | +**[Continue Hub](https://hub.continue.dev/explore/agents)** | |
| 19 | +Community-shared agents stored on the hub and automatically synced to your extension. | |
| 20 | + | |
| 21 | +**Local Storage** | |
| 22 | +Your custom agents stored in: | |
| 23 | +- **Global**: `~/.continue/agents` (Mac) or `%USERPROFILE%\.continue/agents` (Windows) | |
| 24 | +- **Workspace**: `/.continue/agents` folder in your project | |
| 25 | + | |
| 26 | +The filename becomes the display name (e.g., `My Custom Agent.yaml`). | |
| 27 | + | |
| 28 | +## Working with Hub Blocks | |
| 29 | + | |
| 30 | +Hub blocks are identified by slugs in the format `owner/block-name`. For example, to use the [OpenAI GPT-4o block](https://hub.continue.dev/openai/gpt-4o), you'd reference it as `openai/gpt-4o`. | |
| 31 | + | |
| 32 | +Import hub blocks using the `uses` syntax alongside your custom blocks: | |
| 33 | + | |
| 34 | +```yaml | |
| 35 | +name: Team Agent | |
| 36 | +version: 1.0.0 | |
| 37 | +schema: v1 | |
| 38 | + | |
| 39 | +models: | |
| 40 | + - uses: anthropic/claude-3.5-sonnet # Import from hub | |
| 41 | + - model: deepseek-reasoner # Define custom block | |
| 42 | + provider: ollama | |
| 43 | +``` | |
| 44 | + | |
| 45 | +## Creating Local Blocks | |
| 46 | + | |
| 47 | +Local blocks let you create reusable components that automatically apply to multiple agents, reducing duplication and ensuring consistency across your setup. | |
| 48 | + | |
| 49 | +**Workspace Blocks** | |
| 50 | +Applied automatically to all agents when working in a specific project. Perfect for project-specific configurations like TypeScript rules for web apps or Python linting standards for data science projects. | |
| 51 | + | |
| 52 | +**Global Blocks** | |
| 53 | +Applied to all agents across all workspaces. Ideal for personal preferences, universal coding standards, or tools you use everywhere. | |
| 54 | + | |
| 55 | +## Block Types & Organization | |
| 56 | + | |
| 57 | +Organize your local blocks using these directories: | |
| 58 | + | |
| 59 | +<Columns cols={2}> | |
| 60 | +<Card title="Agents" icon="robot"> | |
| 61 | +`.continue/agents` - Complete agent configurations | |
| 62 | +</Card> | |
| 63 | + | |
| 64 | +<Card title="Rules" icon="shield"> | |
| 65 | +`.continue/rules` - Coding standards and guidelines | |
| 66 | +</Card> | |
| 67 | + | |
| 68 | +<Card title="Models" icon="brain"> | |
| 69 | +`.continue/models` - Language model configurations | |
| 70 | +</Card> | |
| 71 | + | |
| 72 | +<Card title="Prompts" icon="message-square"> | |
| 73 | +`.continue/prompts` - Custom prompt templates | |
| 74 | +</Card> | |
| 75 | + | |
| 76 | +<Card title="Context" icon="layers"> | |
| 77 | +`.continue/context` - Context provider configurations | |
| 78 | +</Card> | |
| 79 | + | |
| 80 | +<Card title="Documentation" icon="book"> | |
| 81 | +`.continue/docs` - Documentation site integrations | |
| 82 | +</Card> | |
| 83 | + | |
| 84 | +<Card title="Data" icon="database"> | |
| 85 | +`.continue/data` - Development data destinations | |
| 86 | +</Card> | |
| 87 | + | |
| 88 | +<Card title="MCP Servers" icon="server"> | |
| 89 | +`.continue/mcpServers` - Model Context Protocol servers | |
| 90 | +</Card> | |
| 91 | +</Columns> | |
| 92 | + | |
| 93 | +## Working with Secrets | |
| 94 | + | |
| 95 | +Local blocks can use mustache notation for secrets (`${{ secrets.SECRET_NAME }}`) which read from: | |
| 96 | +- **Global**: `.env` file in `~/.continue/.env` | |
| 97 | +- **Workspace**: `.env` file at your project root | |
| 98 | + | |
| 99 | +## Block Inputs and Customization | |
| 100 | + | |
| 101 | +Blocks can accept user inputs for customization. Create parameterized blocks using mustache templating: | |
| 102 | + | |
| 103 | +```yaml title="config.yaml" | |
| 104 | +name: myprofile/custom-model | |
| 105 | +version: 1.0.0 | |
| 106 | +schema: v1 | |
| 107 | + | |
| 108 | +models: | |
| 109 | + - name: My Favorite Model | |
| 110 | + provider: anthropic | |
| 111 | + apiKey: ${{ inputs.ANTHROPIC_API_KEY }} | |
| 112 | + defaultCompletionOptions: | |
| 113 | + temperature: ${{ inputs.TEMP }} | |
| 114 | +``` | |
| 115 | + | |
| 116 | +Then import with custom values: | |
| 117 | + | |
| 118 | +```yaml title="config.yaml" | |
| 119 | +name: myprofile/custom-agent | |
| 120 | +version: 1.0.0 | |
| 121 | +schema: v1 | |
| 122 | + | |
| 123 | +models: | |
| 124 | + - uses: myprofile/custom-model | |
| 125 | + with: | |
| 126 | + ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} | |
| 127 | + TEMP: 0.9 | |
| 128 | +``` | |
| 129 | + | |
| 130 | +Note that hub secrets can be passed as inputs using the mustache format: `${{ secrets.SECRET_NAME }}`. | |
| 131 | + | |
| 132 | +## Overriding Block Properties | |
| 133 | + | |
| 134 | +You can directly override block properties using the `override` syntax: | |
| 135 | + | |
| 136 | +```yaml title="config.yaml" | |
| 137 | +name: myprofile/custom-agent | |
| 138 | +version: 1.0.0 | |
| 139 | +schema: v1 | |
| 140 | + | |
| 141 | +models: | |
| 142 | + - uses: myprofile/custom-model | |
| 143 | + with: | |
| 144 | + ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} | |
| 145 | + TEMP: 0.9 | |
| 146 | + override: | |
| 147 | + roles: | |
| 148 | + - chat | |
| 149 | +``` | |
| 150 | + | |
| 151 | +## Next Steps | |
| 152 | + | |
| 153 | +Now that you understand how blocks and agents work, explore: | |
| 154 | +- **[Config Reference](/reference)**: Detailed documentation of all available properties | |
| 155 | +- **[Continue Hub](https://hub.continue.dev)**: Browse community blocks and agents | |
| 156 | +- **[Custom Context Providers](/customize/deep-dives/custom-providers)**: Create advanced context integrations | |
| 157 | +- **[Model Roles](/customize/model-roles/overview)**: Understanding how different models work together | |
| No newline at the end of the file |
modified docs/reference.mdx +16 −123
| @@ -5,132 +5,19 @@ | ||
| 5 | 5 | |
| 6 | 6 | ## Introduction |
| 7 | 7 | |
| 8 | -Continue hub agents are defined using the `config.yaml` specification. Agents can be loaded from [the Hub](https://hub.continue.dev/explore/agents) or locally | |
| 8 | +Continue Agents are defined using the `config.yaml` specification. | |
| 9 | 9 | |
| 10 | -- [Continue Hub](https://hub.continue.dev/explore/agents) - YAML is stored on the hub and automatically synced to the extension | |
| 10 | +**Agents** are composed of reusable **Blocks**, such as models, rules, and MCP servers. | |
| 11 | 11 | |
| 12 | -- Locally | |
| 13 | - - in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) within `.continue/agents`. The name of the file will be used as the display name of the agent, e.g. `My Agent.yaml` | |
| 14 | - - in your workspace in a `/.continue/agents` folder, with the same naming convention | |
| 12 | +<Columns cols={2}> | |
| 13 | +<Card title="Understanding Blocks" icon="cube" href="/guides/understanding-blocks"> | |
| 14 | +Learn how to work with Continue's block system, including using hub blocks, creating local blocks, and organizing your configurations. | |
| 15 | +</Card> | |
| 15 | 16 | |
| 16 | -<Info> | |
| 17 | - Config YAML replaces `config.json`, which is deprecated. View the **[Migration | |
| 18 | - Guide](/reference/yaml-migration)**. | |
| 19 | -</Info> | |
| 20 | - | |
| 21 | -An agent is made up of: | |
| 22 | - | |
| 23 | -1. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the agent | |
| 24 | -2. **Block lists**, which are composable arrays of coding agent building blocks available to the agent, such as models, docs, and context providers. | |
| 25 | - | |
| 26 | -A block is a single standalone building block of a coding agents, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as agents (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is. | |
| 27 | - | |
| 28 | -Examples of blocks and agents can be found on the [Continue Hub](https://hub.continue.dev). | |
| 29 | - | |
| 30 | -Agents can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks. | |
| 31 | - | |
| 32 | -### Using Blocks | |
| 33 | - | |
| 34 | -Hub blocks and agents are identified with a slug in the format `owner-slug/block-or-agent-slug`, where an owner can be a user or organization (For example, if you want to use the [OpenAI 4o Model block](https://hub.continue.dev/openai/gpt-4o), your slug would be `openai/gpt-4o`). These blocks are pulled from [https://hub.continue.dev](https://hub.continue.dev). | |
| 35 | - | |
| 36 | -Blocks can be imported into an agent by adding a `uses` clause under the block type. This can be alongside other `uses` clauses or explicit blocks of that type. | |
| 37 | - | |
| 38 | -For example, the following agent imports an Anthropic model and defines an Ollama DeepSeek one. | |
| 39 | - | |
| 40 | -Agent models section | |
| 41 | - | |
| 42 | -```yaml | |
| 43 | -name: Team Agent | |
| 44 | -version: 1.0.0 | |
| 45 | -schema: v1 | |
| 46 | - | |
| 47 | -models: | |
| 48 | - - uses: anthropic/claude-3.5-sonnet # an imported model block | |
| 49 | - - model: deepseek-reasoner # an explicit model block | |
| 50 | - provider: ollama | |
| 51 | -``` | |
| 52 | - | |
| 53 | -### Local Blocks | |
| 54 | - | |
| 55 | -It is also possible to define blocks locally in a `.continue` folder. This folder can be located at either the root of your workspace (these will automatically be applied to all agents when you are in that workspace) or in your home directory at `~/.continue` (these will automatically be applied globally). | |
| 56 | - | |
| 57 | -Place your YAML files in the following folders: | |
| 58 | - | |
| 59 | -Agents: | |
| 60 | - | |
| 61 | -- `.continue/agents` - for agents | |
| 62 | - | |
| 63 | -Blocks: | |
| 64 | - | |
| 65 | -- `.continue/rules` - for rules | |
| 66 | -- `.continue/models` - for models | |
| 67 | -- `.continue/prompts` - for prompts | |
| 68 | -- `.continue/context` - for context providers | |
| 69 | -- `.continue/docs` - for docs | |
| 70 | -- `.continue/data` - for data | |
| 71 | -- `.continue/mcpServers` - for MCP Servers | |
| 72 | - | |
| 73 | -You can find many examples of each of these block types on the [Continue Explore Page](https://hub.continue.dev/explore/models) | |
| 74 | - | |
| 75 | -<Info> | |
| 76 | -Local blocks utilizing mustache notation for secrets (`${{ secrets.SECRET_NAME }}`) can read secret values: | |
| 77 | - | |
| 78 | -- globally, from a `.env` located in the global `.continue` folder (`~/.continue/.env`) | |
| 79 | -- per-workspace, from a `.env` file located at the root of the current workspace. | |
| 80 | - | |
| 81 | -</Info> | |
| 82 | - | |
| 83 | -### Inputs | |
| 84 | - | |
| 85 | -Blocks can be passed user inputs, including hub secrets and raw text values. To create a block that has an input, use mustache templating as follows: | |
| 86 | - | |
| 87 | -```yaml title="config.yaml" | |
| 88 | -name: myprofile/custom-model | |
| 89 | -version: 1.0.0 | |
| 90 | -schema: v1 | |
| 91 | - | |
| 92 | -models: | |
| 93 | - - name: My Favorite Model | |
| 94 | - provider: anthropic | |
| 95 | - apiKey: ${{ inputs.ANTHROPIC_API_KEY }} | |
| 96 | - defaultCompletionOptions: | |
| 97 | - temperature: ${{ inputs.TEMP }} | |
| 98 | -``` | |
| 99 | - | |
| 100 | -Which can then be imported like this: | |
| 101 | - | |
| 102 | -```yaml title="config.yaml" | |
| 103 | -name: myprofile/custom-agent | |
| 104 | -version: 1.0.0 | |
| 105 | -schema: v1 | |
| 106 | - | |
| 107 | -models: | |
| 108 | - - uses: myprofile/custom-model | |
| 109 | - with: | |
| 110 | - ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} | |
| 111 | - TEMP: 0.9 | |
| 112 | -``` | |
| 113 | - | |
| 114 | -Note that hub secrets can be passed as inputs, using a similar mustache format: `secrets.SECRET_NAME`. | |
| 115 | - | |
| 116 | -### Overrides | |
| 117 | - | |
| 118 | -Block properties can be also be directly overriden using `override`. For example: | |
| 119 | - | |
| 120 | -```yaml title="config.yaml" | |
| 121 | -name: myprofile/custom-agent | |
| 122 | -version: 1.0.0 | |
| 123 | -schema: v1 | |
| 124 | - | |
| 125 | -models: | |
| 126 | - - uses: myprofile/custom-model | |
| 127 | - with: | |
| 128 | - ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} | |
| 129 | - TEMP: 0.9 | |
| 130 | - override: | |
| 131 | - roles: | |
| 132 | - - chat | |
| 133 | -``` | |
| 17 | +<Card title="Understanding Agents" icon="robot" href="/guides/understanding-agents"> | |
| 18 | +Learn how to build and configure agents, understand their capabilities, and customize them for your development workflow. | |
| 19 | +</Card> | |
| 20 | +</Columns> | |
| 134 | 21 | |
| 135 | 22 | ## Properties |
| 136 | 23 | |
| @@ -566,3 +453,9 @@ | ||
| 566 | 453 | maxPromptTokens: 1024 |
| 567 | 454 | onlyMyCode: true |
| 568 | 455 | ``` |
| 456 | + | |
| 457 | +--- | |
| 458 | + | |
| 459 | +## `config.json` Deprecation | |
| 460 | + | |
| 461 | +`config.yaml `replaces `config.json`, which is deprecated. View the **[Migration Guide](/reference/yaml-migration)** for help transitioning from the old format. |