Skip to content

feat: add 'auth status' subcommand#18

Merged
DTTerastar merged 1 commit into
mainfrom
feat/auth-status
Apr 25, 2026
Merged

feat: add 'auth status' subcommand#18
DTTerastar merged 1 commit into
mainfrom
feat/auth-status

Conversation

@DTTerastar
Copy link
Copy Markdown
Collaborator

Summary

Per CONTRACT §5, every quantcli CLI exposes `auth status` printing a one-line readiness summary, exit 0 if usable.

```
$ liftoff-export auth status
logged in (token expires 2026-04-25T20:37:21-04:00)
$ echo $?
0
```

Three states:

Condition stdout/stderr exit
Token saved, unexpired `logged in (token expires …)` 0
No saved token `not logged in — run: liftoff-export auth login` 1
Saved token, expired `token expired … — run: liftoff-export auth refresh` 1

Local check only — no network call, no refresh attempted. Adds an exported `auth.Load()` (thin wrapper over the existing private `load()`) so `cmd/` can read the token store without going through `GetToken`'s auto-refresh path.

Test plan

  • `go build ./...`, `go vet ./...` pass
  • Logged-in state returns exit 0 with expiry
  • Reviewer: verify unhappy paths if you have time — easiest is `mv ~/.config/liftoff-export/auth.json{,.bak}` then run `auth status` (don't forget to mv back)

🤖 Generated with Claude Code

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

  liftoff-export auth status
  → "logged in (token expires 2026-04-25T20:37:21-04:00)" / exit 0
  → "not logged in — run: liftoff-export auth login" / exit 1
  → "token expired YYYY-MM-DDTHH:MM:SS-04:00 — run: ... auth refresh" / exit 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.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DTTerastar DTTerastar merged commit e05ff32 into main Apr 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant