Runtime Overrides
Override configuration with command-line arguments and environment variables.
Runtime overrides are useful when the same build needs to run in different places. Procyon adds command-line arguments and environment variables to the environment before configuration files are applied.
Command-line arguments
Command-line options use the --name=value format. The name becomes the
property key.
$ go run . --server.port=3000 --procyon.profiles.active=devThe argument source exposes server.port and procyon.profiles.active to the
same resolver and binder used by configuration files.
port := env.PropertyResolver().LookupOrDefault("server.port", 8080)Environment variables
Environment variables are exposed as configuration properties. Dot and hyphen names can be written with underscores, which fits deployment systems and shell usage.
$ SERVER_PORT=3000 PROCYON_PROFILES_ACTIVE=prod go run .When code asks for server.port, the environment source can match
server.port, SERVER.PORT, server_port, or SERVER_PORT.
Override strategy
Use command-line arguments for local runs, scripts, and temporary changes. Use environment variables for deployment configuration and secrets provided by the runtime platform.
Keep durable defaults in resources/procyon.yml, then override only the values
that differ per run.
