Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Toolbelt switch between multiple account

I would like to know what's the best way to switch between heroku account using the heroku toolbelt.

I'm used to have a personnal heroku account which is a collaborator of all of my professionnal heroku app. The problem is when I want to make some changes that have a financial impact : adding / removing addon for example, I cannot do it as a collaborator.
Before heroku toolbelt I was used to change the content of the file ~/.heroku/credentials but it does not exists anymore with the toolbelt.

like image 503
Adrien Coquio Avatar asked Oct 30 '12 13:10

Adrien Coquio


People also ask

How do I log into a different heroku account in terminal?

How can I login using a different account, after the "heroku login" command? You have to create a new profile in your browser, log in to heroku.com and save the password, make sure the browser you're using is your default browser, make sure it's the only open browser window, and run heroku login .

Can I have multiple heroku accounts?

It turns out, the Heroku CLI has a plugin for managing multiple accounts. With this plugin installed, you can manage all your accounts and then easily swap accounts as they are needed.

How do I logout of heroku terminal?

Hit the command "Heroku Logout" from you cli terminal.

What is heroku toolbelt?

The Heroku Toolbelt is a package of the Heroku CLI, Foreman, and Git — all the tools you need to get started using Heroku at the command line. The Toolbelt is available as a native installer for OS X, Windows, and Debian/Ubuntu Linux. The Toolbelt has been available since last fall as part of our polyglot platform.


3 Answers

Have you tried the heroku accounts plugin?

like image 190
sylv3rblade Avatar answered Oct 16 '22 20:10

sylv3rblade


In 2017, Heroku released heroku-accounts, an add-on to the toolbelt that lets one quickly switch accounts from the command line. Install it like this:

heroku plugins:install heroku-accounts

Then add an account ("work" in this case):

heroku accounts:add work

At this point, you'll need to provide the credentials you want associated with the "work" alias. Do the same for other accounts you have. Then switch between aliases like this:

heroku accounts:set work

(Sorry to zombie this question.)

like image 25
IAmNaN Avatar answered Oct 16 '22 20:10

IAmNaN


You can just run the login again from the command line:

heroku login

Enter your new email and password for the other account.

like image 11
psyrendust Avatar answered Oct 16 '22 19:10

psyrendust