AI on demand: Configuring OpenCode Desktop

From MediaWiki
Revision as of 15:45, 3 November 2026 by Sst-pde (talk | contribs)
Jump to navigation Jump to search

Overview

OpenCode is an open-source AI coding agent, available as a desktop application, in the browser or via the terminal. It supports tool calls, MCP servers, skills, plugins, etc. for software development workflows. OpenCode can be configured to exclusively use AI models hosted by stepping stone AG via its OpenAI-compatible API.

Note: This guide walks through configuring the desktop variant of OpenCode. If you are looking for guidance on setting up the terminal version of OpenCode, see AI on Demand: Configure OpenCode Terminal

The following steps describe how to create a basic OpenCode setup using models provided by stepping stone AG, and some good first steps to control and extend the agents capabilities.

⚠️ Warning
Remember that agents such as OpenCode can autonomously perform actions on the system they run, such as reading / editing files, making web requests, executing terminal commands, etc. Agents may also interpret untrusted inputs such as skills or AGENTS.md files as instructions. Consider carefully which actions an agent should be allowed to execute, and whether a container or VM solution may be appropriate to prevent your agent from accessing sensitive information.

Prerequisites

Installation

Download and install the binary / package appropriate for your system.

Once complete, open the OpenCode desktop app to verify that the installation was successful

Configure provider and models

OpenCode desktop currently does not support adding custom model providers directly from its user interface. You will need to configure stepping stone AG as your provider by modifying your OpenCode configuration file to include the following:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "stepping-stone": {
      "name": "stepping stone AG",
      "package": "@opencode/ai/providers/openai-compatible",
      "env": ["STONEY_KEY"],
      "settings": {
        "baseURL": "https://llm.stoney-cloud.com/v1"
      },
      "models": {}
    }
  }
}

On Linux machines, the default location of your personal configuration file is ~/.config/opencode/opencode.jsonc or equivalent. See https://opencode.ai/v2/docs/config/#locations for more information on where to place the configuration file on your system.

Note: When configuring stepping stone AG as your provider as above, OpenCode expects to find your API key in an environment variable called STONEY_KEY. Alternatively you may add your key directly to the configuration file by removing the "env": ["STONEY_KEY"], line, and adding your key as follows:

...
      "settings": {
        "baseURL": "https://llm.stoney-cloud.com/v1",
        "apiKey": "YOUR API KEY GOES HERE",
      },
...
⚠️ Warning
Your API key must be kept secret by you! Be careful where you store your key to prevent it from being stolen or abused by a third party.

Next, you should configure at least one model you wish to use with OpenCode. The following is a configuration for the GLM-5.3-Flash model provided by stepping stone AG:

...
      "models": {
        "zai-org/GLM-5.3-Flash": {
          "name": "GLM 5.3 Flash",
          "limit": {
            "context": 262144,
          },
          "cost": {
            "input": 0.3,
            "output": 1.5,
            "cache": {
              "read": 0.045,
            },
          },
        },
      }

Replace zai-org/GLM-5.3-Flash with the ID of the particular model you wish to use, and refer to https://www.stepping-stone.ch/en/products/artificial-intelligence for pricing and context window limits. Additional model specific configuration can be added as needed. See https://opencode.ai/v2/docs/models/ for further information on configuring models.

To check if your configuration is correct, restart OpenCode after changing the configuration file. If the configuration is correct, stepping stone AG should appear as a configured provider, and your selected model in the available models list.

Finally, start a new session, select the model you have just configured and enter a first prompt to test that the model is working correctly.

Configure appearance and notifications

You may customise the appearance and layout of the UI, notification settings, shortcuts and more via the settings menu.

Permissions

OpenCode provides a built in sandbox to limit what actions an agent is allowed to perform. You can configure permissions via the configuration file (there is currently no option to configure permissions via the user interface). Permissions are defined as a list of rules. For each action (e.g. read/write a file, execute a shell command, etc.), you may define a set of rules, each with a pattern determining when the rule applies, and an effect to determine if the action is allowed, denied or requires explicit approval by the user. The following shows some examples of permission rules:

...
  "permissions": [
    { "action": "shell", "resource": "*", "effect": "ask" },
    { "action": "shell", "resource": "git status *", "effect": "allow" },
    { "action": "shell", "resource": "git push *", "effect": "deny" },
    { "action": "skill", "resource": "*", "effect": "allow" },
    { "action": "read", "resource": "*", "effect": "allow" },
    { "action": "edit", "resource": "*.html", "effect": "allow" },
  ]
...
⚠️ Warning
Try to keep the permissions you define as restrictive as feasable. In particular, do not allow your agent to perform sensitive or dangerous actions without your explicit approval.
⚠️ Warning
While OpenCode provides a sandbox controlled via permissions, you should never rely exclusively on the sandbox to ensure that your agent does not perform dangerous actions or accesses sensitive data. Always exercise good judgement when deciding what your agent should be allowed to do.

Further steps

You now have a basic OpenCode agent setup available to you. You may further customise and extend OpenCode in a variety of ways, such as by adding skills, configuring MCP servers or OpenCode plugins.

Check https://opencode.ai/v2/docs/ or the settings menu of OpenCode to see how you can extend your agent to your needs.

References