Files
codex-agent-manager/internal/app/config.go
2026-05-25 18:21:02 +08:00

32 lines
532 B
Go

package app
import (
"os"
"path/filepath"
)
type Config struct {
CodexHome string
HTTPAddr string
WorkspaceRoot string
}
func DefaultConfig() Config {
if codexHome := os.Getenv("CODEX_HOME"); codexHome != "" {
return Config{
CodexHome: codexHome,
HTTPAddr: "127.0.0.1:18083",
WorkspaceRoot: ".",
}
}
home, err := os.UserHomeDir()
if err != nil {
home = "."
}
return Config{
CodexHome: filepath.Join(home, ".codex"),
HTTPAddr: "127.0.0.1:18083",
WorkspaceRoot: ".",
}
}