Skip to content

Conversation

@gillkyle
Copy link
Contributor

@gillkyle gillkyle commented Nov 24, 2020

Description

This adds the ability to log in to Gatsby Cloud from the CLI. The 3 following commands are hidden behind an experimental flag GATSBY_EXPERIMENTAL_CLOUD_CLI that when set enables the commands:

  • gatsby login - saves an access token after a login to the config store
  • gatsby logout - removes the token
  • gatsby whoami - hits the Gatsby Cloud API to return the name of the currentUser

Note: this gif is a little inaccurate as it shows a lot of debug level details like the polling in the CLI which has been removed.

CleanShot 2020-11-23 at 17 11 13

The bajillion identical commits are me fighting TypeScript to pass our pre commit linting haha

Good luck stealing my token you hackers because this is all on my local machine ;)

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 24, 2020
@gillkyle gillkyle changed the title wip(gatsby-cli): add login command wip(gatsby-cli): add login, logout, whoami commands Nov 25, 2020
@gillkyle gillkyle marked this pull request as ready for review November 25, 2020 23:36
mfrachet
mfrachet previously approved these changes Nov 26, 2020
Copy link

@mfrachet mfrachet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your coding style, code is self-explanatory and easy to figure out 👍🏻 . I'm nit picky on tiny things but feel free to ignore them if they don't make sense :)

mxstbr
mxstbr previously approved these changes Nov 26, 2020
Copy link
Contributor

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic! 💯

@LekoArts LekoArts added topic: cli Related to the Gatsby CLI and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Nov 26, 2020
@gillkyle gillkyle dismissed stale reviews from mxstbr and mfrachet via fbff3ba November 30, 2020 18:19
@gillkyle gillkyle merged commit d18b199 into master Nov 30, 2020
@delete-merged-branch delete-merged-branch bot deleted the cli/login branch November 30, 2020 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: cli Related to the Gatsby CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants