Gatsby Development CLI

5.16.0 · active · verified Wed Apr 22

`gatsby-dev-cli` is a command-line interface tool specifically designed to assist contributors in the local development and testing of the Gatsby core framework. Its primary function is to enable developers to link a local clone of the Gatsby monorepo to a Gatsby site, allowing changes made to Gatsby packages to be copied directly into the site's `node_modules` for immediate, real-time testing. After the initial copy, the tool can maintain a watch task to automatically re-copy any changed modules, streamlining the iterative development process. The current stable version is 5.16.0. Gatsby generally follows a continuous release cadence for minor fixes and features within a major version, with major versions released less frequently. This CLI's key differentiation lies in its ability to facilitate rapid iteration on Gatsby core features directly within a consuming project, bypassing the complexities of manual `npm link` or copying. It is an essential utility for anyone contributing to the Gatsby project itself.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates global installation, initial repository configuration, linking a local Gatsby project, and how to revert changes.

npm install -g gatsby-dev-cli

# Configure the path to your cloned Gatsby repository (one-time setup)
gatsby-dev --set-path-to-repo ~/projects/gatsby-monorepo

# Navigate to your Gatsby project and link it to your local Gatsby core
cd my-gatsby-project
gatsby-dev

# (Optional, but recommended in a separate terminal while 'gatsby-dev' is running)
# Build and watch Gatsby source code in your Gatsby monorepo
# cd ~/projects/gatsby-monorepo
# npm run watch

# To revert changes made by gatsby-dev and restore official packages
# git checkout package.json; npm install --force

view raw JSON →