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:
#!/bin/sh HEROKU_APP=myapp-staging exec heroku "$@"
Binstubs let you do do
staging info, and any other Heroku
command without the
--remote ridiculousness, and this plugin
makes it easy to create them.
heroku plugins:install https://github.com/tpope/heroku-binstubs.git
heroku binstubs:create myapp
For each app named like
myapp-*, create a binstub named
*. For example,
staging. If there is an app named
will be created as
By default, binstubs are created in
./bin, which works nicely with
PATH=./bin:.... You can override the destination with
heroku binstubs:create myapp --directory script/heroku
With no arguments,
heroku binstubs:create uses the current directory name,
stripping off anything after a period (
If you'd rather have binstubs that match the exact app name, pass in
There are a handful of other commands in the
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: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.
List all existing Heroku binstubs.
Delete all existing Heroku binstubs. Other files are left untouched.
For each Heroku Git remote, create a binstub with the same name.
Create binstubs for every app you have access to. Always uses the full app
name. A useful argument is
Copyright © Tim Pope. MIT License. See LICENSE for details.