Skip to contentSkip to navigationSkip to topbar
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:

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=sydney
2
$ twilio config:list
3
Config Name Value
4
edge "sydney[env]"
5
# 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:

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:

1
$ twilio config:set --require-profile-input
2
3
# ❌ This is doomed to fail since no profile is provided
4
$ twilio phone-numbers:list
5
» Error: Missing required flag:
6
-p, --profile PROFILE Shorthand identifier for your profile. To disable this check run:
7
8
twilio config:set --no-require-profile-input
9
10
# ✅ profile is defined, request accepted
11
$ twilio phone-numbers:list --profile=dev
12
SID Phone Number Friendly Name
13
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline
14
15
# ✅ you can also use shorthand for the profile flag
16
$ twilio phone-numbers:list -p dev
17
SID Phone Number Friendly Name
18
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline

Run the following command and confirm to revert this setting:

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

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

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.