astro/docs/reference/cli-reference.md

60 lines
1.3 KiB
Markdown
Raw Normal View History

2021-06-28 06:27:12 +00:00
---
layout: ~/layouts/Main.astro
title: CLI Reference
---
2021-06-28 06:27:12 +00:00
## Commands
2021-06-28 06:27:12 +00:00
### `astro dev`
Runs the Astro development server. This starts an HTTP server that responds to requests for pages stored in `src/pages` (or which folder is specified in your [configuration](../README.md##%EF%B8%8F-configuration)).
See the [dev server](./dev.md) docs for more information on how the dev server works.
**Flags**
#### `--port`
Specifies should port to run on. Defaults to `3000`.
### `astro build`
Builds your site for production.
## Global Flags
### `--config path`
Specify the path to the config file. Defaults to `astro.config.mjs`. Use this if you use a different name for your configuration file or have your config file in another folder.
```shell
astro --config config/astro.config.mjs dev
```
2021-06-28 06:27:12 +00:00
### `--project-root path`
Specify the path to the project root. If not specified the current working directory is assumed to be the root.
The root is used for finding the Astro configuration file.
```shell
astro --project-root examples/snowpack dev
```
2021-06-28 06:27:12 +00:00
### `--reload`
Clears the cache (dependencies are built within Astro apps).
2021-06-28 06:27:12 +00:00
### `--verbose`
Enables verbose logging, which is helpful when debugging an issue.
2021-06-28 06:27:12 +00:00
### `--version`
Print the Astro version number and exit.
2021-06-28 06:27:12 +00:00
### `--help`
Print the help message and exit.