twilio-sms
它能做什么
这个技能管理 Twilio 电话号码和短信,包括列出号码,以及检查收到或发出的短信。适合用 Twilio 收发短信的人。
适用场景
- ✓你想通过 Twilio 发送一条短信的时候。
- ✓你想查看最近收到或发出的消息的时候。
- ✓你想列出或管理你拥有的 Twilio 电话号码的时候。
技能链接
https://github.com/steipete/agent-scripts/blob/main/skills/twilio-sms/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请给我的团队发一条短信,说会议改到下午 3 点,然后确认已经发送成功。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查 Twilio 工具和凭据是否存在,但不会打印它们,然后验证访问权限,再发送或读取消息。除非你要求读取,否则它不会显示消息内容。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Twilio SMS
Use for Twilio phone-number and SMS work: create/buy numbers, list owned numbers, keep/label numbers, send texts, and check inbound/outbound messages.
Safety
- Never print Account SIDs, auth tokens, API secrets, TOTP codes, or full 1Password item JSON.
- Do not store real phone numbers, SIDs, names, or account-specific item IDs in this skill.
- Use
$one-passwordfor secret reads.opstays tmux-only. - If desktop 1Password access is needed, unset service-account auth for those commands:
env -u OP_SERVICE_ACCOUNT_TOKEN op .... - Print credential shape only: field present, length, prefix class if useful.
- Public writes or logs: avoid leaking message bodies unless the user asked to read/check SMS.
Credential Route
- Check Twilio CLI/profile:
twilio --versionornpx -y twilio-cli --versiontwilio profiles:listornpx -y twilio-cli profiles:list
- Check exact env presence only:
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKEN- optional API key/secret vars
- If only partial env exists, search 1Password metadata first.
- Prefer an item with fields matching:
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKEN- optional
TWILIO_FROM_NUMBER
- If
oponly sees a restricted vault, retry desktop-backed reads withenv -u OP_SERVICE_ACCOUNT_TOKEN. - Verify auth before any purchase/send:
curl -sS -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN" \
"https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID.json"
CLI Setup
Twilio CLI profile creation requires account auth token, not just API key creds:
npx -y twilio-cli profiles:create "$TWILIO_ACCOUNT_SID" \
--auth-token "$TWILIO_AUTH_TOKEN" \
--profile default --force --silent
npx -y twilio-cli profiles:use default
Use npx -y twilio-cli when twilio is not installed.
Numbers
List owned:
npx -y twilio-cli api:core:incoming-phone-numbers:list \
--properties phoneNumber,friendlyName,capabilities
Search US local SMS-capable inventory:
npx -y twilio-cli api:core:available-phone-numbers:local:list \
--country-code US --sms-enabled --voice-enabled --limit 5
If the CLI shape is awkward or missing flags, use REST:
curl -sS -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN" \
"https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/AvailablePhoneNumbers/US/Local.json?SmsEnabled=true&VoiceEnabled=true&PageSize=5"
Buy one candidate:
curl -sS -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN" \
-X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/IncomingPhoneNumbers.json" \
--data-urlencode "PhoneNumber=$PHONE_NUMBER"
Verify ownership/capabilities after purchase. Twilio JSON uses lowercase keys:
capabilities.sms
capabilities.mms
capabilities.voice
Mark numbers the user wants to keep:
npx -y twilio-cli api:core:incoming-phone-numbers:update \
--sid "$PHONE_NUMBER_SID" \
--friendly-name "KEEP - <purpose>"
Retention rule: a number is kept while it remains in the Twilio account and billing is healthy. Do not release/delete unless explicitly asked.
SMS
Send:
npx -y twilio-cli api:core:messages:create \
--from "$FROM_NUMBER" \
--to "$TO_NUMBER" \
--body "$BODY" \
-o json
Fetch status:
npx -y twilio-cli api:core:messages:fetch --sid "$MESSAGE_SID" -o json
Check inbound to a number:
npx -y twilio-cli api:core:messages:list \
--to "$NUMBER" --limit 20 -o json
Check outbound from a number:
npx -y twilio-cli api:core:messages:list \
--from "$NUMBER" --limit 20 -o json
Twilio CLI JSON can return an array for single-resource commands. Parse defensively:
jq 'if type=="array" then .[0] else . end'
Notes
- International SMS may show an alphanumeric or carrier sender instead of the purchased US number.
- US SMS can be compliance-gated. If sending to US recipients fails, check A2P/10DLC registration state before retrying blindly.
- Trial accounts may restrict recipients.
常见问题
我的 Twilio 密钥会显示在输出中吗?
不会。技能规定,绝不打印账户 ID、令牌或任何密钥。
它会在没有询问的情况下购买号码吗?
不会。在任何购买或发送之前,它都会先验证访问权限,并在你要求时才行动。
它从哪里获取凭据?
从环境设置或密码管理器中获取,读取密钥时通过专门的辅助技能完成。
详情
作者的原始描述
Twilio SMS CLI: buy/list/keep numbers, send/check messages, credential routing.
repo: steipete/agent-scripts
热度
- GitHub 星标
- 7.4k
- 排名
- #13254
- 许可证
- MIT
- 更新时间
- 2026/10/30
评论
- …
同一仓库的更多技能
beeper
7.4k帮你的智能体搜索本地 Beeper 聊天记录,找到消息,并判断模糊线索指的是哪个聊天或联系人。
cloudflare-registrar
7.4k帮你的智能体查询 Cloudflare Registrar 的域名价格和可用性,并在确认后注册或列出域名。
codexbar
7.4k帮你的智能体查看你在 Codex、Claude、Kimi 等 AI 服务中还剩多少用量,包括限额、额度和重置时间。
create-cli
7.4k帮你的智能体设计命令行工具的命令、参数、帮助文本、输出和错误提示,让人和脚本都能顺利使用。