mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
da033e27ea
* Start of cli docs * Document the CLI Also adds support for the `--config` option and `--port` option for the dev server. * Add tests for --config and --port flags * Add port to validateConfig
41 lines
No EOL
1,015 B
Markdown
41 lines
No EOL
1,015 B
Markdown
## 👩🏽💻 Command Line Interface
|
|
|
|
### 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
|
|
```
|
|
|
|
#### `--version`
|
|
|
|
Print the Astro version number and exit.
|
|
|
|
#### `--help`
|
|
|
|
Print the help message and exit.
|
|
|
|
### Commands
|
|
|
|
#### `astro dev`
|
|
|
|
Runs the Astro development server. This starts an HTTP server that responds to requests for pages stored in `astro/pages` (or which folder is specified in your [configuration](../README.md##%EF%B8%8F-configuration)).
|
|
|
|
__Flags__
|
|
|
|
##### `--port`
|
|
|
|
Specifies should port to run on. Defaults to `3000`. |