Add sc whoami #25

Merged
geusebio merged 2 commits from feature/whoami into main 2026-08-14 19:06:57 +00:00
Owner

Part of #578 — the terminal half of the same question the tray's new identity row answers.

sc login says a token was stored and nothing afterwards says whose. Fine with one endpoint and one machine; confusing with more, since tokens are stored per endpoint, named per device, and a stale $SC_TOKEN silently outranks a fresh sc login.

$ sc whoami
Alice A <alice@example.test>
token:    sc @ laptop (from $SC_TOKEN)
endpoint: https://someones.computer

Where the token was read from is half the answer to "why am I this user?", which is the surprising case this exists for.

Needs scclient #3, pinned and vendored here. go build, go vet, go test ./... clean; tests cover the full output, a platform that named no token, a missing token, a platform too old for the route, and the source mapping.

Part of [#578](https://git.grey.ooo/Grey.ooo/Someones.Computer/issues/578) — the terminal half of the same question the tray's new identity row answers. `sc login` says a token was stored and nothing afterwards says whose. Fine with one endpoint and one machine; confusing with more, since tokens are stored per endpoint, named per device, and a stale `$SC_TOKEN` silently outranks a fresh `sc login`. ``` $ sc whoami Alice A <alice@example.test> token: sc @ laptop (from $SC_TOKEN) endpoint: https://someones.computer ``` Where the token was read from is half the answer to "why am I this user?", which is the surprising case this exists for. Needs [scclient #3](https://git.grey.ooo/Grey.ooo/someones.computer_scclient/pulls/3), pinned and vendored here. `go build`, `go vet`, `go test ./...` clean; tests cover the full output, a platform that named no token, a missing token, a platform too old for the route, and the source mapping.
Add sc whoami
Some checks failed
CI / build (pull_request) Has been cancelled
81e5ff14ca
`sc login` says a token was stored and nothing afterwards says whose. That is
fine with one endpoint and one machine, and confusing with more: tokens are
stored per endpoint, named per device, and a stale $SC_TOKEN silently outranks
a fresh `sc login`.

whoami prints the account, the token's own label, where the token was read
from, and the endpoint — the four things that answer "why am I this user?".
Pin scclient to the merged identity read
All checks were successful
CI / build (pull_request) Successful in 8m29s
6cb4e5f0d2
geusebio changed title from WIP: Add sc whoami to Add sc whoami 2026-08-14 19:06:41 +00:00
geusebio referenced this pull request from a commit 2026-08-14 19:06:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grey.ooo/someones.computer_agent!25
No description provided.