mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-06 12:50:53 +08:00
Co-authored-by: jyc.dev <jycouet@gmail.com> Co-authored-by: Tee Ming <chewteeming01@gmail.com> Co-authored-by: Rich Harris <rich.harris@vercel.com>
55 lines
1.6 KiB
Markdown
55 lines
1.6 KiB
Markdown
---
|
|
title: OpenCode
|
|
---
|
|
|
|
OpenCode has a [plugin system](https://opencode.ai/docs/plugins/) that allows developers to add MCP servers, agents and commands programmatically. Svelte has an OpenCode plugin published under `@sveltejs/opencode`.
|
|
|
|
## Installation
|
|
|
|
To install the plugin you can edit your [OpenCode config](https://opencode.ai/docs/config/) (either the global or the local one), adding `@sveltejs/opencode` to the list of plugins.
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://opencode.ai/config.json",
|
|
"plugin": ["@sveltejs/opencode"]
|
|
}
|
|
```
|
|
|
|
That's it! You now have the Svelte [MCP server](mcp), [skills](skills), and the `svelte-file-editor` [subagent](subagent) configured for you.
|
|
|
|
## Configuration
|
|
|
|
By default, everything is enabled, but you can configure the plugin by adding a configuration file:
|
|
|
|
- locally, in `.opencode/svelte.json`
|
|
- globally, in `~/.config/opencode/svelte.json` (or, if you have specified the environment variable, in `$OPENCODE_CONFIG_DIR/svelte.json`)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://svelte.dev/opencode/schema.json",
|
|
"mcp": {
|
|
"type": "remote", // or "local" — defaults to remote
|
|
"enabled": true
|
|
},
|
|
"subagent": {
|
|
"enabled": true,
|
|
"agents": {
|
|
"svelte-file-editor": {
|
|
"model": "<other-model>", // defaults to the same as main agent
|
|
"temperature": 1, // defaults to unset
|
|
"top_p": 0.7, // defaults to unset
|
|
"maxSteps": 20 // defaults to unlimited
|
|
}
|
|
}
|
|
},
|
|
"skills": {
|
|
// this can be `true`, or an array of skills to enable
|
|
// e.g. ["svelte-core-bestpractices"]
|
|
"enabled": true
|
|
},
|
|
"instructions": {
|
|
"enabled": true
|
|
}
|
|
}
|
|
```
|