Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 9f68124

Browse files
davemooreuwsraksiv
andauthored
feat: documents the add command (#733)
Adds documentation for the new `nitric add` command, including how to add websites and stacks to a project. This provides users with clear instructions on how to use the CLI to scaffold new resources. --------- Co-authored-by: Rak <[email protected]>
1 parent 67fddfc commit 9f68124

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

docs/reference/cli.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,52 @@ There are a few common commands that you will use frequently:
2121
- `nitric start` runs the Nitric server locally
2222
- `nitric up` deploys your stack to the cloud
2323
- `nitric down` destroys your stack from the cloud
24+
- `nitric add` adds new resources to your project
25+
26+
## Adding Resources
27+
28+
The `add` command helps you add new resources to your project:
29+
30+
```bash
31+
nitric add
32+
```
33+
34+
### Adding a Website
35+
36+
To add a new website to your project:
37+
38+
```bash
39+
nitric add website
40+
```
41+
42+
This will walk you through an interactive process to:
43+
44+
- Name your website
45+
- Select a tool/framework (currently supports [Astro](https://astro.build/), [Vite](https://vite.dev/), and [Hugo](https://gohugo.io/))
46+
- Configure the website's base URL path and dev server port
47+
48+
You can also specify the website name and tool directly:
49+
50+
```bash
51+
# For Astro
52+
nitric add website my-site astro
53+
54+
# For Vite
55+
nitric add website my-site vite
56+
57+
# For Hugo
58+
nitric add website my-site hugo
59+
```
60+
61+
### Adding a Stack
62+
63+
The `add stack` command is an alias for `stack new` and can be used to create a new stack:
64+
65+
```bash
66+
nitric add stack
67+
```
68+
69+
This will walk you through an interactive process to create a new stack configuration for a particular cloud provider. For more details about stack configuration and options, see the [Stacks section](#stacks) below.
2470

2571
## Getting Started
2672

docs/websites.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,39 @@ websites:
6969
url: http://localhost:4322
7070
```
7171
72+
### Alternative: Using the Nitric CLI
73+
74+
You can also add a website to your project using the Nitric CLI's `add website` command:
75+
76+
```bash
77+
nitric add website
78+
```
79+
80+
This will walk you through an interactive process to:
81+
82+
- Name your website
83+
- Select a tool/framework (currently supports [Astro](https://astro.build/), [Vite](https://vite.dev/), and [Hugo](https://gohugo.io/))
84+
- Configure the website's base URL path and dev server port
85+
86+
You can also specify the website name and tool directly:
87+
88+
```bash
89+
# For Astro
90+
nitric add website my-site astro
91+
92+
# For Vite
93+
nitric add website my-site vite
94+
95+
# For Hugo
96+
nitric add website my-site hugo
97+
```
98+
99+
The command will automatically:
100+
101+
1. Create a new website project using the framework's official package manager commands
102+
2. Add the necessary configuration to your `nitric.yaml` file
103+
3. Set up the build and development commands using the framework's native tools
104+
72105
### 3. Start your website locally
73106

74107
Run `nitric start` to start your website locally. This will use the `dev` configuration, which proxies requests to your local development server.

0 commit comments

Comments
 (0)