blob: 3c66b2368bef77ef97be5eef7f3c492ab3aa3697 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
---
layout: ~/layouts/MainLayout.astro
title: CLI Reference
---
## Commands
### `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](/reference/configuration-reference)).
**Flags**
#### `--port`
Specifies should port to run on. Defaults to `3000`.
### `astro build`
Builds your site for production.
### `astro preview`
Start a local static file server to serve your built `dist/` directory. Useful for previewing your static build locally, before deploying it.
This command is meant for local testing only, and is not designed to be run in production. For help with production hosting, check out our guide on [Deploying an Astro Website](/guides/deploy).
## 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
```
### `--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
```
### `--reload`
Clears the cache (dependencies are built within Astro apps).
### `--verbose`
Enables verbose logging, which is helpful when debugging an issue.
### `--silent`
Enables silent logging, which is helpful for when you don't want to see Astro logs.
### `--version`
Print the Astro version number and exit.
### `--help`
Print the help message and exit.
|