Guides

Recipes for the places bonk is most useful. Replace b_YOUR_SECRET with the secret from the app, and keep it in an environment variable rather than in code.

When a long command finishes

make build; curl -d "build exited with $?" https://trybonk.com/to/b_YOUR_SECRET

Add it to your shell so any command can bonk you:

# ~/.zshrc or ~/.bashrc
bonk() { "$@"; local s=$?; curl -s -d "$1 exited with $s" "https://trybonk.com/to/$BONK_SECRET" >/dev/null; return $s; }

Then bonk ./train.py runs it and bonks you when it ends.

GitHub Actions

Add your secret under Settings → Secrets and variables → Actions as BONK_SECRET, then add a last step:

- name: Bonk
  if: always()
  run: |
    curl -s "https://trybonk.com/to/${{ secrets.BONK_SECRET }}" \
      -H "Content-Type: application/json" \
      -d '{"title":"${{ github.repository }}","body":"${{ github.workflow }}: ${{ job.status }}","url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'

Tapping the bonk opens the run.

Cron

0 3 * * * /usr/local/bin/backup.sh && curl -s -d "backup done" https://trybonk.com/to/$BONK_SECRET || curl -s -d "backup FAILED" "https://trybonk.com/to/$BONK_SECRET?urgent=1"

Failures go out urgent, so they get through Focus.

AI agents

Tell your coding agent to bonk you when it needs you or finishes. For Claude Code, add a hook to ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [{ "hooks": [{ "type": "command", "command": "curl -s -d 'Claude is done' https://trybonk.com/to/$BONK_SECRET" }] }],
    "Notification": [{ "hooks": [{ "type": "command", "command": "curl -s -d 'Claude needs you' https://trybonk.com/to/$BONK_SECRET" }] }]
  }
}

Other agents can read the full API at https://trybonk.com/llms.txt.

JavaScript

await fetch(`https://trybonk.com/to/${process.env.BONK_SECRET}`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ title: "Backup", body: "Nightly backup done" }),
});

Python

import os, urllib.request

urllib.request.urlopen(f"https://trybonk.com/to/{os.environ['BONK_SECRET']}", data=b"Nightly backup done")

Go

http.Post("https://trybonk.com/to/"+os.Getenv("BONK_SECRET"), "text/plain", strings.NewReader("Nightly backup done"))