zola/docs/content/documentation/getting-started/cli-usage.md

53 lines
1.3 KiB
Markdown
Raw Normal View History

2017-09-12 07:13:26 +00:00
+++
title = "CLI usage"
weight = 2
2017-09-12 07:13:26 +00:00
+++
Gutenberg only has 3 commands: init, build and serve.
You can view the help of the whole program by running `gutenberg --help` and
the command help by running `gutenberg <cmd> --help`.
## init
Creates the directory structure used by Gutenberg at the given directory.
```bash
$ gutenberg init <my_site>
```
will create a new folder named `my_site` and the files/folders needed by
Gutenberg.
## build
This will build the whole site in the `public` directory.
```bash
$ gutenberg build
```
You can override the config `base_url` by passing a new URL to the `base-url` flag.
```bash
$ gutenberg build --base-url https://59a896e2cf321c2dcfd2d6de--tera.netlify.com/
```
## serve
This will build and serve the site using a local server. You can also specify
the interface/port combination to use if you want something different than the default (`127.0.0.1:1111`).
```bash
$ gutenberg serve
$ gutenberg serve --port 2000
$ gutenberg serve --interface 0.0.0.0
$ gutenberg serve --interface 0.0.0.0 --port 2000
```
The serve command will watch all your content and will provide live reload, without
hard refresh if possible.
2017-10-03 15:21:18 +00:00
If you fail to see your change, this means that Gutenberg couldn't reload that bit and you will
need to restart `gutenberg serve`.