You can pass the project name as an argument or use options to skip interactive prompts:
Copy
# Specify project name directlypnpm create sonamu myapp# Use all default options (non-interactive)pnpm create sonamu myapp --yes# Explicitly specify pnpm/docker setuppnpm create sonamu myapp --pnpm y --docker y# Auto-proceed with pnpm only (docker prompts will appear)pnpm create sonamu myapp --pnpm y# Auto-proceed with docker only (pnpm prompts will appear, DB options use defaults)pnpm create sonamu myapp --docker y# Fully non-interactive mode (all options specified)pnpm create sonamu myapp \ --pnpm y \ --docker y \ --db-user=postgres \ --db-password=1234 \ --db-name=myapp \ --container-name=myapp-pg \ --docker-project=myapp-docker# Specify DB options only (pnpm/docker setup will prompt)pnpm create sonamu myapp --db-name myapp --db-password secret123
Option
Description
Default
--yes, -y
Use all default options
-
--pnpm
pnpm installation (y/n)
(prompts)
--docker
Docker DB setup (y/n)
(prompts)
--skip-pnpm
Skip pnpm setup (same as --pnpm n)
false
--skip-docker
Skip Docker DB setup (same as --docker n)
false
--docker-project, --docker-pj-name
Docker Compose project name
-docker
--db-user
Database username
postgres
--db-name
Database name
--db-password
Database password
1234
--container-name
Docker container name
-container
In --pnpm y and --docker y, you can also use yes, true, or 1 instead of y. Similarly, n can be replaced with no, false, or 0.
When the interactive prompt appears, enter your project information:
Copy
? Project name: myapp? Would you like to set up pnpm? Yes? Would you like to set up a database using Docker? Yes? Enter the Docker project name: myapp-docker? Enter the database user: postgres? Enter the container name: myapp-container? Enter the database name: myapp? Enter the database password: ****
1
Enter Project Name
Enter the name of the project to create. A directory will be created with this name.
Spaces and hyphens (-) cannot be used in the project name. Use underscores (_) instead.
2
pnpm Setup
Choose whether to automatically set up pnpm. This is the recommended option.
3
Database Setup
Choose whether to set up a PostgreSQL database using Docker. If you select Yes:
Docker Compose project name
Database username
Container name
Database name
Database password
will be requested, and the packages/api/.env file will be automatically generated with this information.