Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Configuration


The twilio:config command enables you to list and set configuration values that apply regardless of your active profile.


List values

list-values page anchor

To see your current configuration including Edge, profiles, and active profile, use:


_10
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:


_10
$ export TWILIO_EDGE=sydney
_10
$ twilio config:list
_10
Config Name Value
_10
edge "sydney[env]"
_10
# remaining config values...

(information)

Info

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:


_10
twilio config:set --edge=sydney

Require profile input

require-profile-input page anchor

To configure the Twilio CLI to reject any commands that do not include a profile flag, use:


_18
$ twilio config:set --require-profile-input
_18
_18
# ❌ This is doomed to fail since no profile is provided
_18
$ twilio phone-numbers:list
_18
» Error: Missing required flag:
_18
-p, --profile PROFILE Shorthand identifier for your profile. To disable this check run:
_18
_18
twilio config:set --no-require-profile-input
_18
_18
# ✅ profile is defined, request accepted
_18
$ twilio phone-numbers:list --profile=dev
_18
SID Phone Number Friendly Name
_18
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline
_18
_18
# ✅ you can also use shorthand for the profile flag
_18
$ twilio phone-numbers:list -p dev
_18
SID Phone Number Friendly Name
_18
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline

Run the following command and confirm to revert this setting:


_10
$ twilio config:set --no-require-profile-input
_10
? 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:


_10
$ twilio config:set --edge=
_10
? Remove existing edge value? Yes

(warning)

Warning

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.


Precedence of configuration values

precedence-of-configuration-values page anchor

The Twilio CLI will attempt to load configuration values in the following order of priority:

  1. From environment variables, if set
  2. From the values defined in config.json

Rate this page: