1 | # gatsby-cli
|
2 |
|
3 | Gatsby command line tool.
|
4 |
|
5 | Let's you create new Gatsby sites using
|
6 | [Gatsby starters](https://www.gatsbyjs.org/docs/gatsby-starters/).
|
7 |
|
8 | It also let's you run commands on sites. The tool runs code from the `gatsby`
|
9 | package installed locally.
|
10 |
|
11 | ## Install
|
12 |
|
13 | `npm install --global gatsby-cli`
|
14 |
|
15 | ## How to use
|
16 |
|
17 | Run `gatsby --help` for full help.
|
18 |
|
19 | ### New
|
20 |
|
21 | `gatsby new gatsby-site`
|
22 |
|
23 | See the [Gatsby starters docs](https://www.gatsbyjs.org/docs/gatsby-starters/)
|
24 | for more.
|
25 |
|
26 | ### Develop
|
27 |
|
28 | At the root of a Gatsby site run `gatsby develop` to start the Gatsby
|
29 | development server.
|
30 |
|
31 | Options
|
32 |
|
33 | ```
|
34 | -H, --host Set host. Defaults to localhost
|
35 | -p, --port Set port. Defaults to 8000
|
36 | -o, --open Open the site in your browser for you
|
37 | ```
|
38 |
|
39 | ### Build
|
40 |
|
41 | At the root of a Gatsby site run `gatsby build` to do a production build of a
|
42 | site.
|
43 |
|
44 | ### Serve
|
45 |
|
46 | At the root of a Gatsby site run `gatsby serve` to serve the production build of
|
47 | the site for testing.
|