Picture of Michael Lee
:wave: Hey hey, I'm Michael Lee and this is my site about being a developer, being a dad and making side projects.
Sponsorship

Supporting multiple Heroku accounts from the CLI

Written on August 28, 2018

Working in Ruby on Rails applications, the apps get deployed to Heroku for hosting. Heroku provides an elegant experience where you can deploy sites and interact with your Heroku account via the command line using their CLI.

When working with clients for software projects, our clients would set up a Heroku account. This allows for the cost of hosting to be passed through to the client, and we’re given access to manage their application’s hosting.

The issue with this is, by default Heroku’s CLI can only support a single login at one time. This makes managing multiple Heroku apps a little annoying. Since you’ll have to log out and log back into various accounts and keep track of login credentials.

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. Which is nice so you can have your personal account alongside client accounts all available without logging in and out from the CLI.

Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design and side projects. Sign up and I'll send you my articles straight to your email.