Skip to content

licht1stein/heroku.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs interface for Heroku CLI

https://melpa.org/packages/heroku-badge.svg https://stable.melpa.org/packages/heroku-badge.svg

This package does to Heroku CLI what Magit did to git. It transforms the heroku commands into useful, quick and intuitive interface using transient.

Table of Contents

Install

You can install heroku.el from MELPA or MELPA Stable:

M-x package-install RET heroku RET

Usage

Make sure that Heroku CLI is installed and you have logged in using heroku login (heroku.el will prompt you to login if you didn’t, but it’s better to be logged in already).

Heroku.el has a main point of entry, called heroku-list:

M-x heroku-list RET

This opens up a list with all apps that you have access to, and you can start managing them right away (see screenshot). Once you’re in the list you can always see available commands by pressing ?

You can also run some of the commands without starting heroku-list and get prompted for an app name to run on. Some of these commands:

  • heroku-logs
  • heroku-run
  • heroku-run-bash
  • heroku-run-python
  • heroku-run-detached
  • heroku-sql
  • heroku-restart

They will not let you set command line arguments and options, but will allow for quick actions when you know exactly what you want to do.

My favorite use cases

I have been using this package for almost two years without releasing it, and I rarely if ever need to open heroku’s web interface or run CLI commands. The most useful actions that I use all the time:

Tail Logs

Set the cursor on an app and press l, the logs options menu will pop up:

./img/logs-options.png

Normally I just press ll to start tailing logs immediately. A new buffer will open with your logs and some basic highlighting (ERROR will be red, WARNING yellow etc.)

Run bash/python

Choose an app in the list and press r for run:

./img/run-options.png

You can quickly run bash on the app with rb and python with rp

Pressing rr will prompt you for command to run in the minibuffer, and rd will do the same, but command you give will run detached.

Restarting dynos

Press yr to quickly restart a dyno.

More Screenshots

App list

Main interface, that allows you to choose an app and perform actions on it.

./img/app-list.png

App Commands

App commands menu with available actions (you can see it by pressing ?)

./img/app-commands.png

Environment Variables

Editing environment variables right from within emacs. You can also easily create new ones.

./img/config.png

Heroku Postgres

Running heroku-sql opens Emacs’s sql buffer for psql and you can start working with the db:

./img/heroku-sql.png

Compatibility with old heroku.el

There was previously a small heroku.el package that had two commands: heroku-run and heroku-sql. Both of these commands are present in this implementation and can be used the same way, to preserve backward compatibility.

Versioning

The project uses break versioning, meaning that upgrading from 1.0.x to 1.0.y will always be safe, upgrade to 1.y.0 might break something small, and upgrade to y.0.0. will break almost everything.