Expiring certificates, domains and keys
Get a card before something you own expires: the TLS certificate one of your hosts serves, a domain's registration, or an API key or token whose expiry date you know (a Figma token, a deploy key, a cloud access key). The card appears 30 days out as low, turns normal at 7 days and urgent at 1 day or once it has expired, and clears itself once you renew.
A small poller, needs-you-expiry, does this once a day from one machine. It needs no account and no token: certificates are read with a TLS handshake, domains through public RDAP over HTTPS.
Before you start #
- A sender machine that's on most days, such as a devbox: run an invite link's installer there first (Add a sender).
needs-you doctorshould show noFAIL. python33.9 or newer, and outbound HTTPS from that machine. GitHub CLI logged in, for step 1 (or a checkout of this repo).
Set up (4 commands) #
# 1. Install the poller (from GitHub with your gh login, or `install -m 755 integrations/expiry/needs-you-expiry ~/.local/bin/` from a checkout)
gh api -H 'Accept: application/vnd.github.raw' repos/tayharris/needs-you/contents/integrations/expiry/needs-you-expiry > ~/.local/bin/needs-you-expiry && chmod 755 ~/.local/bin/needs-you-expiry
# 2. List what to watch (this file is the opt-in: no file, no cards)
cat > ~/.config/needs-you/expiry.conf <<'EOF'
tls example.com
domain example.com
key "Figma PAT" 2026-12-31 renew=https://www.figma.com/settings
EOF
# 3. See what it would post, without posting anything
~/.local/bin/needs-you-expiry --dry-run -v
# 4. Run it every day
(crontab -l 2>/dev/null; echo '17 9 * * * $HOME/.local/bin/needs-you-expiry >/dev/null # needs-you-expiry') | crontab -Prefer a systemd user timer or, on a Mac, a LaunchAgent? Use the files in integrations/expiry instead of step 4.
Or let an agent set it up #
On your Mac, Settings → Integrations → Cards from your tools → Expiring certificates, domains and keys has the same commands with Copy buttons, and Copy agent prompt. Paste the prompt into Claude Code (or another agent) on the machine that will run the poller. The agent asks you what to watch and writes the list; a key line holds only a name and a date.
Set up needs-you cards for expiring certificates, domains and keys on this machine. The guide is https://github.com/tayharris/needs-you/blob/main/docs/guides/expiry.md.
This machine must already send needs-you alerts: if ~/.local/bin/needs-you is missing or ~/.local/bin/needs-you doctor shows a FAIL, stop and ask me for an invite link (Needs You on my Mac: Settings → Connect a machine).
Install the poller: `gh api -H 'Accept: application/vnd.github.raw' repos/tayharris/needs-you/contents/integrations/expiry/needs-you-expiry > ~/.local/bin/needs-you-expiry && chmod 755 ~/.local/bin/needs-you-expiry`.
Settings go in ~/.config/needs-you/env, which also holds this machine's needs-you token: only append lines to it (`echo 'NAME=value' >> ~/.config/needs-you/env`), never print, read out or rewrite it.
Ask me what to watch: hosts whose TLS certificate matters, domains I own, and keys or tokens with the date each stops working. Write them to ~/.config/needs-you/expiry.conf, one per line: `tls example.com`, `domain example.com`, `key "Figma PAT" 2026-12-31 renew=https://www.figma.com/settings`. A key line holds only the key's name and date, never the key itself.
Run `~/.local/bin/needs-you-expiry --dry-run -v` and tell me what it says.
Schedule it. On Linux add the cron line: `(crontab -l 2>/dev/null; echo '17 9 * * * $HOME/.local/bin/needs-you-expiry >/dev/null # needs-you-expiry') | crontab -`. On macOS use the LaunchAgent integrations/expiry/io.needs-you.expiry.plist from the repo instead (replace /Users/me with my home directory).
If a run prints an error, fix what it names, or tell me if it needs me.What to put in the list #
One thing per line:
tls example.comreads the certificate on port 443;tls mail.example.com:993on another port.domain example.comreads the registration's expiry from RDAP.key "Figma PAT" 2026-12-31is a date you know: the day it stops working. When you rotate the key, change the date.
Add renew=https://... to give the card a Renew button that opens the page where you renew it, and context=personal for your own things (the default is NEEDS_YOU_EXPIRY_CONTEXT, else NEEDS_YOU_DEFAULT_CONTEXT, else work). For an internal host whose certificate comes from a private CA, add verify=no.
Check it works #
Step 3 prints every date it read (-v) and the cards it would post: anything within 30 days. Put a key "Test key" <a date 5 days from now> line in, run needs-you-expiry once, and a normal "Test key expires ..." card appears on your Mac. Take the line out, run it again, and the card clears.
Tune it #
Settings go in ~/.config/needs-you/env:
NEEDS_YOU_EXPIRY_DAYS=60=low,14=normal,3=urgent # when cards appear and how loud
NEEDS_YOU_EXPIRY_CONTEXT=personal # the default contextThe full list of cards, keys and settings is in integrations/expiry/README.md.
When it doesn't post #
- Run
needs-you-expiry -v. It prints each date and each failing check. It always exits 0, so cron won't tell you. - A host or RDAP lookup that keeps failing: after 2 failed runs in a row, one low card, "Expiry checks failing on devbox", lists what failed and why. It clears on the next run where everything works.
- See troubleshooting for the common errors.
This page is docs/guides/expiry.md in the repo. View or edit it on GitHub.