Zum Inhalt springen

OpenCode

Dieser Inhalt ist für v1.1.0. Geh zur neuesten Version, um die aktuellste Dokumentation zu bekommen.

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

OpenCode is an open-source AI coding agent that runs in the terminal and can be used alongside any editor or IDE.

  • LSP support that loads the right language tooling for the model
  • Multi-session workflows so you can run multiple agents on the same project
  • Shareable session links for collaboration and debugging
  • MCP support for external tools and data sources
  • Editor-agnostic workflow that works in any IDE
  1. Add the npm registry:

    Terminal window
    npm config set @aie:registry https://plugins.dev.aie.ai.t-systems.net/v1/npm
  2. Install OpenCode globally:

    Terminal window
    npm install -g @aie/opencode
  3. If you are on Windows and need a proxy, set the required environment variables before starting OpenCode.

  4. Get an API key from the portal:

  5. Run:

    Terminal window
    opencode auth login https://plugins.dev.aie.ai.t-systems.net

    This sets up OpenCode with the configuration published at https://plugins.dev.aie.ai.t-systems.net/.well-known/opencode, which we recommend for compliant usage with AI Foundation Services models.

  6. Run OpenCode:

    Terminal window
    opencode
  7. In OpenCode, run the following command to choose your provider and sign in with your API key:

    Terminal window
    /connect

    Select AI Foundation Services from the provider list, then provide your API key when prompted.

You can now start a chat and use OpenCode.

If you’d rather configure OpenCode declaratively (or pin a default model and base URL), create opencode.json at your project root or ~/.config/opencode/opencode.json for a global default:

{
"$schema": "https://opencode.ai/config.json",
"model": "openai/gpt-4.1", // Set your default model (format: provider_id/model_id)
"provider": {
"openai": {
"options": {
"baseURL": "https://llm-server.llmhub.t-systems.net/v2"
}
}
},
// Set permissions for built-in tools
"permission": {
"edit": "allow",
"websearch": "allow"
}
}

OpenCode automatically picks up OPENAI_API_KEY from your environment, so the config only needs the baseURL. If you set the variable during the Quickstart, no further key configuration is needed here.