diff --git a/temporalcli/commands.go b/temporalcli/commands.go index c49efd2f..c5131420 100644 --- a/temporalcli/commands.go +++ b/temporalcli/commands.go @@ -349,7 +349,7 @@ func Execute(ctx context.Context, options CommandOptions) { } func (c *TemporalCommand) initCommand(cctx *CommandContext) { - c.Command.Version = fmt.Sprintf("%s (server %s) (ui %s)", Version, headers.ServerVersion, version.UIVersion) + c.Command.Version = VersionString() // Unfortunately color is a global option, so we can set in pre-run but we // must unset in post-run origNoColor := color.NoColor @@ -394,6 +394,10 @@ func (c *TemporalCommand) initCommand(cctx *CommandContext) { } } +func VersionString() string { + return fmt.Sprintf("%s (Server %s, UI %s)", Version, headers.ServerVersion, version.UIVersion) +} + func (c *TemporalCommand) preRun(cctx *CommandContext) error { // Configure logger if not already on context if cctx.Logger == nil { diff --git a/temporalcli/commands.server.go b/temporalcli/commands.server.go index a0b8550e..3bc4ac32 100644 --- a/temporalcli/commands.server.go +++ b/temporalcli/commands.server.go @@ -144,11 +144,12 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) return err } - cctx.Printer.Printlnf("%-16s %v:%v", "Temporal server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) + cctx.Printer.Printlnf("CLI %v\n", VersionString()) + cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) if !t.Headless { - cctx.Printer.Printlnf("%-16s http://%v:%v", "Web UI:", toFriendlyIp(opts.UIIP), opts.UIPort) + cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort) } - cctx.Printer.Printlnf("%-16s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort) + cctx.Printer.Printlnf("%-8s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort) <-cctx.Done() cctx.Printer.Println("Stopping server...") return nil