Elffuss BraidHub

kikocis/continue public

main · 4.4 KiBRawPermalink
1---
2title: "How to Configure Continue Agents"
3description: Learn how to access and manage Continue agent configurations through Hub or local YAML files
4keywords: [config, settings, customize]
5sidebarTitle: "Agent Configuration"
6---
7
8You can easily access your agent configuration from the Continue Chat sidebar. Open the sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) and click the Agent selector above the main chat input. Then, you can hover over an agent and click the `new window` (hub agents) or `gear` (local agents) icon.
9
10![configure an agent](/images/configure-continue.png)
11
12## How to Manage Hub Agents
13
14Hub Agents can be managed in [the Hub](https://hub.continue.dev). See [Editing an Agent](../../hub/agents/edit-an-agent.md)
15
16## How to Configure Local Agents with YAML
17
18Local user-level configuration is stored and can be edited in your home directory in `config.yaml`:
19
20- `~/.continue/config.yaml` (MacOS / Linux)
21- `%USERPROFILE%\.continue\config.yaml` (Windows)
22
23To open this `config.yaml`, you need to open the agents dropdown in the top-right portion of the chat input. On that dropdown beside the "Local Agent" option, select the cog icon. It will open the local `config.yaml`.
24
25![local-config-open-steps](/images/local-config-open-steps.png)
26
27When editing this file, you can see the available options suggested as you type, or check the reference below. When you save a config file from the IDE, Continue will automatically refresh to take into account your changes. A config file is automatically created the first time you use Continue, and always automatically generated with default values if it doesn't exist.
28
29See the full reference for `config.yaml` [here](/reference).
30
31## Legacy Configuration Methods (Deprecated)
32
33<Info>
34 View the `config.json` migration guide [here](/reference/yaml-migration)
35</Info>
36
37- [`config.json`](/reference) - The original configuration format which is stored in a file at the same location as `config.yaml`
38- [`.continuerc.json`](#how-to-use-continuercjson-for-workspace-configuration) - Workspace-level configuration
39- [`config.ts`](#how-to-use-configts-for-advanced-configuration) - Advanced configuration (probably unnecessary) - a TypeScript file in your home directory that can be used to programmatically modify (_merged_) the `config.json` schema:
40 - `~/.continue/config.ts` (MacOS / Linux)
41 - `%USERPROFILE%\.continue\config.ts` (Windows)
42
43### How to Use `.continuerc.json` for Workspace Configuration
44
45The format of `.continuerc.json` is the same as `config.json`, plus one _additional_ property `mergeBehavior`, which can be set to either "merge" or "overwrite". If set to "merge" (the default), `.continuerc.json` will be applied on top of `config.json` (arrays and objects are merged). If set to "overwrite", then every top-level property of `.continuerc.json` will overwrite that property from `config.json`.
46
47Example
48
49```json title=".continuerc.json"
50{
51 "tabAutocompleteOptions": {
52 "disable": true
53 },
54 "mergeBehavior": "overwrite"
55}
56```
57
58### How to Use `config.ts` for Advanced Configuration
59
60`config.yaml` or `config.json` can handle the vast majority of necessary configuration, so we recommend using it whenever possible. However, if you need to programmatically extend Continue configuration, you can use a `config.ts` file, placed at `~/.continue/config.ts` (MacOS / Linux) or `%USERPROFILE%\.continue\config.ts` (Windows).
61
62`config.ts` must export a `modifyConfig` function, like:
63
64<Warning>
65 The `slashCommands` array shown below is deprecated. For creating custom slash
66 commands, use [prompt files](./prompts) instead.
67</Warning>
68
69```ts title="config.ts"
70export function modifyConfig(config: Config): Config {
71 config.slashCommands?.push({
72 name: "commit",
73 description: "Write a commit message",
74 run: async function* (sdk) {
75 // The getDiff function takes a boolean parameter that indicates whether
76 // to include unstaged changes in the diff or not.
77 const diff = await sdk.ide.getDiff(false); // Pass false to exclude unstaged changes
78 for await (const message of sdk.llm.streamComplete(
79 `${diff}\n\nWrite a commit message for the above changes. Use no more than 20 tokens to give a brief description in the imperative mood (e.g. 'Add feature' not 'Added feature'):`,
80 new AbortController().signal,
81 {
82 maxTokens: 20,
83 },
84 )) {
85 yield message;
86 }
87 },
88 });
89 return config;
90}
91```