← Work

006 · 2026

EsSalud appointments, from the terminal

Booking a medical appointment on Peru's EsSalud portal is slow and fragile. I built a CLI that runs the whole flow — profile, slots, reserve, cancel — in seconds, with a login where your token and data never leave your machine.

Role
Design engineer · solo build
Status
Published to npm · source-available
TypeScriptNodePlaywrightcommander@clack/promptsCLI
Capture coming

Decision

Privacy-first, no official API

There's no public EsSalud API, so login opens an ephemeral Playwright browser, catches the auth token off the network, and stores it locally with chmod 600 — nothing is ever sent anywhere else. Booking and cancelling are dry-run by default and need an explicit confirm before anything real happens.

How it's built

One binary, two ways in

Run it with no arguments for an interactive @clack/prompts menu, or pass subcommands via commander for one-shot use. The reverse-engineered API is wrapped so its quirky response envelope and empty-data cases normalize cleanly, and a self-cleaning end-to-end test books then cancels inside a finally block so it never leaves a real appointment behind.