BREAKING CONFIG CHANGE

We have changed the config format yet again - but this should be the
final time. You can see the readme for more details but the summary is

- got rid of global providers config
- got rid of global toml
- global config is now in `~/.config/opencode/config.json`
- it will be merged with any project level config
This commit is contained in:
Dax Raad
2025-06-18 22:59:42 -04:00
parent e5e9b3e3c0
commit bd8c3cd0f1
8 changed files with 273 additions and 123 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"path/filepath"
"sort"
"strings"
"log/slog"
@@ -61,8 +62,10 @@ func New(
}
configInfo := configResponse.JSON200
if configInfo.Keybinds == nil {
keybinds := make(map[string]string)
keybinds["leader"] = "ctrl+x"
leader := "ctrl+x"
keybinds := client.ConfigKeybinds{
Leader: &leader,
}
configInfo.Keybinds = &keybinds
}
@@ -76,6 +79,12 @@ func New(
if configInfo.Theme != nil {
appState.Theme = *configInfo.Theme
}
if configInfo.Model != nil {
splits := strings.Split(*configInfo.Model, "/")
appState.Provider = splits[0]
appState.Model = strings.Join(splits[1:], "/")
}
if appState.Theme != "" {
theme.SetTheme(appState.Theme)
}