mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-08 05:40:56 +08:00
54 lines
1.8 KiB
Markdown
54 lines
1.8 KiB
Markdown
---
|
|
title: Overview
|
|
---
|
|
|
|
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 in OpenCode 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, [skills](skills), and the [file editor subagent](opencode-subagent) configured for you.
|
|
|
|
## Configuration
|
|
|
|
The default configuration for the Svelte OpenCode plugin looks like this...
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://svelte.dev/opencode/schema.json",
|
|
"mcp": {
|
|
"type": "remote",
|
|
"enabled": true
|
|
},
|
|
"subagent": {
|
|
"enabled": true,
|
|
"agents": {
|
|
"svelte-file-editor": {
|
|
"model": "other-model", // defaults to the same as main agent,
|
|
"temperature": 1, // default to unset
|
|
"top_p": 0.7, // default to unset,
|
|
"maxSteps": 20 // default to unlimited
|
|
}
|
|
}
|
|
},
|
|
"skills": {
|
|
"enabled": true // it can also be an array of all the skills to enable like ['svelte-core-bestpractices']
|
|
},
|
|
"instructions": {
|
|
"enabled": true
|
|
}
|
|
}
|
|
```
|
|
|
|
...but if you prefer, you can enable only the subagent, only the MCP, only the skills (`enabled` supports both a boolean or an array containing the name of all the skills to enable), or configure the kind of MCP server you want to use (`local` or `remote`).
|
|
|
|
You can place this file in `./.opencode/svelte.json` (in your project), in `~/.config/opencode/svelte.json` or, if you have an `OPENCODE_CONFIG_DIR` environment variable specified, at `$OPENCODE_CONFIG_DIR/svelte.json`.
|