This Heroku buildback lets you run Heroku CLI commands in your Heroku dynos.
https://github.com/fletom/heroku-buildpack-heroku-cli.gitas a buildpack URL.
HEROKU_API_KEYenvironment variable to your app with the token you generated.
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.
Copy the snippet above into CLI.