_heroku 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. "features":"list available app features"
  33. "features\:disable":"disables a feature"
  34. "features\:enable":"enables an feature"
  35. "features\:info":"displays additional information about feature"
  36. "help":"list available commands or display help for a specific command"
  37. "keys":"display keys for the current user"
  38. "keys\:add":"add a key for the current user"
  39. "keys\:remove":"remove a key from the current user"
  40. "keys\:clear":"remove all authentication keys from the current user"
  41. "logs":"display recent log output"
  42. "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
  43. "logs\:drains":"manage syslog drains"
  44. "maintenance\:on":"put the app into maintenance mode"
  45. "maintenance\:off":"take the app out of maintenance mode"
  46. "pipelines":"list pipelines you have access to"
  47. "pipelines\:add":"add this app to a pipeline"
  48. "pipelines\:create":"create a new pipeline"
  49. "pipelines\:destroy":"destroy a pipeline"
  50. "pipelines\:diff":"compares the latest release of this app to its downstream app(s)"
  51. "pipelines\:info":"show list of apps in a pipeline"
  52. "pipelines\:list":"list pipelines you have access to"
  53. "pipelines\:open":"open a pipeline in dashboard"
  54. "pipelines\:promote":"promote the latest release of this app to its downstream app(s)"
  55. "pipelines\:remove":"remove this app from its pipeline"
  56. "pipelines\:rename":"rename a pipeline"
  57. "pipelines\:update":"update this app's stage in a pipeline"
  58. "pg\:credentials":"display the DATABASE credentials"
  59. "pg\:diagnose":"run diagnostics report on DATABASE"
  60. "pg\:info":"display database information"
  61. "pg\:kill":"kill a query"
  62. "pg\:killall":"terminates ALL connections"
  63. "pg\:maintenance":"manage maintenance for DATABASE"
  64. "pg\:promote":"sets DATABASE as your DATABASE_URL"
  65. "pg\:ps":"view active queries with execution time"
  66. "pg\:psql":"open a psql shell to the database"
  67. "pg\:pull":"pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE"
  68. "pg\:push":"push from LOCAL_SOURCE_DATABASE to REMOTE_TARGET_DATABASE"
  69. "pg\:reset":"delete all data in DATABASE"
  70. "pg\:unfollow":"stop a replica from following and make it a read/write database"
  71. "pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version"
  72. "pg\:wait":"monitor database creation, exit when complete"
  73. "pg\:backups":"Interact with built-in backups"
  74. "pgbackups":"list captured backups"
  75. "pgbackups\:url":"get a temporary URL for a backup"
  76. "pgbackups\:capture":"capture a backup from a database id"
  77. "pgbackups\:restore":"restore a backup to a database"
  78. "pgbackups\:destroy":"destroys a backup"
  79. "plugins":"list installed plugins"
  80. "plugins\:install":"install a plugin"
  81. "plugins\:uninstall":"uninstall a plugin"
  82. "ps\:dynos":"scale to QTY web processes"
  83. "ps\:workers":"scale to QTY background processes"
  84. "ps":"list processes for an app"
  85. "ps\:restart":"restart an app process"
  86. "ps\:scale":"scale processes by the given amount"
  87. "releases":"list releases"
  88. "releases\:info":"view detailed information for a release"
  89. "rollback":"roll back to an older release"
  90. "run":"run an attached process"
  91. "run\:rake":"remotely execute a rake command"
  92. "run\:console":"open a remote console session"
  93. "sharing":"list collaborators on an app"
  94. "sharing\:add":"add a collaborator to an app"
  95. "sharing\:remove":"remove a collaborator from an app"
  96. "sharing\:transfer":"transfer an app to a new owner"
  97. "ssl":"list certificates for an app"
  98. "ssl\:add":"add an ssl certificate to an app"
  99. "ssl\:remove":"remove an ssl certificate from an app"
  100. "ssl\:clear":"remove all ssl certificates from an app"
  101. "stack":"show the list of available stacks"
  102. "stack\:migrate":"prepare migration of this app to a new stack"
  103. "version":"show heroku client version"
  104. )
  105. _arguments '*:: :->command'
  106. if (( CURRENT == 1 )); then
  107. _describe -t commands "heroku command" _1st_arguments
  108. return
  109. fi
  110. local -a _command_args
  111. case "$words[1]" in
  112. apps:info)
  113. _command_args=(
  114. '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
  115. )
  116. ;;
  117. apps:create)
  118. _command_args=(
  119. '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
  120. '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
  121. '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
  122. )
  123. ;;
  124. config)
  125. _command_args=(
  126. '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
  127. )
  128. ;;
  129. keys)
  130. _command_args=(
  131. '(-l|--long)'{-l,--long}'[display extended information for each key]' \
  132. )
  133. ;;
  134. logs)
  135. _command_args=(
  136. '(-n|--num)'{-n,--num}'[the number of lines to display]' \
  137. '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
  138. '(-s|--source)'{-s,--source}'[only display logs from the given source]' \
  139. '(-t|--tail)'{-t,--tail}'[continually stream logs]' \
  140. )
  141. ;;
  142. pipelines)
  143. _command_args=(
  144. '(--json)'--json'[output in json format]' \
  145. )
  146. ;;
  147. pipelines:add)
  148. _command_args=(
  149. '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
  150. )
  151. ;;
  152. pipelines:create)
  153. _command_args=(
  154. '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
  155. )
  156. ;;
  157. pipelines:info)
  158. _command_args=(
  159. '(--json)'--json'[output in json format]' \
  160. )
  161. ;;
  162. pipelines:list)
  163. _command_args=(
  164. '(--json)'--json'[output in json format]' \
  165. )
  166. ;;
  167. pipelines:promote)
  168. _command_args=(
  169. '(-t|--to)'{-t,--to}'[comma separated list of apps to promote to]' \
  170. )
  171. ;;
  172. pipelines:update)
  173. _command_args=(
  174. '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
  175. )
  176. ;;
  177. pgbackups:capture)
  178. _command_args=(
  179. '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
  180. )
  181. ;;
  182. stack)
  183. _command_args=(
  184. '(-a|--all)'{-a,--all}'[include deprecated stacks]' \
  185. )
  186. ;;
  187. esac
  188. _arguments \
  189. $_command_args \
  190. '(--app)--app[the app name]' \
  191. '(--remote)--remote[the remote name]' \
  192. '(--help)--help[help about the current command]' \
  193. && return 0