Skip to content

feat: add temporal options command and declutter help output#1061

Open
chaptersix wants to merge 3 commits into
temporalio:mainfrom
chaptersix:feat/options-command
Open

feat: add temporal options command and declutter help output#1061
chaptersix wants to merge 3 commits into
temporalio:mainfrom
chaptersix:feat/options-command

Conversation

@chaptersix

Copy link
Copy Markdown
Contributor

Summary

  • Adds temporal options command (kubectl-style) that displays global and connection flags in a table with env var and config key columns
  • Hides global flags from root --help and connection flags from subcommand --help, replacing them with a hint to temporal options
  • Adds hide-from-help, config-key, and Description() support to the option set YAML spec and code generator
  • Shortens flag descriptions to remove info now shown in dedicated table columns

Before

$ temporal --help
...
Flags:
      --client-connect-timeout duration   ...
      --color string                      ...
      --command-timeout duration          ...
      ... (15 more global flags)

After

$ temporal --help
...
Use "temporal options" for global and connection options.
$ temporal options
Global options
...
  FLAG                                ENV                    DESCRIPTION
  --env string                        TEMPORAL_ENV           Active environment name ...
  ...

Connection options
...
  FLAG                              ENV                       CONFIG KEY        DESCRIPTION
  --address string                  TEMPORAL_ADDRESS          address           Temporal Service gRPC endpoint ...
  --api-key string                  TEMPORAL_API_KEY          api_key           API key for request
  ...

Test plan

  • go build ./cmd/temporal
  • go test ./internal/temporalcli/ -run TestHelp
  • Verify temporal --help no longer shows global flags
  • Verify temporal workflow --help no longer shows connection flags
  • Verify temporal workflow list --help shows only command-specific flags
  • Verify temporal options displays both tables with correct env/config columns
  • Verify all flags still work when passed on the command line

Hide global and connection flags from help output, replacing them with
a hint to the new `temporal options` command. This follows the kubectl
pattern where `kubectl options` lists global flags.

Changes:
- Add `temporal options` command with grouped tables for global and
  connection options, showing flag, env var, config key, and description
- Hide root persistent flags from root help output
- Hide client option flags from subcommand help via `hide-from-help`
  option set attribute and generated `HideFlags()` methods
- Add `implied-env` and `config-key` annotations to generated flag
  descriptions so env vars and config keys are discoverable
- Add `Description()` methods to option sets, driven from YAML
- Shorten option descriptions to remove info now shown in table columns
@chaptersix
chaptersix marked this pull request as ready for review July 23, 2026 15:20
@chaptersix
chaptersix requested a review from a team as a code owner July 23, 2026 15:20
@chaptersix

Copy link
Copy Markdown
Contributor Author

if it's not already, make this experimental. we'll iterate on it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f17d16e4c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// If there is an implied env var or config key, append to desc
desc := o.Description
if o.ImpliedEnv != "" {
desc += fmt.Sprintf(" Env: %s.", o.ImpliedEnv)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop advertising unsupported env-file variable

This now appends every implied-env to user-facing help, which makes --env-file show Env: TEMPORAL_ENV_FILE, but that variable is never consumed when selecting the deprecated env config file: preprocessOptions only prefetches --env-file from Args and otherwise falls back to the default path, and a repo-wide search shows no TEMPORAL_ENV_FILE lookup. Users following temporal options will set this env var and still have the CLI read the default env file, potentially using the wrong saved environment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants