← Back to tools

Twilio CLI

Manage Twilio resources from the terminal

Cloud & Services linuxmacoswindows TypeScript MIT

Description

The Twilio CLI lets you manage Twilio resources, send test messages and calls, explore API responses, and develop Twilio applications from the command line. It supports plugins for Serverless, Flex, and other Twilio products, with built-in debugging and phone number management.

Install

homebrewbrew tap twilio/brew && brew install twilio
npmnpm i -g twilio-cli

AI Summary

Manage Twilio resources from the terminal. Send test SMS and voice calls, manage phone numbers, explore API endpoints, and deploy Twilio Serverless Functions.

Capabilities

  • + Send test SMS messages and make voice calls
  • + Manage phone numbers, messaging services, and accounts
  • + Explore and interact with any Twilio API endpoint
  • + Deploy Twilio Serverless Functions and Assets
  • + Debug webhooks and API interactions
  • + Manage multiple Twilio account profiles

Use When

  • Testing Twilio SMS, voice, or other communication APIs
  • Managing Twilio phone numbers and messaging services
  • Deploying Twilio Serverless Functions
  • Debugging Twilio webhook integrations

Avoid When

  • x Building production messaging pipelines (use the Twilio SDK directly)
  • x Not using Twilio for communications
  • x Need a GUI for account management (use the Twilio Console)

Usage Patterns

Send a test SMS

twilio api:core:messages:create --from +15551234567 --to +15559876543 --body 'Hello from the CLI'

Sends an SMS message between two phone numbers on the account

List phone numbers

twilio phone-numbers:list

Lists all phone numbers associated with the Twilio account

Deploy serverless functions

twilio serverless:deploy

Deploys Functions and Assets from the current project directory

Input / Output

stdin: Not typically used
stdout: API responses, resource listings, and deployment status
Exit codes:
0 Success
1 Error

Typical Pipelines

twilio phone-numbers:list -o json | jq '.[] | {phoneNumber, friendlyName}'
twilio api:core:messages:list --date-sent-after 2024-01-01 -o json | jq 'length'
twilio debugger:logs:list --log-level error -o json | jq '.[].description'

Related Tools

View AGENTS.md for Twilio CLI