summaryrefslogtreecommitdiff
path: root/docs/cli.md
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-04-22 08:25:57 -0400
committerGravatar GitHub <noreply@github.com> 2021-04-22 08:25:57 -0400
commitda033e27eada3bbcad5544be282e9edcf4799003 (patch)
tree8fa1203d4e318f006d254abff79caa2508a86fd2 /docs/cli.md
parenta7185735da7413e132f313ff5086db74304d7654 (diff)
downloadastro-da033e27eada3bbcad5544be282e9edcf4799003.tar.gz
astro-da033e27eada3bbcad5544be282e9edcf4799003.tar.zst
astro-da033e27eada3bbcad5544be282e9edcf4799003.zip
CLI docs (#121)
* 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
Diffstat (limited to 'docs/cli.md')
-rw-r--r--docs/cli.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/cli.md b/docs/cli.md
new file mode 100644
index 000000000..c413323d5
--- /dev/null
+++ b/docs/cli.md
@@ -0,0 +1,41 @@
+## 👩🏽‍💻 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`. \ No newline at end of file