feat: implement unified version management (#20)

This commit is contained in:
BBQ
2026-02-01 00:36:52 -08:00
committed by GitHub
parent cb9ea261ac
commit 50e9d48cef
6 changed files with 66 additions and 22 deletions
+7
View File
@@ -16,6 +16,7 @@ import (
"github.com/memohai/memoh/internal/chat"
"github.com/memohai/memoh/internal/config"
"github.com/memohai/memoh/internal/version"
"github.com/memohai/memoh/internal/logger"
)
@@ -26,10 +27,15 @@ type cliOptions struct {
timeout time.Duration
apiBaseURL string
jwtToken string
showVersion bool
}
func main() {
opts := parseFlags()
if opts.showVersion {
fmt.Printf("Memoh CLI %s\n", version.GetInfo())
return
}
ctx := context.Background()
cfg, err := config.Load(opts.configPath)
@@ -97,6 +103,7 @@ func parseFlags() cliOptions {
flag.StringVar(&opts.jwtToken, "jwt", "", "JWT token (optional)")
flag.StringVar(&opts.apiBaseURL, "api-url", "", "API server base URL (e.g. http://127.0.0.1:8080)")
flag.DurationVar(&opts.timeout, "timeout", 30*time.Second, "Request timeout")
flag.BoolVar(&opts.showVersion, "version", false, "Show version information")
flag.Parse()
return opts