mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-03 06:35:00 +08:00
feat(registry): remote-refresh Codex client model catalog (#4276)
Load codex_client_models.json like models.json with validation, revisioned handler reloads, CI bake, and Home-aware updater gates so list IDs still come from Home while templates can refresh on the edge.
This commit is contained in:
32
cmd/validate_codex_models/main.go
Normal file
32
cmd/validate_codex_models/main.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Command validate_codex_models validates a Codex client model catalog file.
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/router-for-me/CLIProxyAPI/v7/internal/registry"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var inputPath string
|
||||
flag.StringVar(&inputPath, "file", "", "Codex client model catalog JSON file")
|
||||
flag.Parse()
|
||||
|
||||
if strings.TrimSpace(inputPath) == "" {
|
||||
fmt.Fprintln(os.Stderr, "error: --file is required")
|
||||
os.Exit(2)
|
||||
}
|
||||
data, err := os.ReadFile(inputPath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: read %s: %v\n", inputPath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err = registry.ValidateCodexClientModelsJSON(data); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: invalid Codex client model catalog %s: %v\n", inputPath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("Validated Codex client model catalog: %s\n", inputPath)
|
||||
}
|
||||
Reference in New Issue
Block a user