Skip to content

Commit 5eb5b43

Browse files
committed
Update usage instructions
1 parent b3480ff commit 5eb5b43

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ To see a full list of options use the `--help` flag:
1717
1818
Options:
1919
--version Show version number [boolean]
20-
-s, --starter Choose a starter [choices: "nextjs", "ts-nextjs"]
20+
-s, --starter Choose a starter [choices: "nextjs", "ts-nextjs"]
21+
-e, --example Start from an example
22+
[choices: "algolia-search", "dynamic-app", "sb-countdown", "sb-typist"]
2123
--help Show help [boolean]
2224
```
2325

@@ -31,6 +33,16 @@ npx create-stackbit-app --starter ts-nextjs
3133

3234
If no starter option is provided, [the default starter](https://github.com/stackbit-themes/nextjs-starter) is used.
3335

36+
### Starting from an Example
37+
38+
Use the `--example` option to start a project from an example. Run the command with the `--help` flag to see a full list of available starters.
39+
40+
```txt
41+
npx create-stackbit-app --example algolia-search
42+
```
43+
44+
This will create a new project matching the name of the example, unless overridden (see below). [See here for a full list of starters](https://github.com/stackbit-themes/stackbit-examples).
45+
3446
### Setting Project Directory
3547

3648
Pass a directory name as the only argument when running the command. For example, if you wanted your directory to be name `my-site`, the command would look something like this:
@@ -39,7 +51,7 @@ Pass a directory name as the only argument when running the command. For example
3951
npx create-stackbit-app my-site
4052
```
4153

42-
If no name is provided, the directory will be `my-stackbit-site-[id]`, where `[id]` is a randomly-generated string used to avoid directory conflicts.
54+
If no name is provided, the directory will be `my-stackbit-site` for starters or will match the name of the example if starting from an example. If the directory already exists, a timestamp value will be appended to the directory name to ensure uniqueness.
4355

4456
## Adding Stackbit to Existing Projects
4557

0 commit comments

Comments
 (0)