Skip to content

KZN-19166 - support multiple sessions using different credentials - #39

Merged
keegandonley merged 3 commits into
mainfrom
feature/KZN-19166-merge-CLI-implementations-multi-session
Oct 26, 2026
Merged

keegandonley merged 3 commits into
mainfrom
feature/KZN-19166-merge-CLI-implementations-multi-session

Conversation

@keegandonley

Copy link
Copy Markdown
Member

Adds support for using credentials in sessions explicitly, so that claude (for example) can have multiple sessions pointing at different accounts or environments.

Jira: https://kizen.atlassian.net/browse/KZN-19166

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Logout can be undone by a late refresh, and printed retry commands can lose the selected account.

2 open issues
What changed in this PR

Adds per-command account selection to the CLI so concurrent sessions can use different saved credentials without changing the current account.

Changes:

  • Adds business/user flags and environment-variable selectors to account-aware commands.
  • Keeps running commands and bound authentication helpers pinned to their selected account across account switches.
  • Updates command help, documentation, and regression tests.

The .copilot-docs/ directory is absent, indicating the documentation setup workflow did not run; plugin-contract verification was unavailable.

File Description
src/​program.test.ts Verifies new flags and admin argument forwarding.
src/​lib/​pushHeadless.ts Resolves named accounts for push and targets.
src/​lib/​pushHeadless.test.ts Tests account selection and credential isolation.
src/​lib/​oauthSession.ts Pins token reads to individual account files.
src/​lib/​oauthSession.test.ts Tests pinning, refreshes, switches, and logout.
src/​lib/​oauthCommands.ts Adds account-aware resolution and bound token access.
src/​lib/​oauthCommands.test.ts Tests named accounts and authentication helpers.
src/​lib/​kizenAdmin.ts Binds admin invocations to selected accounts.
src/​lib/​kizenAdmin.test.ts Tests admin selectors and account binding.
src/​lib/​authSelection.ts Defines selector precedence and validation.
src/​lib/​authSelection.test.ts Tests flag and environment-variable precedence.
src/​commands/​block.ts Exposes account selectors for block commands.
src/​commands/​auth.ts Updates whoami options and auth-header help.
src/​commands/​admin.ts Documents admin account-selection options.
README.md Explains independent sessions and credential selection.

Review effort: Balanced

Comment thread src/lib/oauthSession.ts Resolved
Comment thread src/lib/pushHeadless.ts Resolved

@mauricebecnel400 mauricebecnel400 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Account-bound authentication and cross-process locking need human validation, and unavailable contract documentation limits compatibility verification.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@mauricebecnel400 mauricebecnel400 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keegandonley
keegandonley merged commit acc599a into main Oct 26, 2026
5 checks 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.

3 participants