Switching Heroku Accounts

Update April 2011: I now use the Heroku Plus gem to manage these accounts.

I have several Heroku accounts that I need to switch between for clients. I’ve been doing it by hand for a while, and then I remembered that I could just write a bash script to make a command for my forgetful brain.

The basic steps are:

  • >heroku keys:clear
  • >rm ~/.heroku/credentials
  • >heroku list

So, my little bash script is:

#!/bin/bash
 
heroku keys:clear && rm ~/.heroku/credentials && heroku list

do a quick
>chmod 775 switch_heroku

and now I can switch with that simple command.
This is on OS X. Probably very similar on Linux. No idea on windows.

Leave a Reply

Your email address will not be published. Required fields are marked *