Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion docs/commands/create-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,47 @@ npx @dhis2/create-app --yes
# or npm create @dhis2/app -- --yes
```

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).
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).

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.

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`).

# CLI options

Instead of going through the wizard, you can pass arguments to specify the options to use when creating a new app.

You can run `pnpm create @dhis2/app@alpha --help` for the list of options available:

```sh
--yes, -y Skips interactive setup questions,
using default options to create the
new app (TypeScript, pnpm, basic
template) [boolean] [default: false]
--typescript, --ts, --typeScript Use TypeScript or JS [boolean]
--template Which template to use (Basic, With
React Router) [string]
--packageManager, --package, Package Manager
--packagemanager [string]
```

## Examples

Here are some examples of how you can use the CLI

```sh
# create a new app using the default settings (pnpm, TypeScript, basic template)
pnpm create @dhis2/app my-app --yes

# use the default settings but override the template
pnpm create @dhis2/app my-app --yes --template react-router

# use yarn as a package manager (and prompt for other settings)
pnpm create @dhis2/app my-app --packageManager yarn

# use yarn, JavaScript and the react-router template
pnpm create @dhis2/app my-app --packageManager yarn --no-typescript --template react-router

# run in debug mode
pnpm create @dhis2/app my-app --debug
```
Loading