Repository navigation
[eas-cli] Add multi-account support - #3340
brentvatne wants to merge 8 commits into
Conversation
|
Size Change: +10.6 kB (+0.02%) Total Size: 53.2 MB
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3340 +/- ##
==========================================
- Coverage 64.29% 64.03% -0.25%
==========================================
Files 1047 1049 +2
Lines 48332 48728 +396
Branches 10194 10296 +102
==========================================
+ Hits 31068 31200 +132
- Misses 17148 17412 +264
Partials 116 116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@brentvatne This would be a really nice addition. Are there any plans to merge this PR? |
Add experimental multi-account support behind EAS_EXPERIMENTAL_ACCOUNT_SWITCHER=1 flag. SessionManager changes: - Add v1 schema with accounts object and activeAccountId - Support storing multiple account sessions - Add switchAccountAsync/switchAccountByUsernameAsync methods - Add getAllAccounts, removeAccountAsync, removeAllAccountsAsync - Maintain backward compatibility with Expo CLI via legacy fields - Read credentials from active account when multi-account enabled
New commands for multi-account support (hidden when feature flag disabled): - account:list: Show all logged-in accounts with active indicator - account:switch: Switch between accounts interactively or by username
- login: Add menu to add account or switch when already logged in - logout: Add username arg and --all flag for selective logout - view: Show other logged-in accounts when multi-account enabled
Allow specifying which account to use for any command via --account flag when multi-account is enabled. Switches to the specified account before executing the command.
a268fae to
2d694aa
Compare
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
- Make --account per-command: use an in-memory session override instead of persistently switching the active account - Skip --account interception for commands that define their own account flag (project:init, chat, billing:manage, billing:subscribe) - Support --account=value, reject flag-shaped values, stop at the -- terminator - Error when --account is combined with EXPO_TOKEN - Invalidate session secrets on the server in all multi-account logout paths - Preserve unrelated top-level keys in ~/.expo/state.json on account writes - Keep the v1 accounts map in sync when logging in or out with the flag off, so toggling the flag cannot resurrect a stale identity or drop accounts - Guard v0->v1 migration against a legacy session with no userId - Pass the browser flag through the add-account flows; error when logout username/--all are used without the feature flag
|
✅ Thank you for adding the changelog entry! |
|
@brentvatne if we still need this, let's rebase against current main and I'll go through it carefully. |
|
it'd be nice to have but i think it will take a lot more work to make it actually mergeable, not a priority for me right now |
|
eas-cli now uses changesets for changelogs (#4580). The required "Check for a changeset" check fails on PRs that edit To update this PR:
The release adds the PR link and the author to the entry. If this PR needs no changelog entry, revert the |
Summary
account:listcommand to show all logged-in accountsaccount:switchcommand to change the active accountaccount:loginto support adding additional accountsaccount:logoutto support logging out specific accounts or all accounts--accountflag for per-command account selectionMotivation
I've wanted this for a while since I personally switch between Expo accounts fairly often. I've also heard from other folks who switch between company and personal accounts, or accounts across different projects that their agency manages, that this would be helpful.
Test plan
Set
EAS_EXPERIMENTAL_ACCOUNT_SWITCHER=1in your env, or prefix all of the commands you run with it.eas account:login- login to a new account (adds to existing sessions)eas account:list- shows all logged-in accounts with active indicatoreas account:switch- switch between accounts interactively or by nameeas account:logout- logout current, specific, or all accountseas account:view- shows current active accounteas <any-command> --account <name>- uses specified account for that command only (works with any command)