Ask coding questions

← Back to all posts
Heroku CLI
dnrtc (5)

Has anyone set up a Bash REPL that has the Heroku CLI working? If so, I'd like to see how it was done.

Comments
hotnewtop
HackermonDev (2006)

Nope, not yet. But this would be a good idea.

GrandMoff100 (10)

Yes! I used the source tarball from their download and install page and then used wget to download it to the REPL, and then extracted it and ran the ./heroku/bin/heroku binary. Logging in is a little tricky but you can do it because the web browser window is visible in REPL.

GrandMoff100 (10)

You can actually specify the -i flag so you can log in via the cmd line.

asianova (0)

@GrandMoff100 can you walk me through it? I looked up https://devcenter.heroku.com/articles/heroku-cli#other-installation-methods and saw the files; which version did you use and did you run wget url_to_file directly on the REPL terminal?

GrandMoff100 (10)

@asianova Sure! I went to the downloads page for the Heroku CLI. I then copied the download address link of the latest version for linux (the OS repl runs on), then went to a repl and used wget <download url>. Once you finish that you can use tar to extract the contents of the new archive file. Then you're set at this point and the Heroku-cli binary should be in a folder called bin, inside of the extracted files folder. You can use it via ./<extracted_files_folder>/bin/heroku. Does that help?

asianova (0)

@GrandMoff100 hi, thank you! It worked, but I noticed the Heroku setup didn't persist after I close the session. Good workaround, but it might prevent me from using Repl.it in the long run!

AlexisCortes (1)

@GrandMoff100 can you show me the exact code?

GrandMoff100 (10)

@AlexisCortes Sure Thing! :)
To install

$ wget https://cli-assets.heroku.com/heroku-linux-x64.tar.gz
$ tar -zxf heroku-linux-x64.tar.gz
$ rm heroku-linux-x64.tar.gz

Then whenever you would use heroku, replace it with ./heroku/bin/heroku because this new heroku binary hasn't been added to PATH.