Create binstubs to easily dispatch the heroku command for specific apps
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Heroku binstubs

Stop typing out heroku run console --app myapp-staging and start using Heroku binstubs: wrappers around the heroku command that configure it for a given app. Here's a simplified example:

HEROKU_APP=myapp-staging exec heroku "$@"

Binstubs let you do do staging logs, staging info, and any other Heroku command without the --app or --remote ridiculousness, and this plugin makes it easy to create them.


heroku plugins:install


heroku binstubs:create myapp

For each app named like myapp-*, create a binstub named *. For example, myapp-staging becomes staging. If there is an app named myapp, it will be created as production.

By default, binstubs are created in ./bin, which works nicely with PATH=./bin:.... You can override the destination with --directory.

heroku binstubs:create myapp --directory script/heroku

With no arguments, heroku binstubs:create uses the current directory name, stripping off anything after a period ( becomes example).

If you'd rather have binstubs that match the exact app name, pass in --full.

There are a handful of other commands in the binstubs namespace.

heroku binstubs:create --as

Create a one-off binstub. For example, with the Heroku wildcards plugin:

heroku binstubs:create 'myapp-*' --as each-env

heroku binstubs:setup

Invoke heroku binstubs:create, and then create a Git remote for each binstub with the same name, if it doesn't already exist. For a freshly cloned repository, this is your go-to setup tool.

heroku binstubs:list

List all existing Heroku binstubs.

heroku binstubs:clean

Delete all existing Heroku binstubs. Other files are left untouched.

heroku binstubs:remotes

For each Heroku Git remote, create a binstub with the same name.

heroku binstubs:all

Create binstubs for every app you have access to. Always uses the full app name. A useful argument is --directory ~/bin.


Copyright © Tim Pope. MIT License. See LICENSE for details.