Heroku toolbelt command requires app-name
Asked Answered
H

7

45

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.

Hockey answered 29/8, 2012 at 0:8 Comment(0)
D
59

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

Drift answered 29/8, 2012 at 0:10 Comment(0)
S
49

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
Stabilize answered 24/1, 2015 at 20:49 Comment(1)
I've done this per the heroku docs, and it worked briefly, but now I'm getting the same error as rayray and need to specify the "-a app-name" parameter with every heroku command.Oread
D
25

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.

Diffusive answered 23/3, 2016 at 15:32 Comment(0)
A
2

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

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

Almond answered 27/6, 2015 at 3:17 Comment(0)
G
2

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

Gallinacean answered 19/7, 2019 at 12:16 Comment(0)
B
0

From my tests the Heroku CLI will infer the app from the current Git remote.

So to change to the "test" app:

git config heroku.remote test

And to come back to the default "heroku" application, which is probably your production app:

git config heroku.remote heroku

Not sure this is a good idea though...

Biller answered 5/3, 2017 at 23:15 Comment(0)
H
-1

For future solution seekers-

The error says a possible solution.

Run this command from an app folder

cd to the app directory root, then run your desired command.

Haversine answered 9/11, 2016 at 11:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.