_heroku 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #compdef heroku
  2. # Heroku Autocomplete plugin for Oh-My-Zsh
  3. # Requires: The Heroku client gem (https://github.com/heroku/heroku)
  4. # Author: Ali B. (http://awhitebox.com)
  5. local -a _1st_arguments
  6. _1st_arguments=(
  7. "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
  8. "addons":"list installed addons"
  9. "addons\:list":"list all available addons"
  10. "addons\:add":"install an addon"
  11. "addons\:upgrade":"upgrade an existing addon"
  12. "addons\:downgrade":"downgrade an existing addon"
  13. "addons\:remove":"uninstall an addon"
  14. "addons\:open":"open an addon's dashboard in your browser"
  15. "apps":"list your apps"
  16. "apps\:info":"show detailed app information"
  17. "apps\:create":"create a new app"
  18. "apps\:rename":"rename the app"
  19. "apps\:open":"open the app in a web browser"
  20. "apps\:destroy":"permanently destroy an app"
  21. "auth\:login":"log in with your heroku credentials"
  22. "auth\:logout":"clear local authentication credentials"
  23. "config":"display the config vars for an app"
  24. "config\:pull":"pull heroku config vars down to the local environment"
  25. "config\:push":"push local config vars to heroku"
  26. "config\:set":"set one or more config vars"
  27. "config\:unset":"unset one or more config vars"
  28. "domains":"list custom domains for an app"
  29. "domains\:add":"add a custom domain to an app"
  30. "domains\:remove":"remove a custom domain from an app"
  31. "domains\:clear":"remove all custom domains from an app"
  32. "help":"list available commands or display help for a specific command"
  33. "keys":"display keys for the current user"
  34. "keys\:add":"add a key for the current user"
  35. "keys\:remove":"remove a key from the current user"
  36. "keys\:clear":"remove all authentication keys from the current user"
  37. "logs":"display recent log output"
  38. "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
  39. "logs\:drains":"manage syslog drains"
  40. "maintenance\:on":"put the app into maintenance mode"
  41. "maintenance\:off":"take the app out of maintenance mode"
  42. "pg\:credentials":"display the DATABASE credentials"
  43. "pg\:diagnose":"run diagnostics report on DATABASE"
  44. "pg\:info":"display database information"
  45. "pg\:kill":"kill a query"
  46. "pg\:killall":"terminates ALL connections"
  47. "pg\:maintenance":"manage maintenance for DATABASE"
  48. "pg\:promote":"sets DATABASE as your DATABASE_URL"
  49. "pg\:ps":"view active queries with execution time"
  50. "pg\:psql":"open a psql shell to the database"
  51. "pg\:pull":"pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE"
  52. "pg\:push":"push from LOCAL_SOURCE_DATABASE to REMOTE_TARGET_DATABASE"
  53. "pg\:reset":"delete all data in DATABASE"
  54. "pg\:unfollow":"stop a replica from following and make it a read/write database"
  55. "pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version"
  56. "pg\:wait":"monitor database creation, exit when complete"
  57. "pgbackups":"list captured backups"
  58. "pgbackups\:url":"get a temporary URL for a backup"
  59. "pgbackups\:capture":"capture a backup from a database id"
  60. "pgbackups\:restore":"restore a backup to a database"
  61. "pgbackups\:destroy":"destroys a backup"
  62. "plugins":"list installed plugins"
  63. "plugins\:install":"install a plugin"
  64. "plugins\:uninstall":"uninstall a plugin"
  65. "ps\:dynos":"scale to QTY web processes"
  66. "ps\:workers":"scale to QTY background processes"
  67. "ps":"list processes for an app"
  68. "ps\:restart":"restart an app process"
  69. "ps\:scale":"scale processes by the given amount"
  70. "releases":"list releases"
  71. "releases\:info":"view detailed information for a release"
  72. "rollback":"roll back to an older release"
  73. "run":"run an attached process"
  74. "run\:rake":"remotely execute a rake command"
  75. "run\:console":"open a remote console session"
  76. "sharing":"list collaborators on an app"
  77. "sharing\:add":"add a collaborator to an app"
  78. "sharing\:remove":"remove a collaborator from an app"
  79. "sharing\:transfer":"transfer an app to a new owner"
  80. "ssl":"list certificates for an app"
  81. "ssl\:add":"add an ssl certificate to an app"
  82. "ssl\:remove":"remove an ssl certificate from an app"
  83. "ssl\:clear":"remove all ssl certificates from an app"
  84. "stack":"show the list of available stacks"
  85. "stack\:migrate":"prepare migration of this app to a new stack"
  86. "version":"show heroku client version"
  87. )
  88. _arguments '*:: :->command'
  89. if (( CURRENT == 1 )); then
  90. _describe -t commands "heroku command" _1st_arguments
  91. return
  92. fi
  93. local -a _command_args
  94. case "$words[1]" in
  95. apps:info)
  96. _command_args=(
  97. '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
  98. )
  99. ;;
  100. apps:create)
  101. _command_args=(
  102. '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
  103. '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
  104. '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
  105. )
  106. ;;
  107. config)
  108. _command_args=(
  109. '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
  110. )
  111. ;;
  112. keys)
  113. _command_args=(
  114. '(-l|--long)'{-l,--long}'[display extended information for each key]' \
  115. )
  116. ;;
  117. logs)
  118. _command_args=(
  119. '(-n|--num)'{-n,--num}'[the number of lines to display]' \
  120. '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
  121. '(-s|--source)'{-s,--source}'[only display logs from the given source]' \
  122. '(-t|--tail)'{-t,--tail}'[continually stream logs]' \
  123. )
  124. ;;
  125. pgbackups:capture)
  126. _command_args=(
  127. '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
  128. )
  129. ;;
  130. stack)
  131. _command_args=(
  132. '(-a|--all)'{-a,--all}'[include deprecated stacks]' \
  133. )
  134. ;;
  135. esac
  136. _arguments \
  137. $_command_args \
  138. '(--app)--app[the app name]' \
  139. '(--remote)--remote[the remote name]' \
  140. '(--help)--help[help about the current command]' \
  141. && return 0