twilio-cli-reference
Twilio CLI reference for managing Twilio resources from the terminal. Covers installation, credential profiles, phone number provisioning, sending SMS and email, webhook configuration, local development with a tunneling service, debugging with watch and logs, serverless deployment, and plugin ecosys
- 0
- Installs
- —
- Rating
- —
- Success rate
- 2
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 ada0b2a5e1f8fa34… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Overview
The Twilio CLI lets you manage Twilio resources, send messages, configure webhooks, and deploy serverless functions directly from the terminal. AI coding agents can use CLI commands to provision resources and test integrations without writing application code.
Install:
| Platform | Command |
|---|---|
| macOS | brew tap twilio/brew && brew install twilio |
| Windows | scoop bucket add twilio-scoop https://github.com/twilio/scoop-twilio-cli && scoop install twilio-cli |
| Linux (apt) | See twilio-cli/getting-started/install for repo setup, then apt install twilio |
| npm | npm install -g twilio-cli |
Update: brew upgrade twilio / scoop update twilio-cli / npm install -g twilio-cli@latest
Authentication & Profiles
# First-time login — creates a local API key stored as a profile
twilio login
# Named profiles for multiple accounts
twilio profiles:create --account-sid ACxxx --auth-token xxx --profile staging
# Avoid --auth-token as a plain argument — it will be stored in shell history. Use TWILIO_AUTH_TOKEN env var instead.
twilio profiles:list
twilio profiles:use staging
# Run a single command against a different profile
twilio api:core:messages:list -p production
# Subaccount access
twilio api:core:messages:list --account-sid ACxxx_SUBACCOUNT
Credential priority: explicit -p/--account-sid flag > env vars (TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) > active profile.
Phone Numbers
# Search available numbers (US local, area code 415)
twilio api:core:available-phone-numbers:local:list --country-code US --area-code 415
# Purchase a number
twilio api:core:incoming-phone-numbers:create --phone-number "+14155551234"
# List owned numbers
twilio phone-numbers:list
# Set webhooks on a number
twilio phone-numbers:update +14155551234 \
--sms-url "https://example.com/sms" \
--voice-url "https://example.com/voice"
Send SMS
twilio api:core:messages:create \
--from "+14155551234" \
--to "+14155556789" \
--body "Your order has shipped."
# List recent messages
twilio api:core:messages:list --to "+14155556789" --limit 10
Send Email (SendGrid)
Requires SENDGRID_API_KEY environment variable.
# Configure defaults
twilio email:set --from "noreply@example.com" --subject "Default Subject"
# Send email
twilio email:send \
--to "user@example.com" \
--subject "Invoice attached" \
--text "Please find your invoice." \
--attachment ./invoice.pdf
# Pipe output as email body
ps aux | twilio email:send --to "ops@example.com" --subject "Process list"
Webhook Development
# Set webhook URLs on a number
twilio phone-numbers:update +14155551234 --sms-url "https://your-tunnel-url.example.com/sms"
# Emulate webhook events locally (requires plugin)
twilio plugins:install @twilio-labs/plugin-webhook
twilio webhook:invoke http://localhost:3000/sms --type sms
Local development: The CLI rejects localhost URLs directly. Tunneling services such as ngrok are not bundled with twilio-cli. install one separately, then set the public tunnel URL as your webhook.
** ngrok is NOT included in the CLI — install separately: npm install -g ngrok or via https://ngrok.com
- Start tunnel: ngrok http 3000, then use the provided URL for webhook
configuration
Debugging & Monitoring
# Debug logging on any command (logs to stderr)
twilio api:core:messages:create --from +14155551234 --to +14155556789 --body "test" -l debug
# Real-time monitoring (requires plugin)
twilio plugins:install @twilio-labs/plugin-watch
twilio watch # stream debugger alerts, calls, messages in real time
# Output formatting
twilio api:core:messages:list -o json # JSON output
twilio api:core:messages:list -o tsv # tab-separated
twilio api:core:messages:list --properties sid,status,direction # select columns
twilio api:core:messages:list --limit 200 # override default 50-record cap
Serverless Deployment
twilio plugins:install @twilio-labs/plugin-serverless
# Create a new Functions project
twilio serverless:init my-project --template blank
cd my-project
# Local development
twilio serverless:start # serves functions at localhost:3000
# Deploy to Twilio
twilio serverless:deploy
Plugins
twilio plugins:install <package>
twilio plugins:list
twilio plugins:remove <package>
| Plugin | What it does |
|---|---|
@twilio-labs/plugin-serverless | Develop and deploy Twilio Functions and Assets |
@twilio-labs/plugin-dev-phone | Test SMS/Voice without a real phone |
@twilio-labs/plugin-watch | Real-time monitoring of debugger alerts, calls, messages |
@twilio-labs/plugin-token | Generate client-side SDK tokens (Voice, Chat, Video) |
@twilio-labs/plugin-assets | Upload static resources |
@twilio-labs/plugin-webhook | Emulate webhook events for local testing |
@twilio-labs/plugin-flex | Create, build, deploy Flex plugins |
Regional & Edge Routing
# Login to a specific region
twilio login --region au1 --edge sydney
# Set edge globally
twilio config:set --edge=sydney
# Or via env vars
export TWILIO_REGION=au1
export TWILIO_EDGE=sydney
Supported: au1/sydney, ie1/dublin, jp1/tokyo. Each region uses a different Auth Token from your US1 credentials. Find yours in the Twilio Console under API keys & tokens, selecting your target region.
Configuration
twilio config:list # show all settings
twilio config:set --edge=sydney # set default edge
twilio config:set --require-profile-input # prompt before using active profile
Config stored at ~/.twilio-cli/config.json.
Syntax notes:
- Commands use spaces by default, using colon also works:
twilio api core messages create=twilio api:core:messages:create twilio [COMMAND] --helpfor any command's options- Multi-line: use
\for line continuation
CANNOT
- Default list limit is 50 records — always pass
--limitfor larger result sets. - API timeout is 30 seconds — long-running operations may fail silently.
- Cannot use localhost URLs for webhooks — use a tunneling service, such as ngrok, installed separately.
- No autocomplete on Windows — only bash/zsh supported.
- ** ngrok is not bundled with twilio-cli**, install separately
- Cannot send Twilio Email (comms API) via CLI —
twilio email:senduses SendGrid only. For Twilio Email, use the REST API directly.
Next Steps
- Account setup and API keys:
twilio-account-setup,twilio-iam-auth-setup - Webhook architecture and signature validation:
twilio-webhook-architecture - Debugging and observability:
twilio-debugging-observability - Send SMS via API/SDK:
twilio-send-message - SendGrid email setup:
twilio-sendgrid-account-setup
Files
2- SKILL.md
c16543910e7.5 KB - agents/openai.yaml
f662fa3c19466 B
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from twilio/ai8
Create and configure a Twilio account from scratch. Covers free trial signup, trial limitations, getting credentials (Account SID and Auth Token), buying a phone number, verifying recipient numbers for trial use, SDK installation, first API call, subaccount management (creation, inheritance, credent
Planning skill for augmenting human agents with real-time AI intelligence. Qualifies the developer's use case across coaching, compliance, QA, and routing to recommend the right Conversation Intelligence + Conversation Memory + TaskRouter architecture. Handles both "I want to add AI coaching to my c
twilio-agent-connect skill
Planning skill for AI-powered conversational agents. Qualifies the developer's use case across outcome sophistication, entry point, and customer profile to recommend the right Twilio Conversations architecture and implementation skills. Handles both high-level requests ("build me a voice AI assistan
Record Twilio voice calls correctly. Covers the critical distinction between Record verb (voicemail) and Dial record (call recording), dual-channel for QA, mid-call pause for PCI, Conference recording, and the ConversationRelay workaround. Use this skill whenever you need to capture call audio for c
Registrations required BEFORE Twilio traffic works. Covers messaging programs (A2P 10DLC, toll-free verification, WhatsApp WABA, RCS, short code, alphanumeric sender) and voice trust programs (STIR/SHAKEN, Voice Integrity, Branded Calling, CNAM). Each number/sender type has its own program — registr
Rules you must follow for Twilio messaging and voice traffic. Covers TCPA (consent tiers, quiet hours, DNC), GDPR (EU consent, right to deletion), PCI DSS (payment recording, Pay verb), HIPAA (BAA, PHI), FDCPA (debt collection limits), CAN-SPAM, WhatsApp policies, SHAKEN/STIR, and consent management
Build multi-party calls using Twilio Conference. Covers warm transfer, cold transfer, coaching (whisper), hold vs mute, participant modes, and supervisor barge. Use this skill for any contact center, support line, or scenario requiring transfers, holds, or multi-party calls.
Related tooling skillsscan passed
Open an executable and its argument array in a visible terminal window through a reusable, shell-free launch plan with dry-run, JSON, capability detection, detached fallback, and standalone recovery modes. Use when Codex needs to open an interactive CLI, SSH session, local development process, sandb
Web performance regression detection. (gstack)
Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintena
Helps you build and check a color system for your project. It generates palettes, names semantic tokens, converts between formats and measures contrast.
Creates a new Angular app using the Angular CLI. This skill should be used whenever a user wants to create a new Angular application and contains important guidelines for how to effectively create a modern Angular application.
Audit, diagnose, or optimize website loading and interaction performance, Core Web Vitals, and Lighthouse performance scores.