2. Getting started with The Heroku CLI
Ivad Yves HABIMANA
Posted on July 10, 2022
Hi!
welcome back to the learn Heroku series, I know it's been a long time since I posted anything but fortunately we are back with another episode, today we will focus on getting started with the Heroku CLI (command line interface) so that we can do cool stuff directly from our terminal/command line. By the way if you need a refresher about what Heroku is or why you should learn it. check the first article in the series HERE.
In this episode I will be quoting the Heroku official documentation about The CLI so for more information you can check it out HERE
Let's start...
The Heroku CLI
Heroku command line interface or CLI for short is a program that will allow you to create and manage Heroku apps directly from your terminal. The Heroku docs mention that the CLI is an essential part of using Heroku and that's true because with Heroku CLI you can create and deploy your applications without leaving your VS code/terminal.
Heroku also has a Graphical user interface(GUI) on their website with dashboards and everything and almost anything you can do from your dashboard you can do in the CLI but as a developer learning the CLI will save a lot of time and it's kinda cool😉 so let's get to it
Installations
Heroku CLI is an actual program that you need to download and install on your machine as you install any other program and they have many ways to install it for whatever operating system you may be using.
You can find the installer for your specific OS HERE
Note: Heroku highly depends on the Git version control so you also need to have Git on your machine. I assume you already have Git installed if not you can get it HERE
After installing Heroku CLI run the following command
heroku --version
You should see the installed version of the CLI. something like heroku/7.60.2 win32-x64 node-v14.19.0
. if you see something weird or an error that may be because you don't have it installed properly so you need to check link mentioned above again
Login
To use the Heroku CLI you need to have a Heroku account and you can create create for free HERE. after you create an account you can now login from your Heroku CLI so that it will be able to identify you.
Run the following command
heroku login
after running the above command you will be prompted with a confirmation (pressing a key) then a browser tab will be opened and you will be taken to the Heroku login page and after entering your credentials you will be authenticated in the CLI.
you can also run
heroku login -i
this command will allow you login directly from the terminal by entering your email and password directly in the terminal
That's it now you are authenticated that's where the magic begins you can now create and manage your Heroku applications and that's exactly what we will be doing in the next article
See you there...
Posted on July 10, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.