statamic / cli

Install and manage your Statamic projects from the command line.
71 stars 19 forks source link

Downloading starter kits needs GH credentials #29

Closed robdekort closed 2 years ago

robdekort commented 3 years ago

If you don't have an access token saved for your GH account you can't seem to install starter kits. Perhaps the installer should use https instead of SSH to pull them in?

jackmcdade commented 3 years ago

If you use https though you'll need to enter your username and password every time, unless I'm misunderstanding the issue? 🤔

robdekort commented 3 years ago

Nope, actually you don't. So if you use git clone https://github.com/statamic/starter-kit-cool-writings.git cool-writings you don't need to be authenticated. With the SSH method: git clone git@github.com:statamic/starter-kit-cool-writings.git cool-writings you do.

This is not an issue with the base install as I assume it uses composer require.

Hope it makes sense.

jesseleite commented 3 years ago

@robdekort Hmm, the CLI already instals via https url though 🤔 . See https://github.com/statamic/cli/blob/master/src/NewCommand.php#L214.

robdekort commented 3 years ago

Hmm yeah, it seems to use composer create project. I'm not sure what that does behind the scenes. Feel free to close this of course, but I've heard from some folks they don't know what to do when the cli asks for an auth key. Could be worth investigating?

jesseleite commented 3 years ago

It's a valid issue, I'm just not sure what to do about it. Merged your #30 thing, but will leave this open for now.

robdekort commented 3 years ago

I don't know either, sniff.... maybe someone will come along here and enlighten us.

robdekort commented 3 years ago

For future use, this is the notification you get from the CLI:

GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/studio1902/statamic-peak/contents/composer.json?ref=SOME_STRING. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

Head to https://github.com/settings/tokens/new?scopes=repo&description=A_DESCRIPTION
to retrieve a token. It will be stored in "/Users/YOUR_USERNAME/.composer/auth.json" for future use by Composer.
Token (hidden): 
itsmesaskovic commented 2 years ago

For future use, this is the notification you get from the CLI:

GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/studio1902/statamic-peak/contents/composer.json?ref=SOME_STRING. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

Head to https://github.com/settings/tokens/new?scopes=repo&description=A_DESCRIPTION
to retrieve a token. It will be stored in "/Users/YOUR_USERNAME/.composer/auth.json" for future use by Composer.
Token (hidden): 

Today I encountered this issue as well. I did not get the message as described above.

After some research I ended up doing the same thing as advised. Following this tutorial: https://www.previousnext.com.au/blog/managing-composer-github-access-personal-access-tokens

jasonvarga commented 2 years ago

I don't think this is an issue with the cli specifically, but just with composer in general.

Here's where they explain it and tell you how to create a token: https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens