Skip to main content

crewship session

Manage the caller’s active browser sessions — the same surface the Settings → Sessions web panel exposes. Two use cases drive this:
  1. Audit who’s logged insession list shows device, IP, and last-seen for every active session. Pipe through jq for compliance reports without opening a browser.
  2. Force logoutsession revoke kills one session by id. Combined with whoami and token revoke it gives an admin everything needed to neutralise a leaked credential.
Defined in cmd/crewship/cmd_session.go. Sessions are user-scoped, not workspace-scoped — the CLI client clears the workspace_id query param on both endpoints so the request lands clean.
Every subcommand requires crewship login. No workspace context required.

Subcommands

Flags

Beyond these, use the global --format json / --format yaml for scripting.

Examples

List

The STATUS column is one of current (the session backing the token you’re using right now), active (used within --warn-stale-days), or stale (older than the threshold). When any stale sessions are found, a table-mode footer suggests revoking them; the hint is suppressed in JSON output.
STATUS = current flags the session that owns the token you’re using right now — revoking that row logs you out. Re-run crewship login to continue.

Audit dump for compliance

Revoke another session

Revoke your own session

Self-revocation is allowed by design — the server returns is_current=true and the CLI prints a yellow note so a careless script can warn the human before it locks itself out.

Security notes

  • Foreign session ids (sessions belonging to other users) return 404 with the same shape as “does not exist”, so the endpoint can’t be used to enumerate other users’ sessions by id.
  • Revoking a session does not invalidate any CLI tokens that user holds. CLI tokens have their own lifecycle — manage them under Settings → CLI tokens or via crewship token revoke.

Common errors

  • 404 Not Found — the session id doesn’t exist or it belongs to another user. Indistinguishable on purpose.
  • 401 unauthorized — your current session was revoked. Run crewship login.

See also