Example programs

Small, ready-to-run programs that send you a UserAlertX alert. Download one, run it, done. They're short and commented, so they're also good starting code for your own.

#ExampleWhat it doesLanguage
1LoginAlertXText approval for every sign-in to your Windows PC — reply Y or it locksWindows installer — no setup or API key
2GrokBotGrok alerts you when you ask it toNative MCP integration — no download
3uxsendType a message, get it as a text or emailPython, PowerShell (Windows), bash (Mac/Linux)
4uxrunAlert when a job finishes or failsPowerShell (Windows), bash (Mac/Linux)
5upcheckAlert when a website goes down / comes backPowerShell (Windows), bash (Mac/Linux)
6diskcheckAlert on a full disk or stale backupsPowerShell (Windows), bash (Mac/Linux)
7Claude Code alertmeClaude Code texts you when it needs your inputPython (Claude Code hook, any OS)
8uxloginAlert every time someone signs in to your computerPowerShell (Windows), bash (Linux/Mac SSH)
9ux2faRequire an emailed code before a login or commandbash (Linux/Mac)
10gamecheckAlert when your game server goes down or comes back, and who joinedPowerShell (Windows), bash (Linux)
11Home AssistantText or email from your smart home: leaks, freezer, garage doorHome Assistant setting — no download

1. LoginAlertX — approve every sign-in to your Windows PC

Every time someone signs in to or unlocks your PC, you get a text: "pclogin wants approval: Sign-in: ... on OFFICE-PC. Reply Y to allow, N to deny, LOCK to lock until you decide." A full-screen Waiting for approval screen covers the desktop until you answer.

  • Y — keep using the PC
  • N, or no reply within 5 minutes — the PC locks
  • LOCK — the PC shows LOCKED and stays that way, even after a restart, until you reply Y or N

Download: LoginAlertX-Setup.exe (Windows 10 / 11, version 1.0.5). Run it and sign in with your UserAlertX email — setup emails you a code and connects the PC to your account. No API key to copy. No account yet? Setup shows you how to get a free trial; you'll need your mobile phone on the account.

Each approval text is a normal 3¢ text alert. The PC is listed under Devices on your account screen; Remove it there and it stops asking. Uninstall from Settings → Apps, or run setup again and choose Uninstall.

Good to know: Windows lets the person in before any program can run, so LoginAlertX stops an unwanted sign-in within moments rather than preventing it. Keep another way in (see "If you get locked out" in the README it installs). Windows may say "Windows protected your PC" because the installer isn't code-signed yet — click More info → Run anyway.

2. GrokBot — native MCP integration (no download)

Connect Grok to UserAlertX once and then just ask it to alert you. In Grok: Settings → Plugins (or grok.com/connectors → New Connector) → Custom, Server URL https://useralertx.com/mcp, auth header Authorization: Bearer YOUR_API_KEY (your key is on your account screen). Full steps: GrokBot setup page.

Then tell Grok things like:

  • "When you finish researching this, text me a two-line summary with UserAlertX."
  • "Every weekday at 8am, check whether my website is up and text me with UserAlertX if it isn't." (if your Grok can run scheduled tasks)
  • "Send me a UserAlertX test alert that says hello." — a quick way to check the connection.
  • "Email me the full list with UserAlertX, subject 'Weekend plan'." — if your account delivers by email.

The first alert may be held until you reply START to the one-time verification text. Using ChatGPT instead? See the ChatGPT page.

Approval codes — two-step check for your AI. Tell Grok: "Before you delete, buy, or send anything to anyone, get my approval with UserAlertX." Grok then asks UserAlertX for approval, you get a 6-digit code by email saying exactly what Grok wants to do, and Grok can only go ahead once you type that code back to it. The code is checked by UserAlertX, not by Grok — so a web page or email that tries to trick Grok with "the user already approved this" gets nowhere. Codes expire in 10 minutes and lock after 3 wrong tries.

Your own systems can check an approval too, instead of taking the AI's word for it: POST /cgi-bin/itapproval.cgi with action=status&approval_id=apr_... and your X-Api-Key returns approved, pending, locked or expired plus the exact action that was approved.

Before you start (examples 3–10)

