This Heroku buildback lets you run Heroku CLI commands in your Heroku dynos.
- Add
https://github.com/fletom/heroku-buildpack-heroku-cli.gitas a buildpack URL. - Optionally, if you're sharing the app with others, create a dedicated less-privileged Heroku account to authenticate with.
- Generate a Heroku API token for the account using
heroku auth:token. - Add a
HEROKU_API_KEYenvironment variable to your app with the token you generated. - Use the
herokucommand from your web, worker, or Heroku Scheduler dynos.
Note that anyone with this auth token can perform actions using its corresponding Heroku account, including on other apps it has access to.