Skip to content

Multi-token / multi-account handling in the CLI #1297

Description

@DaveHanns

Problem

The CLI holds a single API token at a time (one account), stored in auth.json and the OS keyring. Switching accounts or organizations means running apify logout then apify login again; there is no way to keep multiple tokens registered or switch between them.

Goal

Let the CLI store multiple accounts under named profiles and switch the active one without re-authenticating. Commands run against the selected account.

Open questions

  • Profile model, and how the active profile is selected (default profile?).
  • Selection surface: a per-command --account flag, an apify auth use <name> command, an env var, or a mix.
  • Storage: extend auth.json and the keyring to hold multiple entries.
  • Backward compatibility with existing apify login and logout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.t-buildersIssues owned by the Builders team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions