From 2d09e2bfb35f9058fa545e40ac590f77cee858a4 Mon Sep 17 00:00:00 2001 From: Mozafar Haider Date: Wed, 7 Jan 2026 20:47:31 +0000 Subject: [PATCH] docs: update dhis2/create-app options --- docs/commands/create-app.md | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/commands/create-app.md b/docs/commands/create-app.md index 69df20c5..542c1c90 100644 --- a/docs/commands/create-app.md +++ b/docs/commands/create-app.md @@ -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 +```