opencode-provider-switch/cmd/ocswitch-desktop/main_fallback.go
apale7 5c4f60f2b7 feat(desktop): finish Windows GUI integration
Bring the Wails desktop shell to feature parity with the CLI for provider and alias management while keeping the browser fallback working. Wire tray, notifications, autostart, and GUI warnings so desktop flows behave predictably.
2026-04-19 01:02:16 +08:00

33 lines
798 B
Go

//go:build !desktop_wails
package main
import (
"flag"
"fmt"
"os"
"github.com/Apale7/opencode-provider-switch/internal/config"
"github.com/Apale7/opencode-provider-switch/internal/desktop"
)
var version = "dev"
func main() {
configPath := flag.String("config", "", fmt.Sprintf("path to %s config.json (default: %s)", config.AppName, config.DefaultPath()))
listenAddr := flag.String("listen", "127.0.0.1:0", "listen address for the local desktop control panel")
noOpen := flag.Bool("no-open", false, "do not open the control panel in the default browser")
flag.Parse()
err := desktop.Run(desktop.RunOptions{
ConfigPath: *configPath,
Version: version,
ListenAddr: *listenAddr,
OpenBrowser: !*noOpen,
})
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}