Heroku toolbelt command requires app-name

How do you specify the app you want when you log in to Heroku from the command line?

I was trying to check the logs so when I first logged in I tried:

Heroku logs

this then told me:

 !    No app specified.
 !    Run this command from an app folder or specify which app to use with --app <app name>

I then tried:

heroku --app my-appname

but i get:

`--app` is not a heroku command.

I have tried all combinations.


Solution 1:

You still need to include the command:

heroku logs --app app-name

You can also use -a instead of --app:

heroku logs -a app-name

Solution 2:

Another option is to associate your (git) project to Heroku. From heroku open - no app specified:

$ cd app-dir
$ heroku git:remote -a app-name
$ heroku logs

Solution 3:

Try this:

heroku git:remote -a [app_name]

This should allow you to call commands without having to specify which app you want them to be called on.

Solution 4:

You could try adding --app app-name after you sentence.

Example: $ heroku domains:add your-domain --app app-name

Solution 5:

Heroku CLI automatically detects the app name by scanning the git remotes for the current working copy.

If you're not in the app's local git clone, you need to specify the app name:

heroku logs --app app-name 

or

heroku logs -a app-name 

or by specifying the remote name:

heroku logs --remote production

You can reference this part of the Heroku documentation:

https://devcenter.heroku.com/articles/using-the-cli#app-commands