continue
continue copied to clipboard
Have a in project `config.json`
Validations
- [X] I believe this is a way to improve. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that requests the same enhancement
Problem
- If I customize the config (set custom template, custom commands, etc), Teammates need to do the same on their machine.
- Projects need different context based on their content. For example, a project might be in Typescript, another terraform. Some terraform projects are on GCP, other on AWS. Etc.. Would be nice to have answers based on a project custom context.
Solution
- Have a
.continuerc.js(or.continuerc.ts) or.continue.jsonlocated at the root of a project. Merge the config with~/.continue/config.jsonand prioritize the project config. .continuerc.jscould usemodule.exports = {}instead of exportingmodifyConfig. It would be more mainstream with other libraries of the community. Example of community project using module exportseslint(eslintrc.js)jest(jest.config.js)
- Support VSCode workspaces. Use the
.continuerc.jsin the workspace of the current opened file.
@samuelint It was a small experiment at first so I just haven't added to the docs, but you can use a file titled .continuerc.json in the root of your VS Code workspace, and it will be merged with your main config.json (code here). Currently it will look at the root of all workspace directories in VS Code.
Something similar for config.ts doesn't yet exist, but I like your suggestion and can definitely make it happen.
When you suggest module.exports, do you mean that it should return a partial version of the configuration object, and then any manipulation logic just lives above at the top level of the file?
By module.exports, I mean to have a single config file which contains content of config.json & config.ts.
Something like
module.exports = {
models: [
{
model: "gpt-4-1106-preview",
title: "GPT-4 Turbo",
promptTemplate: {
edit: () => {
return `My own context {{language}}{{code}}.....`
}
}
// etc...
}
],
};
or
module.exports = (config:Config) => ({ ...config, myCustomStuff})
In both cases, content override the one set in ~/.continue
Btw I would be honoured to contribute for this.
@samuelint sorry for taking 3 weeks to get back : / For the main config file we want to allow for something fully serializable so that we can write back to it, but we don't need to write back to .continuerc.json so it may actually make sense to do what you're describing in its place
One thing we would have to make sure to do is get types in the file. Possibly there's a way to do this through VS Code? We currently get types in config.ts by using a tsconfig.json and node_modules/@types, but I wouldn't want to deposit this in everybody's repo. If you were willing to look into this, it seems like a direction worth considering