Skip to content

Commit 76e50f5

Browse files
committed
docs: update dhis2/create-app options
1 parent 552f278 commit 76e50f5

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

docs/commands/create-app.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,47 @@ npx @dhis2/create-app --yes
2323
# or npm create @dhis2/app -- --yes
2424
```
2525

26-
By passing `--yes` argument, this will create a new DHIS2 web application using the default options without prompting (using `pnpm` as a package manager, and `TypeScript` as the language).
26+
By passing `--yes` argument, this will create a new DHIS2 web application using the default options without prompting (using `pnpm` as a package manager, and `TypeScript` as the language, and the default `basic` template).
2727

2828
If you omit the `--yes` argument (`pnpm create @dhis2/app project-name`), then you will be prompted and guided through a wizard to choose your options.
2929

3030
You can run the commands in `debug` mode to get more verbose logs by passing the `--debug` option (`pnpm create @dhis2/app project-name --debug`).
31+
32+
# CLI options
33+
34+
Instead of going through the wizard, you can pass arguments to specify the options to use when creating a new app.
35+
36+
You can run `pnpm create @dhis2/app@alpha --help` for the list of options available:
37+
38+
```sh
39+
--yes, -y Skips interactive setup questions,
40+
using default options to create the
41+
new app (TypeScript, pnpm, basic
42+
template) [boolean] [default: false]
43+
--typescript, --ts, --typeScript Use TypeScript or JS [boolean]
44+
--template Which template to use (Basic, With
45+
React Router) [string]
46+
--packageManager, --package, Package Manager
47+
--packagemanager [string]
48+
```
49+
50+
## Examples
51+
52+
Here are some examples of how you can use the CLI
53+
54+
```sh
55+
# create a new app using the default settings (pnpm, TypeScript, basic template)
56+
pnpm create @dhis2/app my-app --yes
57+
58+
# use the default settings but override the template
59+
pnpm create @dhis2/app my-app --yes --template react-router
60+
61+
# use yarn as a package manager (and prompt for other settings)
62+
pnpm create @dhis2/app my-app --packageManager yarn
63+
64+
# use yarn, JavaScript and the react-router template
65+
pnpm create @dhis2/app my-app --packageManager yarn --no-typescript --template react-router
66+
67+
# run in debug mode
68+
pnpm create @dhis2/app my-app --debug
69+
```

0 commit comments

Comments
 (0)