Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLATFORMSH_CLI_TOKEN per project #907

Open
gormus opened this issue Mar 3, 2020 · 1 comment
Open

PLATFORMSH_CLI_TOKEN per project #907

gormus opened this issue Mar 3, 2020 · 1 comment

Comments

@gormus
Copy link

gormus commented Mar 3, 2020

I'm managing projects from multiple Platform.sh accounts. Each time I need to switch to projects from another account, I have to logout from the CLI, and log back again with the account I need for that project.

One potential solution I can think of using the CLI tokens per project to authenticate them, without really logging out.

Could PLATFORMSH_CLI_TOKEN be defined per project and used for such scenario? Or is there already a working solution for such issue?

Thanks,
Osman

@pjcdawkins
Copy link
Collaborator

That's an interesting use case.

If you're logged in without tokens, there is something else you can use, which is the PLATFORMSH_CLI_SESSION_ID variable. This namespaces your login session. The default value is default, but you could use this one-liner inside any Git repository to set it to that repository's path:

export PLATFORMSH_CLI_SESSION_ID="$(git rev-parse --show-toplevel)"

Each time you wanted to switch between sessions, you would cd path/to/repo and then run the above command. You can then log in normally, and it'll keep your session for next time. Does that help?

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

No branches or pull requests

2 participants