OpenCode
OpenCode possède un système de plugins permettant aux
développeurs et développeuses d'ajouter des serveurs MCP, des agents et des commandes
programmatiquement. Svelte a un plugin OpenCode publié dans @sveltejs/opencode.
Installation
Avec OpenCode 1.3.4 ou plus récent, installez le plugin depuis la ligne de commande : With OpenCode 1.3.4 or newer, install the plugin from the command line:
opencode plugin @sveltejs/opencodeVous pouvez également modifier votre configuration OpenCode
(soit la configuration globale, soit la configuration locale), et ajoutez-y @sveltejs/opencode à
la liste des plugins :
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@sveltejs/opencode"]
}Et voilà ! Vous avez désormais le serveur MCP de Svelte, ses skills, et le sous-agent configuré pour vous.
TUI configuration
The package also includes a TUI plugin for configuring these features interactively. Add @sveltejs/opencode to your global or project-local tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["@sveltejs/opencode"]
}Restart OpenCode, then run /svelte-plugin or select 'Configure Svelte plugin' from the command palette. Choose whether to edit the project or global configuration, then use the checkboxes and radio options to configure the plugin. Changes are saved automatically, and 'Revert changes' restores the values from when the dialog was opened.
Configuration
Par défaut, le serveur MCP, les sous-agents, les skills, les instructions, et les mises à jour automatiques sont activées. Le plugin TUI écrit les mêmes fichiers de configuration que vous pouvez créer ou modifier manuellement :
- localement, dans
.opencode/svelte.json - globalement, dans
~/.config/opencode/svelte.json(ou, si vous avez précisé la variable d'environnement, dans$OPENCODE_CONFIG_DIR/svelte.json)
{
"$schema": "https://svelte.dev/opencode/schema.json",
"mcp": {
"type": "local", // or "remote"; defaults to local
"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
},
"autoupdate": true
}Automatic updates
The plugin checks npm for newer versions and warns you when one is available. OpenCode caches plugins, so it continues using the cached version until that cache is removed.
Automatic updates are enabled by default. After detecting a newer version, the plugin removes itself from the cache when OpenCode shuts down. OpenCode installs the latest version the next time it starts. Automatic updates only apply when the plugin is unpinned or explicitly uses the latest tag. Exact versions, ranges, and other dist-tags are left untouched because reinstalling them may resolve to the same version again. Set "autoupdate": false to only receive the warning.
Modifier cette page sur Github llms.txt