Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/temporalio/cli

go 1.24.4
go 1.25.0

require (
github.com/BurntSushi/toml v1.4.0
Expand All @@ -16,18 +16,18 @@ require (
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
github.com/temporalio/ui-server/v2 v2.39.0
go.temporal.io/api v1.50.0
go.temporal.io/sdk v1.35.0
go.temporal.io/api v1.53.0
go.temporal.io/sdk v1.36.0
go.temporal.io/sdk/contrib/envconfig v0.1.0
go.temporal.io/server v1.28.0
google.golang.org/grpc v1.71.0
go.temporal.io/server v1.29.0
google.golang.org/grpc v1.72.2
google.golang.org/protobuf v1.36.6
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.34.1
)

require (
cel.dev/expr v0.22.1 // indirect
cel.dev/expr v0.23.1 // indirect
cloud.google.com/go v0.120.0 // indirect
cloud.google.com/go/auth v0.15.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
Expand Down Expand Up @@ -76,7 +76,7 @@ require (
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
Expand Down Expand Up @@ -121,6 +121,7 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sony/gobreaker v1.0.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/temporalio/ringpop-go v0.0.0-20250130211428-b97329e994f7 // indirect
github.com/temporalio/sqlparser v0.0.0-20231115171017-f4060bcfa6cb // indirect
Expand All @@ -130,6 +131,7 @@ require (
github.com/uber-go/tally/v4 v4.1.17 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/zeebo/errs v1.4.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
Expand All @@ -144,7 +146,6 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.temporal.io/version v0.3.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/dig v1.18.1 // indirect
go.uber.org/fx v1.23.0 // indirect
Expand Down
88 changes: 24 additions & 64 deletions go.sum

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions temporalcli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ func (c *ClientOptions) dialClient(cctx *CommandContext) (client.Client, error)
return nil, fmt.Errorf("root command unexpectedly missing when dialing client")
}

if c.Identity == "" {
hostname, err := os.Hostname()
if err != nil {
hostname = "unknown-host"
}
username := "unknown-user"
if u, err := user.Current(); err == nil {
username = u.Username
}
c.Identity = "temporal-cli:" + username + "@" + hostname
}

// Load a client config profile
var clientProfile envconfig.ClientConfigProfile
if !cctx.RootCommand.DisableConfigFile || !cctx.RootCommand.DisableConfigEnv {
Expand Down Expand Up @@ -178,7 +190,6 @@ func (c *ClientOptions) dialClient(cctx *CommandContext) (client.Client, error)
}

clientOptions.Logger = log.NewStructuredLogger(cctx.Logger)
clientOptions.Identity = clientIdentity()
// We do not put codec on data converter here, it is applied via
// interceptor. Same for failure conversion.
// XXX: If this is altered to be more dynamic, have to also update
Expand Down Expand Up @@ -270,18 +281,6 @@ func payloadCodecInterceptor(
)
}

func clientIdentity() string {
hostname, err := os.Hostname()
if err != nil {
hostname = "unknown-host"
}
username := "unknown-user"
if u, err := user.Current(); err == nil {
username = u.Username
}
return "temporal-cli:" + username + "@" + hostname
}

var DataConverterWithRawValue = converter.NewCompositeDataConverter(
rawValuePayloadConverter{},
converter.NewNilPayloadConverter(),
Expand Down
Loading