SDKCLI Reference

CLI Reference

The TextBubbles CLI lets you interact with the API directly from your terminal. Perfect for quick operations, testing, and scripting.

Installation

npm install -g @textbubbles/js

Or use npx:

npx @textbubbles/js <command>

Authentication

Login

Save your API key locally:

textbubbles login
# Enter your API key when prompted

Or set via environment variable:

export TEXTBUBBLES_API_KEY=tb_your_api_key

Check Auth Status

textbubbles whoami

Logout

textbubbles logout

Messages

Send a Message

# Basic message
textbubbles send "+14155551234" "Hello from CLI!"
 
# With effect
textbubbles send "+14155551234" "Congrats!" --effect confetti
 
# With media
textbubbles send "+14155551234" "Check this out" --media https://example.com/image.jpg
textbubbles send:carousel "+14155551234" \
  https://example.com/img1.jpg \
  https://example.com/img2.jpg \
  https://example.com/img3.jpg

Schedule a Message

textbubbles send:schedule "+14155551234" "Good morning!" \
  --at "2026-03-29T09:00:00Z"

List Messages

# All messages
textbubbles messages list
 
# Filter by recipient
textbubbles messages list --to "+14155551234"
 
# Limit results
textbubbles messages list --limit 10
 
# JSON output
textbubbles messages list --json

Get Message Details

textbubbles messages get msg_abc123

Cancel Scheduled Message

textbubbles messages cancel msg_abc123

Contacts

List Contacts

# All contacts
textbubbles contacts list
 
# Filter by tag
textbubbles contacts list --tag vip
 
# Search by name
textbubbles contacts list --search "Jane"

Create Contact

textbubbles contacts create \
  --phone "+14155551234" \
  --name "Jane Doe" \
  --email "jane@example.com" \
  --tags vip,customer

Get Contact

textbubbles contacts get contact_abc123

Delete Contact

textbubbles contacts delete contact_abc123

Capabilities

Check iMessage Support

textbubbles check "+14155551234"

Output:

+14155551234: iMessage ✓

Webhooks

Get Current Config

textbubbles webhooks get

Set Webhook URL

textbubbles webhooks set https://example.com/webhooks/textbubbles \
  --secret whsec_your_secret \
  --events message.received,message.delivered

Payments

Request Payment

textbubbles pay:request "+14155551234" 25.00 --memo "For lunch"

List Payment Requests

textbubbles pay:list

Cancel Payment Request

textbubbles pay:cancel pay_abc123

Global Options

OptionDescription
--jsonOutput as JSON
--api-key <key>Override API key
--base-url <url>Override API base URL
--helpShow help
--versionShow version

Configuration File

The CLI stores configuration in ~/.textbubbles/config.json:

{
  "apiKey": "tb_your_api_key",
  "baseUrl": "https://api.textbubbles.com"
}

Scripting Examples

Send to Multiple Recipients

for phone in "+14155551234" "+14155555678" "+14155559999"; do
  textbubbles send "$phone" "Hello!"
done

Export Messages to JSON

textbubbles messages list --json > messages.json

Check Multiple Numbers

cat numbers.txt | while read phone; do
  textbubbles check "$phone"
done