Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
twilio-cli
Advanced tools
sudo apt-get install libsecret-1-dev
sudo yum install libsecret-devel
sudo pacman -S libsecret
Eventually, the plan is to have self-contained packages for *nix systems and an installer for Windows with no need for manually installing prerequisites.
npm install -g twilio-cli
twilio
command.npm outdated -g twilio-cli
npm update -g twilio-cli
Plugins for the CLI can be installed using the twilio plugins
command. Until we are publishing the plugins to npm, they will need to be installed by first cloning the plugin repository locally.
Clone the plugin repository. Example debugger plugin.
"Install" the plugin referencing your plugin's local folder like so:
twilio plugins:link plugin-debugger
cd plugin-debugger
npm install
Now, you can run your plugin command from the cli:
twilio debugger:logs:list --help
Want to write your own plugin? See this document.
twilio project:add
which is an alias for:
twilio project:add -p default
This is for caching your credentials for your existing Twilio account (aka Project) locally. Note, while you are prompted for your Account SID and Auth Token, these are not saved. An API Key is created (look for "twilio-cli for [username] on [hostname]" in the console) and stored in your system's keychain.
You can also use credentials stored in environment variables:
TWILIO_ACCOUNT_SID
= your Account SID from your consoleTWILIO_API_KEY
= an API Key created in your consoleTWILIO_API_SECRET
= the secret for the API KeyTWILIO_ACCOUNT_SID
= your Account SID from your consoleTWILIO_AUTH_TOKEN
= your Auth Token from your consoleNOTE: Option 2 should only be used in cases where you are unable to make use of option 1 (which are uncommon).
The CLI will attempt to load credentials in the following order of priority:
-p
parameter.twilio
Lists all available commands.
twilio incoming-phone-number:list
Lists all your phone numbers.
Add --help
to any command to get help (e.g. twilio incoming-phone-number:list --help
)
You can set a webhook on a phone number like so:
twilio incoming-phone-number:update [PN sid or E.164] --sms-url http://url
That sets the primary SMS url. There are also options for setting the voice url, fallback url's, and methods for each. Run twilio incoming-phone-number:update --help
for a full list of options.
When you set a webhook, if you specify a URL that uses the host name of localhost
or 127.0.0.1
, the twilio-cli will automatically create an ngrok tunnel for you and set your webhook to the new ngrok URL. For example:
twilio incoming-phone-number:update [PN sid or E.164] --sms-url http://localhost:5000/handle_sms
All command output is sent to stdout
(whereas logging messages are sent to stderr
).
By default, the output is formatted in human readable form in a columnar format like so:
SID Phone Number Friendly Name
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1209242XXXX SIP testing
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1646887XXXX Congress hotline
PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +1209337XXXX DAVID'S TWILIO CONTACT
Many list
commands will allow you to specify a --properties
option to specify which columns you'd like to display. For example, to display only the Phone Number and SMS Url columns, you would pass --properties "phoneNumber, smsUrl"
.
Note that currently, the column names must match the JSON property names in the Twilio API.
On any command, you can add -o json
to change the output format to JSON. When you choose JSON, the command will send the entire API response to stdout
as JSON. You can then pipe to tools like jq to parse the JSON.
To change the output format to tab separated values (TSV), add -o tsv
to the command line. This format is useful for loading into spreadsheets or for other machine processing. Like the default, columnar output format, you can use the --properties
option to specify which columns you would like included.
All debug, informational, warning, and error information is sent to stderr
. This is so it can be easily separated from the command output. You can decide what level of logging you'd like by using the -l
option. The valid levels of logging messages are debug
, info
, warn
, error
, and none
.
To store credentials for multiple projects, you can use a shorthand "project id" which is just an easy to remember, short string to identify the project. (If you've used git
before, it's like the name you assign to a remote like "origin".)
When you run twilio project:add
, it stores your credentials under a project called default
. This is the project that will be used for all subsequent commands.
To add a second project after the default project, you can run twilio project:add -p my_other_proj
(using whatever identifier you'd like in place of my_other_proj
). Then, when you run subsequent commands, just include the -p my_other_proj
in the command (e.g. twilio incoming-phone-number:list -p my_other_proj
).
To enable autocomplete of CLI commands in bash or zsh, run:
twilio autocomplete
And follow the instructions.
npm install
./bin/run
from the repo directory to run the CLI.Please file a GitHub issue in this repository for any feedback you may have.
Moving all related CLI libs to v1.0.0 per npm semver recommendation.
~/.config/@twilio/cli
(Unix) and %LOCALAPPDATA%\@twilio\cli
(Windows) to ~/.twilio
and %USERPROFILE%\.twilio
, respectively.To copy over your existing configuration, run the following commands (Unix):
mkdir ~/.twilio
cp ~/.config/@twilio/cli/config.json ~/.twilio/config.json
MIT
FAQs
Unleash the power of Twilio from your command prompt. Visit https://twil.io/cli for don.
The npm package twilio-cli receives a total of 2,310 weekly downloads. As such, twilio-cli popularity was classified as popular.
We found that twilio-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.