The twilio:config
command enables you to list and set configuration values that apply regardless of your active profile.
To see your current configuration including Edge, profiles, and active profile, use:
twilio config:list
If a configuration value is currently determined by an environment variable, such as TWILIO_EDGE
, it will have [env]
appended to its value. For example, this could look like:
1$ export TWILIO_EDGE=sydney2$ twilio config:list3Config Name Value4edge "sydney[env]"5# remaining config values...
All configurations are stored in ~/.twilio-cli/config.json
.
To set a configuration value, such as setting your target Edge to sydney
without an environment variable, use:
twilio config:set --edge=sydney
To configure the Twilio CLI to reject any commands that do not include a profile
flag, use:
1$ twilio config:set --require-profile-input23# ❌ This is doomed to fail since no profile is provided4$ twilio phone-numbers:list5» Error: Missing required flag:6-p, --profile PROFILE Shorthand identifier for your profile. To disable this check run:78twilio config:set --no-require-profile-input910# ✅ profile is defined, request accepted11$ twilio phone-numbers:list --profile=dev12SID Phone Number Friendly Name13PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline1415# ✅ you can also use shorthand for the profile flag16$ twilio phone-numbers:list -p dev17SID Phone Number Friendly Name18PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline
Run the following command and confirm to revert this setting:
1$ twilio config:set --no-require-profile-input2? Overwrite existing requireProfileInput value? Yes
To remove the value of a configuration that has previously been set, set the value to an empty string. You will be prompted to confirm that you want to remove that value from your configuration.
This is useful in case you are temporarily setting the Edge to a non-US location for some work, and want to revert back to the US Edge afterwards. As an example:
1$ twilio config:set --edge=2? Remove existing edge value? Yes
If no profile is active after setting --no-require-profile-input
, run twilio profiles:use PROFILE_ID
to set an active profile for subsequent CLI commands.
The Twilio CLI will attempt to load configuration values in the following order of priority:
config.json