Turns kebab-case names into SCREAMING_SNAKE_CASE: listen-port → LISTEN_PORT, max-body-size → MAX_BODY_SIZE. This is the step from a CLI flag or a YAML key to the environment variable that overrides it, the pattern behind tools that accept both --log-format and LOG_FORMAT.
Paste the keys of a config file or the flags from --help output to get the matching variable names for .env files, Dockerfiles and CI settings.
--help excerpt into String.MYAPP_) if your tool requires one.listen-port: 8080
log-format: json
max-body-size: 1mbLISTEN_PORT: 8080
LOG_FORMAT: json
MAX_BODY_SIZE: 1mbEach YAML key becomes the upper-case environment variable name; values such as json and 1mb are not kebab-case, so they are kept.
log-format → LOG_FORMAT, retry-2-times → RETRY_2_TIMES.--, are left in place.If a Go or Rust CLI binds flags to environment variables (as viper or clap's env feature can), converting the flag list gives the variable names to document.
When a service reads listen-port from config.yaml but also allows an environment override, the converted names are what goes into docker-compose.yml or the CI secret settings.
--, the dashes remain: --log-level → --LOG_LEVEL. Paste names without the prefix.x-1 also look like kebab-case and become X_1, so keep arithmetic out of the input.APP_?No. Add it in your editor afterwards, or include it in the input as app-listen-port.
http2-enabled?They convert cleanly to HTTP2_ENABLED, because the digit is part of the first segment.