Skip to content

feat: multi-account profile support per provider#13218

Open
darwich6 wants to merge 9 commits intoanomalyco:devfrom
darwich6:feat/multiprofiles
Open

feat: multi-account profile support per provider#13218
darwich6 wants to merge 9 commits intoanomalyco:devfrom
darwich6:feat/multiprofiles

Conversation

@darwich6
Copy link

What does this PR do?

Closes #13038

Adds multi-account profile support so users can manage multiple credentials per provider (e.g. work and personal OpenRouter accounts) without manually editing auth.json.

Please provide a description of the issue (if there is one), the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

Currently, users must manually edit auth.json to switch between accounts on providers. This is not a good UX for users who have work/personal accounts. To fix, I adjusted auth.json to store credentials in a profile-based manner.

//before
{
  "openrouter": { "type": "api", "key": "..." }
}

//after
{
  "openrouter": {
    "profiles": {
      "personal": { "type": "api", "key": "..." },
      "work": { "type": "api", "key": "..." }
    },
    "currentProfile": "personal"
  }
}

Added CLI Commands:

  • auth profile create
  • auth profile use
  • auth profile list [provider]
  • auth profile remove
  • auth profile rename

Modified CLI Commands:

  • auth login --profile
  • auth logut --profile
  • auth list --profiles
  • run --profile

Also reworked profileID to flow through end to end and added active profile to show in prompt bar of TUI, as well as a dialog option to switch profile. This PR is backwards compatible as auth.json is rewritten when the user runs his first profile command.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

  • Tested locally with multiple OpenRouter API Keys across all CLI commands.
  • Tested migration from old auth format by manually writing legacy format and running profile command to verfiy auto-upgrade
  • bun typecheck passes clean

UI Changes SC attached below
image
image
image
image
image
image

This is a fairly large PR, happy to rework and make changes. Thanks for the opportunity!

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

However, PR #10587 seems to focus on the UI dialog aspect for account management, while PR #13218 implements the underlying profile infrastructure (auth.json restructuring, CLI commands, and profile switching logic). They may be complementary rather than duplicate efforts, but worth reviewing to ensure no conflicting implementations.

No other clear duplicate PRs were found. The searches returned mostly PR #13218 itself and unrelated authentication PRs.

@xitex
Copy link

xitex commented Feb 12, 2026

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.

[FEATURE]: Add support for provider selection

2 participants

Comments