Skip to content

Add multi-account support#1

Merged
GrigoriLab merged 1 commit into
mainfrom
feature/multi-account-support
Feb 5, 2026
Merged

Add multi-account support#1
GrigoriLab merged 1 commit into
mainfrom
feature/multi-account-support

Conversation

@GrigoriLab

Copy link
Copy Markdown
Contributor

Summary

  • Adds support for multiple named LinkedIn accounts with --account <name> global flag
  • New account command with list, add, remove, default, migrate, and whoami subcommands
  • Backward compatible: existing single-account configs continue to work unchanged
  • Zero changes to existing 16 command files — account selection flows transparently through resolveCredentials()

Changes

  • src/lib/types.ts: Added AccountConfig interface; extended LinkedConfig with accounts? and defaultAccount?; added account? to AuthOptions
  • src/lib/account-context.ts (new): Module-level get/set for active account name
  • src/lib/config.ts: Added getAccountCredentials, listAccounts, setAccount, removeAccount, setDefaultAccount, migrateLegacyCredentials
  • src/lib/auth.ts: Updated credential resolution priority to be account-aware (explicit cookies > env vars > named account > legacy flat config > browser extraction)
  • src/commands/account.ts (new): Full account management subcommands with input validation
  • src/cli.ts: Added global -a, --account <name> option with preAction hook to set context
  • src/index.ts: Exported new functions and AccountConfig type

Test plan

  • pnpm build — TypeScript compiles clean
  • pnpm test — All 198 tests pass (27 new tests for account functionality)
  • pnpm lint — No lint errors in changed files
  • Unit tests for account-context get/set/reset
  • Unit tests for config CRUD (listAccounts, setAccount, removeAccount, setDefaultAccount, migrateLegacyCredentials)
  • Unit tests for account-aware auth resolution (named accounts, default accounts, env var priority, error messages)

🤖 Generated with Claude Code

Enables users to configure and switch between named LinkedIn accounts
via --account flag or a configured default, with full backward
compatibility for existing single-account configurations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GrigoriLab GrigoriLab merged commit 6fc7248 into main Feb 5, 2026
2 checks passed
@GrigoriLab GrigoriLab deleted the feature/multi-account-support branch February 5, 2026 22:15
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