How to access Heroku app console by heroku CLI - heroku

I can check logs by heroku logs --app=my_app_name . I want to access app's console as shown in the picture. How can I access by heroku cli?

To access Heroku app bash by CLI:-
heroku login
heroku ps:exec --app=scoreboard-backend-dev
scoreboard-backend-dev is the app name

Related

heroku CLI auth by token

Every time after building and pushing docker image from Gitlab registry to Heroku registry I need to execute heroku container:release web to Heroku run image (release), but I wanna automate this
I added heroku CLI tool installation into gitlab-ci-yml, but I can't auth heroku CLI by token
When I try to set HEROKU_API_KEY=token and run heroku login I get an error Error: Cannot log in with HEROKU_API_KEY set
Also tried to do this with HEROKU_DEBUG on, but debugger info couldn't help me
I can't use ~/.netrc
Any way to auth heroku CLI or automate releasing docker images in heroku?
current gitlab-ci.yml:
before_script:
- apt install snapd
- snap install --classic heroku
- HEROKU_API_KEY=$HEROKU_API_TOKEN heroku login
- docker login -u $REGISTRY_UNAME -p $REGISTRY_PWD registry.gitlab.com
- docker login --username=_ --password=$HEROKU_PWD registry.heroku.com
script:
# a lot of tag & push lines
- heroku container:release web
If you have set the HEROKU_API_KEY environment variable, you don't have to log in again. The API key will be used for the Heroku CLI commands if present.
Make sure to use heroku authorizations:create to create never-expiring tokens. Check this out for a detailed explanation.
Ref: https://github.com/heroku/cli/issues/502#issuecomment-309099883
Note that the git commands like git push heroku master won't use the API key. See this for more info.
problem solved by changing account password that causes tokens changing and re-creating new token
And then run again HEROKU_API_KEY=token heroku container:release web with success

Login to Heroku on remote server without a browser

Is there a way to login into Heroku to see the logs on a remote server which has no browser installed ?
Using Heroku CLI
$ heroku login -i
$ heroku logs

How can you see Heroku logs for git deployed app on Heroku

If we deploy app normally on heroku-cli, we can easily see all the logs by using
$ heroku logs
But how can we check heroku logs if we have connected the heroku app with git repository, then we can't use heroku logs

Heroku Kafka certificates

According to the documentation, Heroku passes KAFKA_TRUSTED_CERT, KAFKA_CLIENT_CERT and KAFKA_CLIENT_CERT_KEY directly into my heroku applications. In consequence, only applications running on heroku can access Heroku Kafka? I would like to access it directly from my home workstation but i dont know how to get the ENVs
You can run either heroku config --app your_application_name to get all variables, or run heroku config:get KAFKA_TRUSTED_CERT --app your_application_name to just get one specific variable.
You can also login to Heroku dashboard and find all variables there in "Settings" section of your app.

How can I access memcache on Heroku via command line

How can I access memcache on Heroku via command, I just want to look up some key and delete it.
Thanks
heroku run console --app your-app-name
for Cedar, or
heroku console --app your-app-name
for Bamboo and Aspen. Then
m = Memcached.new

Resources