Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(cli): support --version and -v flags on root command (#1007)

Jiayuan Zhangf0c0a64ddd8b
diff --git a/server/cmd/multica/main.go b/server/cmd/multica/main.go
index 0abe89f7cd..f733bc3e3c 100644
--- a/server/cmd/multica/main.go
+++ b/server/cmd/multica/main.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
+ "runtime"
"github.com/spf13/cobra"
)
@@ -22,6 +23,9 @@ var rootCmd = &cobra.Command{
}
func init() {
+ rootCmd.Version = fmt.Sprintf("%s (commit: %s, built: %s)\ngo: %s, os/arch: %s/%s", version, commit, date, runtime.Version(), runtime.GOOS, runtime.GOARCH)
+ rootCmd.SetVersionTemplate("multica {{.Version}}\n")
+
rootCmd.PersistentFlags().String("server-url", "", "Multica server URL (env: MULTICA_SERVER_URL)")
rootCmd.PersistentFlags().String("workspace-id", "", "Workspace ID (env: MULTICA_WORKSPACE_ID)")
rootCmd.PersistentFlags().String("profile", "", "Configuration profile name (e.g. dev) — isolates config, daemon state, and workspaces")