You need your API key. It's on your account screen. Run uxsend (below) once: it asks for the key and offers to save it, and every other tool here then finds it automatically.

Every tool also has a dry-run mode that shows what it would send without sending: set USERALERTX_DRYRUN=1 (Mac/Linux) or $env:USERALERTX_DRYRUN="1" (Windows PowerShell).

Get everything at once: Windows tools (zip) · Mac / Linux tools (zip)

3. Send an alert — uxsend

Asks "Enter text body" and sends it to you, by text or email.

  • Windows: uxsend-windows.zip — unzip, double-click uxsend.bat. One-liner: .\uxsend.ps1 -Body "Backup finished"
  • Mac / Linux: uxsend.sh — ./uxsend.sh or ./uxsend.sh "Job done"
  • Python 3 (any OS): uxsend.py — python3 uxsend.py; from your own code: from uxsend import send_alert

4. Alert me when a job finishes — uxrun

Runs any command, then sends "Done: … (took 3m12s)" or "FAILED (exit 2): … after 41s" with the last lines of output. Perfect for backups, builds and long copies.

  • Windows: uxrun.ps1 — .\uxrun.ps1 "robocopy C:\Data D:\Backup /MIR" -OkCodes 0,1,2,3 (robocopy counts 0–7 as success; most programs just use 0)
  • Mac / Linux: uxrun.sh — ./uxrun.sh make build

5. Website up/down check — upcheck

Checks a web page and alerts only when it goes down and when it's back up — silent the rest of the time, so run it every few minutes.

  • Windows: upcheck.ps1 — every 5 minutes (one command in a Command Prompt, adjust the path):
    schtasks /create /sc minute /mo 5 /tn "UserAlertX upcheck" /tr "powershell -NoProfile -ExecutionPolicy Bypass -File C:\UserAlertX\upcheck.ps1 https://example.com"
  • Mac / Linux: upcheck.sh — cron: */5 * * * * /home/you/upcheck.sh https://example.com

6. Disk space and backup check — diskcheck

Alerts when a disk passes 90% full (you can change that), and optionally when your newest backup file is too old. One alert per problem, plus a "back to normal" when it clears.

  • Windows: diskcheck.ps1 — .\diskcheck.ps1 -BackupPath D:\Backups -MaxAgeHours 26; daily at 7am:
    schtasks /create /sc daily /st 07:00 /tn "UserAlertX diskcheck" /tr "powershell -NoProfile -ExecutionPolicy Bypass -File C:\UserAlertX\diskcheck.ps1 -BackupPath D:\Backups"
  • Mac / Linux: diskcheck.sh — ./diskcheck.sh -b /backups -h 26; cron daily: 0 7 * * * /home/you/diskcheck.sh -b /backups -h 26

7. Claude Code — “alertme on”

Leave a long Claude Code job running and walk away. Type alertme on in the session, and whenever Claude stops to ask your permission or waits for your next instruction, you get a UserAlertX alert like "Claude needs you (myproject): Claude needs your permission to use Bash". Type alertme off to stop; alertme alone tells you whether it's on. It only affects the session you turned it on in, and sends at most one alert a minute.

  • 1. Save uxclaude.py as ~/.claude/uxclaude.py (Windows: %USERPROFILE%\.claude\uxclaude.py).
  • 2. Save your API key once by running uxsend (example 3), or put it in ~/.useralertx_key.
  • 3. Add these hooks to ~/.claude/settings.json (merge into your existing "hooks" section if you have one; on Windows use python instead of python3):
    "hooks": {
      "UserPromptSubmit": [
        { "hooks": [ { "type": "command", "command": "python3 ~/.claude/uxclaude.py prompt" } ] }
      ],
      "Stop": [
        { "hooks": [ { "type": "command", "command": "python3 ~/.claude/uxclaude.py stop" } ] }
      ],
      "Notification": [
        { "matcher": "permission_prompt",
          "hooks": [ { "type": "command", "command": "python3 ~/.claude/uxclaude.py notify" } ] }
      ]
    }

Claude Code picks up the change on its own. Permission requests alert after a few seconds. When Claude finishes a reply, you get a "waiting for you" alert (with the start of its answer) if you haven't typed anything within a minute. Try it without sending anything: USERALERTX_DRYRUN=1.

8. Sign-in alert — uxlogin

Get an alert every time someone signs in to your computer, like "Sign-in: OFFICE-PC\jim on OFFICE-PC (Remote Desktop) from 203.0.113.9 at 21:14 Sep 27". If it wasn't you, you know right away, not weeks later. It never blocks or slows down a sign-in. (Want to approve each sign-in instead? That's LoginAlertX, example 1.)

  • Windows: uxlogin.ps1 — covers signing in at the PC, Remote Desktop, and (optionally) unlocking. Save it as C:\UserAlertX\uxlogin.ps1, open PowerShell with Run as administrator, and run once:
    powershell -ExecutionPolicy Bypass -File C:\UserAlertX\uxlogin.ps1 -Install
    Add -Unlock to also alert on unlock, or -Trusted "192.168.1." to skip Remote Desktop from your own network. Remove it with -Uninstall.
  • Linux / Mac (SSH): uxlogin.sh — on Linux, one line in /etc/pam.d/sshd covers every account: session optional pam_exec.so /usr/local/bin/uxlogin.sh. On a Mac (or without root), add it to your own ~/.ssh/rc. Setup details are at the top of the file.

9. Your own two-step check — ux2fa

A second factor you control: ux2fa.sh emails you a 6-digit code and only continues if it's typed back in (3 tries, 5 minutes). Someone with your password still can't get past it without your email.

  • Guard a risky command: ./ux2fa.sh sudo reboot or ./ux2fa.sh ./deploy.sh
  • Guard SSH logins (Linux / Mac): add this to /etc/ssh/sshd_config and restart sshd:
    Match User you
        ForceCommand /usr/local/bin/ux2fa.sh --ssh
        AllowTcpForwarding no
    Add trusted address prefixes after --ssh (e.g. --ssh 192.168.) to skip the code from home. Keep a second session open while you test, so a typo can't lock you out.
  • In your own scripts: ./ux2fa.sh && echo verified — exit code 0 means the right code was entered.

Try it without sending anything: USERALERTX_DRYRUN=1 ./ux2fa.sh echo hello prints the code instead of emailing it.

10. Game server alerts — gamecheck

Run your own Minecraft, Valheim, Terraria or Palworld server, or any other? Get a text when it crashes or stops answering, another when it's back up, and, if you like, when friends join: "Minecraft: 2 players joined - Steve, Alex". It's silent the rest of the time, so run it every minute. It waits for two failed checks in a row before saying DOWN, so a normal restart doesn't set it off.

  • Linux: gamecheck.sh — every minute with cron:
    * * * * * /home/you/gamecheck.sh -g minecraft -l /srv/minecraft/logs/latest.log
  • Windows: gamecheck.ps1 — every minute (one command in a Command Prompt, adjust the path):
    schtasks /create /sc minute /mo 1 /tn "UserAlertX gamecheck" /tr "powershell -NoProfile -ExecutionPolicy Bypass -File C:\UserAlertX\gamecheck.ps1 -Game valheim -Log C:\valheim\server.log"

Presets: minecraft (port 25565, plus who joined), valheim (the server program, plus who joined), terraria (port 7777), palworld (the server program). Any other game: give the server's process name (-p / -Process) or its TCP port (-t / -Port). Add -m 'Exception|crash' (-Match on Windows) to also get a text when a crash line shows up in the log. All options are at the top of the file.

11. Home Assistant — alerts from your smart home (no download)

Have Home Assistant text or email you when it matters: water on the basement floor, the freezer warming up, the garage door left open. It uses Home Assistant's built-in RESTful notifications — add a few lines to its configuration and you get a notify.useralertx action for any automation.

Setup steps and ready-to-paste automations

Planned integrations

  • Excel and Google Sheets — send an alert from a spreadsheet
  • iPhone Shortcut and Android (Tasker) — a home-screen "alert me" button
  • Zapier, IFTTT and Make — connect UserAlertX to thousands of apps without code

Want one of these sooner, or something else? Let us know.

A note on your API key

The saved key file (.useralertx_key in your home folder) lets anyone who can use your computer account send alerts as you. Don't put it on a shared computer. If it ever leaks, make a new key on your account screen — the old one stops working immediately.

← Home