Skip to content

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

Draft
chaptersix wants to merge 1 commit into
temporalio:mainfrom
chaptersix:feat/options-command
Draft

feat: add temporal options command and declutter help output#1061
chaptersix wants to merge 1 commit 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
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.

1 participant