OpenCode Tutorials
Startseite
Anleitungen
Ökosystem
FAQ
Vergleiche
Artikel
  • Offizielle Website
  • Offizieller Download
  • Offizielle Dokumentation
  • Über uns
  • Kontakt
  • Datenschutz
  • Nutzungsbedingungen
  • Haftungsausschluss
  • Markenhinweis
  • 简体中文
  • English
  • Deutsch
Startseite
Anleitungen
Ökosystem
FAQ
Vergleiche
Artikel
  • Offizielle Website
  • Offizieller Download
  • Offizielle Dokumentation
  • Über uns
  • Kontakt
  • Datenschutz
  • Nutzungsbedingungen
  • Haftungsausschluss
  • Markenhinweis
  • 简体中文
  • English
  • Deutsch
  • Anleitungen

    • Opencode Tutorial-Zentrum - Vom Anfänger zum Experten
    • Opencode Schnellstart - Installation und erstes Projekt
    • Opencode Fortgeschrittene Konfiguration - Benutzerdefinierte Modelle und Workflows
    • Opencode Häufige Tastenkombinationen Leitfaden - Entwicklungseffizienz steigern

Konfigurationsdatei-Details

Das Verständnis des Konfigurationssystems von Opencode ist der Schlüssel zur fortgeschrittenen Nutzung.

Konfigurationsdateispeicherorte

KonfigurationsdateiSpeicherortGeltungsbereich
Globale Konfiguration~/.config/opencode/opencode.jsonAlle Projekte
Projektkonfiguration./opencode.jsonAktuelles Projekt

Konfigurationsformat: JSONC

Opencode unterstützt JSONC-Format (JSON mit Kommentaren):

{
  "$schema": "https://opencode.ai/config.json",
  
  // Theme-Konfiguration
  "theme": "opencode-dark",
  
  /* Hauptmodell-Einstellungen */
  "model": "anthropic/claude-sonnet-4-5"
}

Konfigurationspriorität

Priorität (niedrig bis hoch):

  1. Remote-Organisationskonfiguration
  2. Globale Konfiguration
  3. Umgebungsvariablenkonfiguration
  4. Projektkonfiguration
  5. Projektverzeichniskonfiguration
  6. Laufzeitkonfiguration (höchste)

Kernkonfigurationsoptionen

1. Modellkonfiguration

{
  "model": "anthropic/claude-sonnet-4-5",
  "small_model": "anthropic/claude-haiku-4-5",
  "enabled_providers": ["anthropic", "openai"]
}

2. Berechtigungskonfiguration

{
  "permission": {
    "read": {
      "*": "allow",
      "*.env": "deny"
    },
    "edit": "ask",
    "bash": {
      "*": "ask",
      "git status": "allow",
      "rm -rf": "deny"
    }
  }
}

Berechtigungswerte:

  • "allow" - Direkt zulassen
  • "ask" - Jedes Mal fragen
  • "deny" - Direkt ablehnen

3. Agent-Konfiguration

{
  "agent": {
    "code-reviewer": {
      "description": "Code-Review-Experte",
      "model": "anthropic/claude-sonnet-4-5",
      "tools": {
        "write": false,
        "edit": false
      }
    }
  }
}

Praktische Konfigurationsvorlagen

Minimale Konfiguration

{
  "model": "anthropic/claude-sonnet-4-5",
  "permission": {
    "edit": "ask",
    "bash": "ask"
  }
}

Nächste Schritte

  • Agent-Konfiguration
  • Berechtigungen und Sicherheit

Zusammengestellt von der OpenCodex-Community.

Zuletzt aktualisiert: 28.02.26, 14:48