Refine logout Command with --all-contexts Flag · Entire

We're working on https://github.com/entireio/cli/pull/1341 in this branch. Let's step through all the reviewer comments / nitpicks and consider what to do step by step.

What I did

What I left alone

Note

Summary of Changes in Commits

  1. Commit 9901fbf9e6 — logout: stop double-wrapping session revoke errors

    • revokeAllSessions wrapped ListSessions/RevokeSession failures with their own prefixes, but (*api.Client) already wraps both (incl. the session id), producing "list sessions: list sessions: …" / "revoke session X: revoke session X: …". Return the wrapped errors verbatim.
  2. Commit ddb0807af8 — logout: fix stale revokeCurrentFunc doc comment

    • The comment claimed the impl resolves its own data-API bearer; the caller now resolves the active context's core URL + token and binds them into the closure. Describe the actual contract.
  3. Commit 394066405e — add --all to drain every saved login (context)

    • entire logout --all iterates all saved contexts, revokes each context's current session server-side against its own core, removes each login locally, then clears the legacy keyring entry, so the machine ends fully logged out. Per-context failures warn but never abort the sweep; local removal always proceeds.
  4. Commit 51486c980a — end-to-end test pinning the --all/--everywhere matrix

    • Runs the real cobra logout command against two fake entire-core servers and asserts which revoke shape each context's core receives across all four quadrants:
      • logout → active context, current session
      • logout --everywhere → active context, all sessions
      • logout --all-contexts → every context, current session each
      • logout --all-contexts --everywhere → every context, all sessions each
    • This pins the command-layer mapping (--everywhere → revoke-all per core) that the runLogout/runLogoutAll unit tests can't reach, since they inject the revoke func directly.

Important Points

  # Data API: where GET /api/v1/me/activity and /me/commits are served
  export ENTIRE_API_BASE_URL=https://<your>.partial.to
  # Auth/login host: device-flow login + keyring token key + STS exchange origin
  export ENTIRE_AUTH_BASE_URL=https://<your>.partial.to