Use Clovis with OpenCode Desktop
OpenCode Desktop lets you use ClovisLLM as a coding assistant from a graphical application. Unlike the command-line version, everything happens in a standalone application, with no terminal.
Recent versions of OpenCode Desktop no longer include a graphical flow for adding a custom provider. Clovis is now declared in the opencode.json configuration file, shared with the CLI version. The procedure below covers installation, configuring the Clovis provider, and selecting ClovisLLM.
The configuration described here is identical to the one in the OpenCode CLI guide. Once opencode.json is in place, both interfaces can use ClovisLLM.
Prerequisites
- a dedicated Clovis API key for OpenCode Desktop;
- a computer running macOS, Windows x64/ARM64, or a Linux x64 distribution that uses DEB or RPM packages;
- a text editor to modify the configuration file;
- optional, but recommended: a local Git repository.
The API key provides access to the Clovis service. Never add it to a Git repository, a shared document, or a screenshot.
1. Download and install OpenCode Desktop
Open the official OpenCode download page, then choose the OpenCode Desktop package for your computer:
| System | Download |
|---|---|
| macOS | .dmg for Apple Silicon or Intel |
| Windows | .exe installer for x64 or ARM64 |
| Linux | .deb package for Debian/Ubuntu or .rpm package for Fedora/RHEL (x64) |
On macOS, you can also install the application with Homebrew:
brew install --cask opencode-desktop
Install the downloaded package, then launch OpenCode Desktop.
2. Locate or create the opencode.json file
OpenCode Desktop reads its configuration from the global opencode.json file (or opencode.jsonc if you prefer JSON comments):
| System | Location |
|---|---|
| macOS / Linux | ~/.config/opencode/opencode.json |
| Windows | $HOME\.config\opencode\opencode.json |
This file does not necessarily exist after installation: create it if needed, along with its parent folder. The full path on Windows looks like C:\Users\user\.config\opencode\opencode.json.
OpenCode Desktop and OpenCode CLI share the same configuration file and the same background server. A key registered from one can be used from the other.
3. Add Clovis as a provider
- OpenCode 2
- OpenCode 1
Open opencode.json in your text editor and copy the following configuration:
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"clovis": {
"name": "Clovis",
"env": ["CLOVIS_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://llm-gateway.clovis-ai.fr/v1"
},
"models": {
"ClovisLLM": {
"name": "ClovisLLM",
"limit": {
"context": 300000,
"output": 32000
}
}
}
}
},
"model": "clovis/ClovisLLM"
}
This configuration:
- declares a provider with the ID
clovis, compatible with the OpenAI API of the Clovis gateway; - declares the ClovisLLM model with its context and output limits;
- selects ClovisLLM as the default model through the
modelproperty.
Save the file, then restart OpenCode Desktop so the configuration is taken into account.
If you use OpenCode 1, copy this example into opencode.json.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"clovis": {
"name": "Clovis",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://llm-gateway.clovis-ai.fr/v1",
"apiKey": "{env:CLOVIS_API_KEY}"
},
"models": {
"ClovisLLM": {
"name": "ClovisLLM",
"limit": {
"context": 300000,
"output": 32000
}
}
}
}
},
"model": "clovis/ClovisLLM"
}
Set the CLOVIS_API_KEY environment variable before launching OpenCode. If you launch Desktop from the graphical interface, you can also save your key in ~/.clovis/api-key and replace the apiKey value in provider.clovis.options with "{file:~/.clovis/api-key}".
Save the file, then restart OpenCode Desktop after setting up the key.
4. Register your API key
In OpenCode 2, you can store the key from the application or read it from a file.
Method A: from the application (recommended)
- open a session in OpenCode Desktop;
- enter
/connectin the prompt area; - select Clovis in the provider list;
- choose the API key entry method, then paste your Clovis API key and confirm.
OpenCode stores the key separately from opencode.json. You can check it from a terminal with opencode auth list.
Method B: through a key file
An application launched from the graphical interface does not always inherit the terminal's environment variables. To avoid this issue, store the key in a file and reference it from the configuration:
- create a
~/.clovis/api-keyfile containing only your API key; - add the
"apiKey"line tosettings:
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"clovis": {
"name": "Clovis",
"env": ["CLOVIS_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://llm-gateway.clovis-ai.fr/v1",
"apiKey": "{file:~/.clovis/api-key}"
},
"models": {
"ClovisLLM": {
"name": "ClovisLLM",
"limit": {
"context": 300000,
"output": 32000
}
}
}
}
},
"model": "clovis/ClovisLLM"
}
OpenCode replaces {file:...} with the file contents at startup. If the file cannot be found, the value becomes an empty string: check the path if authentication fails.
The {env:CLOVIS_API_KEY} syntax works, but an application launched from the graphical interface does not necessarily inherit your terminal's environment variables. From OpenCode Desktop, prefer method A or method B.
5. Select ClovisLLM
The "model": "clovis/ClovisLLM" property from step 3 automatically selects ClovisLLM at startup.
To switch models temporarily, open the model selector from the prompt area and choose ClovisLLM in the Clovis section. The active model name appears below the prompt area.
6. Add a project and its Git context
To work on a local repository:
- open the project selector below the prompt area;
- add the root directory of your Git repository.
Adding the project gives OpenCode access to the repository files and lets it retrieve the Git context, including the active branch and project changes. The detected branch appears next to the project name.
Select the root of the Git repository rather than a subdirectory so that the assistant receives the full project context.
7. Test the connection
Send a first prompt, for example:
Explain the structure of this project and report the active Git branch.
OpenCode Desktop should answer with ClovisLLM while taking the selected project into account.
Troubleshooting
| Problem | Check |
|---|---|
| ClovisLLM does not appear | check the path and syntax of opencode.json, then restart OpenCode Desktop |
| Authentication fails | check the key in the Clovis administration console and make sure no spaces were copied before or after it |
The {file:...} key is not read | check that the ~/.clovis/api-key file exists and contains only the key; a missing file becomes an empty string |
| The environment variable is not visible | an application launched from the graphical interface does not inherit the terminal: use method A (/connect) or method B (key file) |
| The configuration file is not taken into account | check that the file is named opencode.json (or opencode.jsonc) in ~/.config/opencode/, without a .txt extension, then restart the application |
| The gateway connection fails | check the base URL https://llm-gateway.clovis-ai.fr/v1 and your network access to the Clovis service |
| The Git branch does not appear | add the root directory of a repository containing a .git directory |
| The download does not match your computer | return to the official download page and select the appropriate architecture or package format |
Go further
- OpenCode 1 configuration
- OpenCode documentation (in English);
- OpenCode configuration (in English);
- Custom providers (in English).