Configure client profiles
Client profiles let you define named connection configurations in gateway.conf and switch between them using the --profile flag — without editing the config file or setting environment variables between commands. Use profiles when you manage multiple gateway clusters, such as production, staging, and development environments, from a single workstation.
Define profiles in gateway.conf
Profiles are defined as [client:profile_name] sections in gateway.conf. Each profile inherits any settings not explicitly defined from the base [client] section, so you only need to specify values that differ from the base configuration.
Profile sections support the following properties:
Profile names are alphanumeric, case-insensitive, and normalized to lowercase internally — production, Production, and PRODUCTION all resolve to the same profile.
In this example, the staging profile inherits port = 50051 from the base [client] section and only overrides host. The production profile overrides host and specifies its own certificate files.
Use a profile
Pass --profile <profile_name> to any iagctl command to use a named profile:
Without --profile, iagctl uses the base [client] section as before — existing configurations require no changes.
Override profile settings with environment variables
You can override individual profile settings using environment variables following the pattern GATEWAY_CLIENT_<PROFILE>_<SETTING>, where <PROFILE> is the uppercase profile name and <SETTING> is the uppercase setting name.
For example, to override the host for the production profile:
Profile-specific environment variables take precedence over all other configuration sources. The full precedence order for any setting is:
- Profile-specific environment variable (
GATEWAY_CLIENT_<PROFILE>_<SETTING>) - Profile config section (
[client:profile_name]) - Base environment variable (
GATEWAY_CLIENT_<SETTING>) - Base config section (
[client]) - Default value
Verify the active configuration
Run iagctl version --show-config to display the resolved effective configuration after profile selection:
The output reflects the fully resolved configuration — inherited values from the base [client] section, overrides from the profile section, and any environment variable overrides applied on top.