Skip to content

Bug: multiple accounts don't work as described #181

@diwakergupta

Description

@diwakergupta

From the README: https://github.com/googleworkspace/cli?tab=readme-ov-file#multiple-accounts

gws auth login --account work@corp.com  # login and register an account
gws auth login --account personal@gmail.com

gws auth list  # list registered accounts
gws auth default work@corp.com. # set the default

gws --account personal@gmail.com drive files list  # one-off override
export GOOGLE_WORKSPACE_CLI_ACCOUNT=personal@gmail.com  # env var override

I'm logged into 2 accounts:

$ gws auth list
{
  "accounts": [
    {
     ...
    },
    {
      ...
    }
  ],
  "count": 2,
  "default": "..."
}

But running gws --account <non-default-acct> drive files list fails with:

{
  "error": {
    "code": 400,
    "message": "error: unrecognized subcommand '<non-default-email>'\n\nUsage: gws [OPTIONS] <COMMAND>\n\nFor more information, try '--help'.\n",
    "reason": "validationError"
  }
}

Not specific to drive, you can try with any subcomment. Even gws --account <something> fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions