Send SMS notifications via nudge.sh when tasks complete. Activate when the user says 'nudge me', 'nudge me when done', 'ping me when done', 'text me when finished', 'notify me when done', 'let me know when done', 'send me a nudge', or any variation requesting notification after a task completes.
nudge.sh sends you an SMS text message when a task finishes. The user has a personal token. After completing their task, call a simple HTTP endpoint to trigger the notification.
Before sending a nudge, locate the user's token:
NUDGE_TOKEN environment variable..env file in the project root for a NUDGE_TOKEN= entry."I need your nudge.sh token to send you a notification. Set
NUDGE_TOKENin your environment or add it to your.envfile. Sign up at https://nudge.sh to get one."
The token format is ndg_ followed by 24 alphanumeric characters (e.g., ndg_a8f3xk2pq9m1b7c5d3e2j4).
Never display the full token in your output. If you need to reference it, show only the prefix (e.g., ).
<!-- Simple nudge with a message --> <!-- Nudge with output and exit code -->ndg_a8f3...Use the header-based endpoint to avoid leaking the token in URLs or logs.
curl -s -X POST https://nudge.sh/nudge \
-H "X-Nudge-Token: $NUDGE_TOKEN" \
-d "message=Task completed successfully"
curl -s -X POST https://nudge.sh/nudge \
-H "X-Nudge-Token: $NUDGE_TOKEN" \
-d "exit_code=0" \
-d "message=Tests passed" \
--data-urlencode "output=$OUTPUT"
Expected response:
{"ok": true, "slug": "ab12cd", "credits_remaining": 45}
message summarizing the outcome (e.g., "Tests passed", "Deploy failed with 3 errors", "Migration completed").exit_code of the last command when applicable.output field.| Status | Meaning | What to tell the user |
|---|---|---|
| 402 | No credits remaining | "You're out of nudge credits. Visit https://nudge.sh/dashboard/billing to get more." |
| 404 | Invalid or revoked token | "Your nudge token appears to be invalid. Check your token at https://nudge.sh/dashboard/tokens." |
| 429 | Rate limited | "Nudge rate limit hit. Try again in a moment." |
If the nudge fails, inform the user but do not retry automatically. The primary task is already done — the nudge is supplementary.