sincecutoff.com
← all changes

Temporal CLI extensions support OAuth client options

Introduced 2026-02-05 · score 0.91

HOW TO USE IT

When building a CLI extension client, use `ClientOptionsBuilder` with generated `CommonOptions` and `ClientOptions` to build SDK dial options. Store OAuth with `StoreClientOAuth`; set `Address` to persist the profile address, using `${namespace}` when the address should include the runtime namespace.

builder := &cliext.ClientOptionsBuilder{CommonOptions: common, ClientOptions: client} opts, err := builder.Build(ctx)
err := cliext.StoreClientOAuth(cliext.StoreClientOAuthOptions{OAuth: oauth, Address: "<address>/${namespace}"})
result, err := cliext.LoadClientOAuth(cliext.LoadClientOAuthOptions{})

WHY THIS HELPS

Configure OAuth for a CLI extension client and set its address for the active namespace.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.6.0
  • ClientOptionsBuilder.CommonOptions (required): Generated common CLI options, including profile configuration.
  • ClientOptionsBuilder.ClientOptions (required): Generated client configuration from flags.
  • ClientOptionsBuilder.Build(ctx) (required): Builds SDK `client.Options`; returns options and an error. If `ClientConnectTimeout` is set, apply it as a context timeout when dialing.
  • LoadClientOAuthOptions.ConfigFilePath: Overrides the config path; empty uses `TEMPORAL_CONFIG_FILE` or the default path.
  • LoadClientOAuthOptions.ProfileName: Selects the profile; empty uses `TEMPORAL_PROFILE` or `default`.
  • LoadClientOAuthOptions.EnvLookup: Overrides environment lookup; nil uses OS environment lookup.
  • StoreClientOAuthOptions.ConfigFilePath: Overrides the config path; empty uses `TEMPORAL_CONFIG_FILE` or the default path.
  • StoreClientOAuthOptions.ProfileName: Selects the profile; empty uses `TEMPORAL_PROFILE` or `default`.
  • StoreClientOAuthOptions.OAuth: OAuth configuration to store; nil removes OAuth from the profile.
  • StoreClientOAuthOptions.Address: Server address to store in the profile; empty leaves address unchanged. `${namespace}` in the address is replaced with the profile namespace when building client options.
  • StoreClientOAuthOptions.EnvLookup: Overrides environment lookup; nil uses OS environment lookup.
  • OAuthConfig.ClientConfig: OAuth 2.0 client configuration.
  • OAuthConfig.Token: OAuth 2.0 token.
  • Prerequisite: Use the `github.com/temporalio/cli/cliext` package; its Go API is the extension helper library.
  • Prerequisite: When `CommonOptions.ClientConnectTimeout` is set, apply it as a context timeout when dialing.
  • The source says use of OAuth with the `default` namespace produces a helpful error message.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card