Configuration
Thetwilio:config
command enables you to list and set configuration values that apply regardless of your activeprofile.
To see your current configuration including Edge, profiles, and active profile, use:
twilioconfig:list
If a configuration value is currently determined by an environment variable, such asTWILIO_EDGE
, it will have[env]
appended to its value. For example, this could look like:
1$export TWILIO_EDGE=sydney2$twilio config:list3ConfigName Value4edge"sydney[env]"5# remaining config values...
Info
All configurations are stored in~/.twilio-cli/config.json
.
To set a configuration value, such as setting your target Edge tosydney
without an environment variable, use:
twilioconfig:set--edge=sydney
To configure the Twilio CLI to reject any commands that do not include aprofile
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,--profilePROFILE Shorthand identifier for your profile. To disable this check run:78twilioconfig:set--no-require-profile-input910# ✅ profile is defined, request accepted11$twilio phone-numbers:list--profile=dev12SIDPhone Number Friendly Name13PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+1646887XXXX Congress hotline1415# ✅ you can also use shorthand for the profile flag16$twilio phone-numbers:list-pdev17SIDPhone 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
Warning
If no profile is active after setting--no-require-profile-input
, runtwilio 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:
- From environment variables, if set
- From the values defined in
config.json