Description
What to build
A user who logs in once stays logged in for as long as they keep using the CLI, including when the only thing running is the scheduled watch timer. Wallapop's session route re-issues the session cookie with a fresh 30-day expiry on every mint (verified 2026-09-14: expiry moved from 14 Oct 10:32 to 14 Oct 21:09 after one mint), and the CLI already persists the rotated cookie. The gap is that search, item and seller Watches are public, so a scheduled watch check never mints and the Session silently expires after 30 days.
Two behaviours:
watch checktouches the active Profile's Session once per run when one exists (mint, persist rotation), sowatch servicekeeps the login alive as a side effect. A failed keepalive is reported on stderr with exit 3 only if the run needed auth; otherwise it is a warning, since the Watches themselves still work.auth refreshmints once and reports the new cookie expiry, for people who schedule with cron instead of the service.
Acceptance criteria
-
watch checkwith only public Watches and a valid Session performs exactly one mint and persists the rotated cookie; with no Session it performs none -
auth refreshprints the profile, account and new session expiry (from the Set-CookieExpires), in every output format; exit 3 when the Session is rejected -
auth statusshows the stored cookie's expiry, so a user can see how long they have - The interface contract and the embedded skills doc explain the sliding window and that running any authenticated command every 30 days keeps the login alive
- Tests through the fake server assert the mint count for both cases
Further notes
Unknown: whether Wallapop's Keycloak realm caps the SSO session absolutely (the session survived past Keycloak's 10-hour default, and the realm advertises offline_access). Only observation over weeks will tell; a daily auth refresh in a scheduler on one machine is enough to find out. If a cap exists, the fix is a re-login, not anything this ticket can do.
Blocked by
- None (can start immediately)
Activity
auth: keep the session alive from watch check, add auth refresh