Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

CLI UX by Example

csquared edited this page Sep 22, 2011 · 2 revisions

The heroku command line client is an end-user facing tool that serves as the primary CLI method of interaction with Heroku's services. The following examples show how the command line client is used and serve as the precedents for future design.

invoking the command line client:

Top-level commands

top level commands are mapped to a class in lib/heroku/command in the Heroku::Comand namespace the default method to invoke is ::index

$ heroku create    # invokes Heroku::Command::Create::index     
$ heroku addons    # Heroku::Command::Addons::index
$ heroku help      # Heroku::Command::Help::index

Sub Commands are mapped to methods within that command class

$ heroku addons:add pgbackups  # Heroku::Command::Addons::add
$ heroku ps:restart            # Heroku::Command::Ps::restart

Choosing a specific app

--app can be inferred from the git remote named heroku

coming soon: --app will also get set with the value in --confirm

$ heroku run console --app flaming-fire-123


$ heroku addons:add addon-with-confirmation --confirm flaming-fire-123

if --app and --confirm are both specified, they should be checked against each other. $ heroku addons:add addon --confirm flaming-fire-123 --app moving-earth-22 -----> Adding foo:bar to myapp... failed ! Mismatch between --app and --confirm

MOAR Options

For addon provisioning, the heroku client supports forwarding extra parameters to to the addon

$ heroku addons:add addon-name --app ff123 --foo bar --baz
will forward {:foo => "bar", :baz => "true" } to the provider

heroku-postgresql

Heroku Postgresql's "Fork" and "Follow" features take this one step further and decode database URLs

$ heroku addons:add addon-name heroku-postgresql --follow HEROKU_POSTGRESQL_PERIWINKLE
[See the docs](http://devcenter.heroku.com/articles/heroku-postgresql#follow_beta)