{"id":15486657,"url":"https://github.com/dblock/heroku-commander","last_synced_at":"2025-06-19T13:36:19.427Z","repository":{"id":6656935,"uuid":"7901461","full_name":"dblock/heroku-commander","owner":"dblock","description":"Master the Heroku CLI from Ruby.","archived":false,"fork":false,"pushed_at":"2014-12-30T22:32:12.000Z","size":335,"stargazers_count":7,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-27T21:29:15.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dblock.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-29T21:20:46.000Z","updated_at":"2017-06-05T12:40:26.000Z","dependencies_parsed_at":"2022-08-20T11:30:51.875Z","dependency_job_id":null,"html_url":"https://github.com/dblock/heroku-commander","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fheroku-commander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fheroku-commander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fheroku-commander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fheroku-commander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dblock","download_url":"https://codeload.github.com/dblock/heroku-commander/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233566907,"owners_count":18695286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T06:09:20.958Z","updated_at":"2025-01-12T16:53:17.521Z","avatar_url":"https://github.com/dblock.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](assets/heroku-commander.png)\nHeroku::Commander\n=================\n\n[![Gem Version](http://img.shields.io/gem/v/heroku-commander.svg)](http://badge.fury.io/rb/heroku-commander)\n[![Build Status](http://img.shields.io/travis/dblock/heroku-commander.svg)](https://travis-ci.org/dblock/heroku-commander)\n[![Dependency Status](https://gemnasium.com/dblock/heroku-commander.svg)](https://gemnasium.com/dblock/heroku-commander)\n[![Code Climate](https://codeclimate.com/github/dblock/heroku-commander.svg)](https://codeclimate.com/github/dblock/heroku-commander)\n\n\nMaster the Heroku CLI from Ruby.\n\nUsage\n-----\n\nAdd `heroku` and `heroku-commander` to Gemfile.\n\n``` ruby\ngem \"heroku\"\ngem \"heroku-commander\"\n```\n\nHeroku Configuration\n--------------------\n\nReturns a hash of an application's configuration (output from `heroku config`).\n\n\n``` ruby\ncommander = Heroku::Commander.new({ :app =\u003e \"heroku-commander\" })\ncommander.config # =\u003e a hash of all settings for the heroku-commander app\n```\n\nHeroku Processes\n----------------\n\nReturns or yields an array of processes by running `heroku ps`.\n\n``` ruby\ncommander = Heroku::Commander.new({ :app =\u003e \"heroku-commander\" })\ncommander.processes do |process|\n  # try process.pid and process.status\nend\n```\n\nHeroku Run\n----------\n\nExecutes a command via `heroku run`, pipes and returns output lines. Unlike the heroku client, this also checks the process return code and raises a `Heroku::Commander::Errors::CommandError` if the latter is not zero, which makes this suitable for Rake tasks.\n\n``` ruby\ncommander = Heroku::Commander.new({ :app =\u003e \"heroku-commander\" })\ncommander.run \"uname -a\" # =\u003e [ \"Linux 2.6.32-348-ec2 #54-Ubuntu SMP x86_64 GNU\" ]\n```\n\nYou can specify the dyno size with `size`.\n\n``` ruby\ncommander.run \"uname -a\", { size: \"2X\" }\n```\n\nHeroku Detached Run\n-------------------\n\nExecutes a command via `heroku run:detached`, spawns a `heroku logs --tail -p pid` for the process started on Heroku, pipes and returns output lines. This also checks the process return code and raises a `Heroku::Commander::Errors::CommandError` if the latter is not zero.\n\n``` ruby\ncommander = Heroku::Commander.new({ :app =\u003e \"heroku-commander\" })\ncommander.run(\"uname -a\", { :detached =\u003e true }) # =\u003e [ \"Linux 2.6.32-348-ec2 #54-Ubuntu SMP x86_64 GNU\" ]\n```\n\nYou can examine the output from `heroku logs --tail -p pid` line-by-line.\n\n``` ruby\ncommander.run(\"ls -R\", { :detached =\u003e true }) do |line|\n  # each line from the output of the command\nend\n```\n\nYou can pass the following options along with `:detached`:\n\n* **size**: dyno size, eg. `2X` for double-dynos.\n* **tail_timeout**: number of seconds to wait before terminating `heroku logs --tail`, expecting more output (defaults to 5).\n* **tail_retries**: number of times to restart the tail process on error (defaults to 3).\n\nFor more information about Heroku one-off dynos see [this documentation](https://devcenter.heroku.com/articles/one-off-dynos).\n\nMore Examples\n-------------\n\nSee [examples](examples) for more.\n\nContributing\n------------\n\nFork the project. Make your feature addition or bug fix with tests. Send a pull request. Bonus points for topic branches.\n\nCopyright and License\n---------------------\n\nMIT License, see [LICENSE](LICENSE.md) for details.\n\n(c) 2013 [Daniel Doubrovkine](http://github.com/dblock), [Frank Macreery](http://github.com/macreery), [Artsy Inc.](http://artsy.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fheroku-commander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdblock%2Fheroku-commander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fheroku-commander/lists"}