Send Yourself a Text from the Command Line

uxsend sends a message to your own phone, by text or email. Run it and type a message, or put it at the end of any script: "Backup finished". It's also the easiest way to save your API key once, so every other example program finds it.

1. Get your API key

It's on your account screen. No account yet? Start a free trial, then add your mobile number on the account screen so alerts come by text. The first time you run uxsend it asks for the key and offers to save it.

2. Download and run

Windows: uxsend-windows.zip. Unzip it and double-click uxsend.bat, or from PowerShell:

.\uxsend.ps1 -Body "Backup finished"

Mac / Linux: uxsend.sh:

chmod +x uxsend.sh
./uxsend.sh                          # asks "Enter text body"
./uxsend.sh "Job done"
some_long_job && ./uxsend.sh "Job done" || ./uxsend.sh "Job FAILED"
./uxsend.sh -m email "Weekly report is ready"

Python 3 (any OS): uxsend.py. Run python3 uxsend.py, or from your own code:

from uxsend import send_alert, get_key
send_alert(get_key(), "Import finished: 1,204 rows")

Test without sending: set USERALERTX_DRYRUN=1 (Mac/Linux) or $env:USERALERTX_DRYRUN="1" (PowerShell), and it shows the text it would send instead.

Good to know

  • Text or email: alerts go the way your account is set. Add -m sms or -m email to choose for one message.
  • Cost: 1 token for a text, 0.1 for an email (a plan includes 50 tokens a month).
  • Your key: saved in .useralertx_key in your home folder, readable only by you. Anyone who can use your computer account can send alerts as you, so don't save it on a shared computer. If it leaks, make a new key on your account screen.
  • Want every program at once? Windows tools (zip) · Mac / Linux tools (zip)