Skip to content

feat(cli): show local OAuth session expiry - #66

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-64-cli-session-expiry
Nov 30, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-64-cli-session-expiry

Conversation

@johnnyhuy

Copy link
Copy Markdown
Contributor

Add hoist harness sessions and hoist harness sessions --json to report local Claude Code and Codex sign-in state, account and known expiry times. Both use the desktop session readers, including the one-hour expiry warning and the expired refresh-token rule.

Closes #64

Verification

mise run ci:cli passed type checking and all 56 tests, then compiled the Linux x64 binary. The change is confined to the CLI.

Fixture transcript

I compiled a native macOS arm64 binary with mise exec -- bun build cli/src/index.ts --compile --outfile="$proof_dir/hoist" and ran HOIST_TEST_CLI_BINARY="$proof_dir/hoist" mise exec -- bun test cli/test/harness-sessions.test.ts. All six cases passed. Each used a temporary home and isolated PATH. The tests covered active, expiring, expired, expired refresh token, unknown expiry, missing files and malformed files. They checked both output formats for fixture token leakage.

$ hoist harness sessions --json
[
  {
    "harnessId": "claude-code",
    "signedIn": true,
    "status": "active",
    "expiresAt": "2099-01-01T00:00:00.000Z",
    "refreshTokenExpiresAt": "2099-01-02T00:00:00.000Z",
    "source": "file",
    "checkedAt": "2026-11-30T15:34:33.605Z",
    "account": "dev@example.test"
  },
  {
    "harnessId": "codex",
    "signedIn": true,
    "status": "expiring",
    "account": "fixture-account",
    "expiresAt": "2026-11-30T16:04:32.000Z",
    "source": "auth.json",
    "checkedAt": "2026-11-30T15:34:33.607Z"
  }
]
$ hoist harness sessions
claude-code  signed in
  Session status    active
  Account           dev@example.test
  Token expiry      2099-01-01T00:00:00.000Z
  Refresh expiry    2099-01-02T00:00:00.000Z
codex  signed in
  Session status    expiring
  Account           fixture-account
  Token expiry      2026-11-30T16:04:32.000Z

The transcript uses synthetic accounts. Live macOS Keychain access was outside this fixture run. The command reads local metadata offline and does not refresh tokens.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy merged commit 102a21a into main Nov 30, 2026
7 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-64-cli-session-expiry branch November 30, 2026 15:44
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.

CLI: show local Claude Code and Codex OAuth session expiry

1 participant