-
Notifications
You must be signed in to change notification settings - Fork 382
CLI UX by Example
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.
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
$ heroku addons:add pgbackups # Heroku::Command::Addons::add
$ heroku ps:restart # Heroku::Command::Ps::restart
--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
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'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)