Heroku is a popular PAAS provider that offers managed Postgres database. Heroku provides a convenience command to connect to the postgres database, which will launch
psql. Now it is possible to launch
pgcli instead of the default
psql for heroku Postgres by installing the heroku-pg-pgcli plugin for heroku tool belt.
Make sure pgcli is installed. If it is not installed check the installation instructions. Typically it is:
$ brew install pgcli # Only on OS X
$ pip install pgcli # Python package installation
Then install the heroku plugin
$ heroku plugins:install email@example.com:chrisanderton/heroku-pg-pgcli.git
Run this from within a Heroku app directory
$ heroku pg:pgcli
That will launch pgcli with the appropriate database credentials, taken from heroku DATABASE_URL for that application.
Thanks to Chris Anderton for creating this heroku plugin.