How to print environment variables on Heroku?

step 1 : list your apps

heroku apps

Copy the name of your app

step 2 : view config variables of this app

heroku config -a acme-web

The heroku run command runs a one-off process inside a Heroku dyno. The unix command that prints environment variables is printenv (manual page). Thus

heroku run -a app-name printenv

is the command you are looking for.


Ok, I found the way:

heroku config

Append --json to get the output as JSON.

heroku config -a acme-web --json