360 Secure SkillHub
360 安全技能中心

Twilio Comms

该 Skill 提供一个 Python CLI 脚本,借助 Twilio API 发送与查询短信、发起并查询语音通话、发送 WhatsApp 自由文本或模板消息,以及执行 Verify 短信/语音验证码的发送与校验;需配置 Twilio 账号凭证环境变量。

fr3kstyle
fr3kstyle
热度 45.77
最近更新 2026-05-11 17:34:43
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / API 集成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add twilio-comms
Metadata
name
twilio-comms
description
Twilio SMS, Voice, WhatsApp, and Verify (2FA) — send messages, make calls, and run verification flows from the CLI.

Twilio Comms

Automate SMS, voice calls, WhatsApp messaging, and two-factor authentication flows via the Twilio API. Send and track messages, place and monitor outbound calls, send WhatsApp templates or free-form messages, and run complete Verify 2FA flows — all from a single Python CLI tool.

Setup

export TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export TWILIO_AUTH_TOKEN="your_auth_token_here"
export TWILIO_FROM_NUMBER="+15550001234"        # your Twilio number
export TWILIO_VERIFY_SERVICE_SID="VAxx..."      # optional, for Verify/2FA

Get credentials: console.twilio.com → Account Info.

Commands / Usage

# ── SMS ─────────────────────────────────────────────────
# Send an SMS
python3 scripts/twilio_comms.py sms-send --to "+61400000000" --body "Hello from Twilio!"
python3 scripts/twilio_comms.py sms-send --to "+61400000000" --body "Custom sender" --from "+15550001234"

# List recent messages
python3 scripts/twilio_comms.py sms-list
python3 scripts/twilio_comms.py sms-list --limit 50 --to "+61400000000"

# Get delivery status of a message
python3 scripts/twilio_comms.py sms-status --sid "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# ── VOICE ───────────────────────────────────────────────
# Make an outbound call (plays TwiML message)
python3 scripts/twilio_comms.py call-make --to "+61400000000" --message "Hello, this is an automated call."
python3 scripts/twilio_comms.py call-make --to "+61400000000" --twiml-url "https://demo.twilio.com/docs/voice.xml"

# List recent calls
python3 scripts/twilio_comms.py call-list
python3 scripts/twilio_comms.py call-list --limit 25 --status completed

# Get call details and status
python3 scripts/twilio_comms.py call-status --sid "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Get call recordings
python3 scripts/twilio_comms.py call-recordings --call-sid "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# ── WHATSAPP ────────────────────────────────────────────
# Send a free-form WhatsApp message (within 24h session window)
python3 scripts/twilio_comms.py wa-send --to "+61400000000" --body "Hi from WhatsApp via Twilio!"

# Send a template message (outside 24h window)
python3 scripts/twilio_comms.py wa-template --to "+61400000000" --template "Your appointment is confirmed for {{1}}." --params "Monday 3pm"

# ── VERIFY / 2FA ────────────────────────────────────────
# Send a verification code (SMS or call)
python3 scripts/twilio_comms.py verify-send --to "+61400000000"
python3 scripts/twilio_comms.py verify-send --to "+61400000000" --channel voice

# Check/verify the code
python3 scripts/twilio_comms.py verify-check --to "+61400000000" --code "123456"

Requirements

  • Python 3.8+
  • requests (pip install requests)
  • Environment variables: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_FROM_NUMBER
  • Optional: TWILIO_VERIFY_SERVICE_SID for Verify/2FA commands