Daniel Brockman
Daniel Brockman

Reputation: 19270

How do I list my Heroku apps along with their domain names?

Seems like a pretty standard thing to want to do, but I can’t find any easy way of doing it?

Upvotes: 21

Views: 17726

Answers (7)

Ryan Walker
Ryan Walker

Reputation: 3286

Here's a command line solution using jq and the --json flag:

heroku apps -A --json | jq '.[] | .["web_url"]'

Upvotes: 6

sys0dm1n
sys0dm1n

Reputation: 879

You can use this command to list all the Heroku apps and respective domain names with Bash:

heroku apps | awk '{print $1;}' | sed 's/[^a-zA-Z0-9-]//g' | sed  '/^$/d' | while read line ; do echo "$line" ; heroku domains --app $line | grep 'herokuapp\|herokudns\|herokussl' ; done

Upvotes: 1

deepakmodak
deepakmodak

Reputation: 1339

Method 1 :

In shell, you can execute this script to list app-name and domains.

apps=( `heroku apps` )
echo "Total number of apps :"  $(( ${#apps[@]} -3 )) 
for (( i = 3 ; i < ${#apps[@]} ; i++ ))
do
    echo $(( i-2)) ] `heroku domains --app  ${apps[$i]}`
done

Method 2:

You can use Heroku API

https://devcenter.heroku.com/articles/platform-api-quickstart#calling-the-api

Upvotes: 3

&#214;zg&#252;r
&#214;zg&#252;r

Reputation: 8247

Just type heroku apps on the computer's command line that you have ssh keys for the heroku. For further info click here.

Upvotes: 22

Neil Middleton
Neil Middleton

Reputation: 22238

In zsh, you can try something like this:

for site (`heroku list`); do echo `heroku domains --app $site`; done;

which will dump out the info for each app. It's not pretty, but it's a start.

Upvotes: 11

user1027503
user1027503

Reputation:

from your app folder run heroku domains (--app name eventually)

 heroku domains
 Domain names for xxxx.herokuapp.com:
 aa.example.com
 bbb.example.com

Upvotes: 3

Chris Shanks
Chris Shanks

Reputation: 47

Go to: https://api.heroku.com/myapps

That lists all your apps that have been pushed up. Click on each one individually and it will tell you the domain name.

Upvotes: -1

Related Questions