Elffuss BraidHub

kikocis/continue public

627d7d0d1f85 · 4.0 KiBRawPermalink
1---
2title: "Configuration"
3description: Configuration
4keywords: [config, settings, customize]
5---
6
7You can easily access your assistant 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 Assistant selector above the main chat input. Then, you can hover over an assistant and click the `new window` (hub assistants) or `gear` (local assistants) icon.
8
9![configure an assistant](/images/configure-continue.png)
10
11## Hub Assistants
12
13Hub Assistants can be managed in [the Hub](https://hub.continue.dev). See [Editing an Assistant](../../hub/assistants/edit-an-assistant.md)
14
15## YAML Config
16
17Local user-level configuration is stored and can be edited in your home directory in `config.yaml`:
18
19- `~/.continue/config.yaml` (MacOS / Linux)
20- `%USERPROFILE%\.continue\config.yaml` (Windows)
21
22To open this `config.yaml`, you need to open the assistants dropdown in the top-right portion of the chat input. On that dropdown beside the "Local Assistant" option, select the cog icon. It will open the local `config.yaml`.
23
24![local-config-open-steps](/images/local-config-open-steps.png)
25
26When 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.
27
28See the full reference for `config.yaml` [here](/reference).
29
30## Deprecated configuration methods
31
32<Info>
33 View the `config.json` migration guide [here](../yaml-migration.mdx)
34</Info>
35
36- [`config.json`](/reference) - The original configuration format which is stored in a file at the same location as `config.yaml`
37- [`.continuerc.json`](#continuercjson) - Workspace-level configuration
38- [`config.ts`](#configts) - Advanced configuration (probably unnecessary) - a TypeScript file in your home directory that can be used to programmatically modify (_merged_) the `config.json` schema:
39 - `~/.continue/config.ts` (MacOS / Linux)
40 - `%USERPROFILE%\.continue\config.ts` (Windows)
41
42### `.continuerc.json`
43
44The 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`.
45
46Example
47
48```json title=".continuerc.json"
49{
50 "tabAutocompleteOptions": {
51 "disable": true
52 },
53 "mergeBehavior": "overwrite"
54}
55```
56
57### `config.ts`
58
59`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).
60
61`config.ts` must export a `modifyConfig` function, like:
62
63```ts title="config.ts"
64export function modifyConfig(config: Config): Config {
65 config.slashCommands?.push({
66 name: "commit",
67 description: "Write a commit message",
68 run: async function* (sdk) {
69 // The getDiff function takes a boolean parameter that indicates whether
70 // to include unstaged changes in the diff or not.
71 const diff = await sdk.ide.getDiff(false); // Pass false to exclude unstaged changes
72 for await (const message of sdk.llm.streamComplete(
73 `${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'):`,
74 new AbortController().signal,
75 {
76 maxTokens: 20,
77 },
78 )) {
79 yield message;
80 }
81 },
82 });
83 return config;
84}
85```