sendblue-cli
Original:🇺🇸 English
Translated
Send iMessage and SMS from the shell via the @sendblue/cli npm package — outbound sends, contact management, and account setup with no API client or webhook server required.
10installs
Sourcesendblue-api/skills
Added on
NPX Install
npx skill4agent add sendblue-api/skills sendblue-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Sendblue CLI
Overview
@sendblue/cli~/.sendblue/credentials.json600When to Use This Skill
- Use when the user wants to text a phone number from a script, shell, hook, or agent turn (e.g. "text me when X finishes", "ping my phone", "notify on completion").
- Use when the user mentions as a CLI/binary or asks to set up the
sendbluepackage.@sendblue/cli - Prefer this skill over [[sendblue-api]] when the work happens in a shell context, one-shot script, cron job, or agent hook.
- Reach for [[sendblue-api]] instead when writing application code that integrates Sendblue, receiving inbound webhooks, or needing features the CLI does not expose (send styles, reactions, group messages, status callbacks, media uploads).
How It Works
Step 1: Install
bash
npm install -g @sendblue/cli # global, exposes `sendblue`
# or one-shot:
npx @sendblue/cli <command>Step 2: Set up an account
sendblue setupbash
sendblue setup --email you@example.com # sends code
sendblue setup --email you@example.com --code 12345678 \
--company my-co --contact +15551234567 # completes setup| Flag | Notes |
|---|---|
| Email address |
| 8-digit verification code (from the email) |
| Lowercase, hyphens/underscores, 3–64 chars |
| First contact, E.164 |
Step 3: Send messages
bash
sendblue send +15551234567 'Hello from Sendblue!'
sendblue messages --inbound --limit 20Phone numbers must be E.164 ( + country code + digits, no spaces or dashes).
+Step 4: Manage contacts and plan
On the free plan, a contact must text your Sendblue number once before outbound sends to that contact will work. After , have that contact send any text to the printed Sendblue number, then run to confirm verification.
sendblue setup ... --contact +15551234567sendblue contactsCommand Reference
| Command | Purpose |
|---|---|
| Create account, verify email, set company name, add first contact |
| Log in to an existing account |
| Send an iMessage |
| List recent messages |
| Register a contact |
| List contacts and their verification status |
| Account/plan info |
| Show current credentials and verify validity |
Examples
Example 1: Notify when a long task finishes
bash
long_running_thing && sendblue send +15551234567 "✅ done: $(date)"Example 2: Read recent inbound for a specific contact
bash
sendblue messages -n +15551234567 --inbound --limit 50Example 3: Verify creds are good before a batch send
bash
sendblue whoami || sendblue loginExample 4: Wire to a Claude Code Stop
hook
StopTo text yourself at the end of every agent turn, register a hook in that shells out to . Defer the actual hook wiring to [[update-config]] and the trigger logic to [[sendblue-notify]] — this skill only owns the CLI invocation.
Stopsettings.jsonsendblue sendBest Practices
- ✅ Use E.164 numbers everywhere. , never
+15551234567or5551234567.(555) 123-4567 - ✅ Run before unattended batches to fail fast on stale or missing creds.
sendblue whoami - ✅ Re-run as the same OS user that owns
setup.~/.sendblue/credentials.json - ❌ Don't — it writes creds to root's home and the next non-sudo run won't see them.
sudo - ❌ Don't embed creds in env vars when the CLI already reads them from the per-user credentials file.
Limitations
- Outbound-first: there is no built-in webhook server for inbound. Use [[sendblue-api]] webhooks for full inbound handling.
- The CLI does not expose send styles/effects, reactions, group messages, status callbacks, media uploads, or the contacts API beyond basic CRUD. Reach for the HTTP API for those.
- Free-plan accounts require recipient verification before outbound sends succeed.
Security & Safety Notes
- Credentials are written to with mode
~/.sendblue/credentials.json. Treat that file like an API key — do not commit it, do not copy it across machines without the same posture.600 - Run the CLI as the OS user that owns the credentials file. writes a separate copy under root's home and silently desyncs.
sudo - Outbound messages to phone numbers are not free of consequence — wire into hooks or loops only after gating on duration or success conditions to avoid spamming the recipient.
sendblue send - Verification codes arrive by email; treat the address you registered with as a recovery factor for the account.
Common Pitfalls
- E.164 only. or
5551234567will fail — always(555) 123-4567.+15551234567 - Free-plan unverified contacts. Outbound to a contact that hasn't texted in first returns an error — have them text your Sendblue number once, then confirm with .
sendblue contacts - Two-step setup in non-interactive mode. alone only sends the code; you must run a second invocation with
--emailand the rest of the flags to finish.--code - Credentials are per-user. is owner-only (
~/.sendblue/credentials.json). Don't600and pollute root's home — re-running as the same user that ransudois what works.setup
Related Skills
- — HTTP/JSON alternative for application code, webhooks, and features the CLI does not expose.
@sendblue-api - — Patterns and copy rules for "text me when X is done" workflows that sit on top of this CLI.
@sendblue-notify - — Wires
@update-configinto Claude Code hooks (sendblue send,Stop) without owning the message logic.Notification
Links
- README & full flag reference: https://github.com/sendblue-api/sendblue-cli
- Sendblue: https://sendblue.com
- API docs (deeper protocol details): https://docs.sendblue.com