feat: add 'auth status' subcommand - #9
Merged
Merged
Conversation
Per quantcli shared contract §5, every CLI exposes 'auth status' printing a one-line readiness summary, exit 0 if usable. https://github.com/quantcli/common/blob/main/CONTRACT.md#5-auth withings-export auth status → "logged in as user 1234567 (token expires 2026-04-25T20:24:22-04:00)" / 0 → "not logged in — run: withings-export auth login" / 1 → "token expired YYYY-... — run: ... auth refresh" / 1 Local check only — no network call, no refresh attempted. Adds an exported auth.Load() so cmd/ can read the token store without going through GetToken's auto-refresh path. Includes the Withings user_id (numeric account identifier) in the readout for parity with what the auth subcommand actually knows about; we don't store the email. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per CONTRACT §5, every quantcli CLI exposes `auth status` printing a one-line readiness summary, exit 0 if usable.
```
$ withings-export auth status
logged in as user 1629692 (token expires 2026-04-25T20:24:22-04:00)
$ echo $?
0
```
Three states:
Local check only — no network call. Adds exported `auth.Load()` so `cmd/` can read the token store without going through `GetToken`'s auto-refresh path. Reports the Withings numeric user ID (`UserID` is what the OAuth flow actually persists; we don't store the email).
Test plan
🤖 Generated with Claude Code