Building your first Gatsby site

The first step to using Gatsby is to install the command-line tool globally:

npm install gatsby-cli -g  

Now you can run the command-line tool to generate your Gatsby project, not unlike how create-react-app works. The gatsby command takes two arguments:

  • The name of the new project
  • The URL of the Gatsby starter repository

The project name is basically the name of the folder that's created to hold all of your project files. A Gatsby starter is kind of like a template that makes it easier for you to get rolling, especially if you're learning. If you don't pass a starter, the default starter is used:

gatsby new your-first-gatsby-site

Running the above command would be the same as running:

gatsby new your-first-gatsby-site ...

Get React 16 Tooling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.