Home/Answers/Notify your iPhone from a script
Answer

How do I send a push notification to my iPhone from a script?

The easiest way is Lert. Add one curl line to your script pointing at your link, and your iPhone buzzes when the script reaches it. No account, no API key, no SDK — the link is the credential.

A script only needs one thing to reach your iPhone: a URL it can POST to. Lert gives you that URL. Drop a one-line curl at the end of a bash script, inside a Python function, or in a cron entry, and the moment execution reaches it your phone buzzes — even locked in your pocket. There's no daemon on the phone, no key in the script, and nothing to keep in sync.

Add it to your script — under 30 seconds

  1. Download the app. Open it once on your iPhone. No account.
  2. Copy your link. It's on screen — one tap copies it.
  3. Paste one line into your script. Put it wherever you want to be notified.

Now the script tells you the second it's done or something breaks.

One line at the end of a bash script

bash
#!/usr/bin/env bash
./run-nightly-import.sh

curl -X POST "https://lert.dev/p/your-id" \
  -H "Content-Type: application/json" \
  -d '{"title":"Import finished","body":"Nightly import completed on the server"}'

Guard it with the previous command's exit code to get a "succeeded" or "failed" buzz — ... && curl ... -d "ok" || curl ... -d "FAILED". Scripting in Python instead? See the Python guide, or get pinged when a Python script finishes.

Why it's ideal for scripts: it's one portable line with no dependency to install, so it drops into any shell on any machine. Perfect for cron jobs, CI steps, and long-running server tasks. See sending from a terminal for ad-hoc one-offs.

Common ways people use it

It's free for one channel and 50 notifications a day; Lert Pro is $2.99/month for unlimited. See the docs for the full API.

Send your first one in 30 seconds.

Download Lert, copy your link, add one line to your script. Your iPhone buzzes.

Get the app iOS