Skip to content

Add multi-account switching support - #145

Merged
neuromechanist merged 2 commits into
devfrom
feature/account-switching
Feb 14, 2026
Merged

neuromechanist merged 2 commits into
devfrom
feature/account-switching

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Extend config to store multiple accounts keyed by username with an active account pointer
  • Add nemar auth switch [username] command (accepts NEMAR or GitHub username, interactive picker when no arg given)
  • Switching also triggers gh auth switch --user <github> to keep GitHub CLI in sync
  • Login now adds accounts without overwriting existing ones
  • Logout removes only the active account (switches to next available); --all flag clears everything
  • Status/whoami shows other stored accounts if any
  • Backward compatible: existing flat config auto-migrates on startup
  • Root-level nemar switch shortcut added

Test plan

  • Build passes
  • nemar auth switch with single account shows helpful message
  • nemar whoami shows active account info
  • Legacy config auto-migrated to multi-account structure
  • Login with second account, verify both stored
  • Switch between accounts via interactive picker
  • Switch by NEMAR username and by GitHub username
  • Verify gh auth switch triggered on account switch
  • Logout removes active, switches to remaining
  • Logout --all clears everything

Extend config to store multiple accounts keyed by username with an
active account pointer. Login adds accounts without overwriting
existing ones. Switch accepts NEMAR or GitHub username and also
triggers gh auth switch. Logout removes only the active account
unless --all is passed. Backward compatible with existing configs
via auto-migration on startup.
@github-actions

github-actions Bot commented Feb 14, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR145

Version: 0.5.1-PR145.91d66c2
Commit: 91d66c2


🤖 Updated on each push.

- Make config migration atomic via config.store assignment with
  try/catch fallback to preserve legacy format on failure
- Remove unused removeAccount export
- Revert clearConfig return type to void (no caller uses it)

This branch was previously deployed

1 inactive deployment
npm — 91d66c27 Deployed Feb 14, 2026 by neuromechanist via publish #258
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.

1 participant