A Salesforce DX project has a specific structure and a configuration file (sfdx-project.json) that identifies the directory as a Salesforce DX project. This command generates the necessary configuration files and directories to get you started.
By default, the generated sfdx-project.json file sets the sourceApiVersion property to the default API version currently used by Salesforce CLI. To specify a different version, set the apiVersion configuration variable. For example: “sf config set apiVersion=57.0 –global”.
Aliases for template generate project
force:project:create
project:generate
Flags
Flag Name (Long)
Flag Name (Short)
Description
‑‑api‑version
N/A
Type: Value
Will set this version as sourceApiVersion in the sfdx-project.json file
Override the api version used for api requests made by this command
‑‑default‑package‑dir
‑p
Type: Value Default value:force-app
Default package directory name.
Metadata items such as classes and Lightning bundles are placed inside this folder.
‑‑flags‑dir
N/A
Type: Value
Import flag values from a directory.
‑‑json
N/A
Type: Boolean
Format output as json.
‑‑lwc‑language
N/A
Type: Value Valid Values:javascript, typescript
Language of the Lightning Web Components. If not specified, “javascript” is used.
When set to 'typescript', generates TypeScript configuration files (tsconfig.json, package.json with TypeScript dependencies, and TypeScript-aware ESLint config). When you deploy the TypeScript-based Lightning Web Components, the TypeScript files are first compiled locally for validation and then the .ts files are deployed to your org for server-side type stripping.
‑‑manifest
‑x
Type: Boolean
Generate a manifest (package.xml) for change-set based development.
Generates a default manifest (package.xml) for fetching Apex, Visualforce, Lightning components, and static resources.
‑‑name
‑n
Type: Value Required
Name of the generated project.
Generates a project directory with this name; any valid directory name is accepted. Also sets the “name” property in the sfdx-project.json file to this name.
‑‑namespace
‑s
Type: Value
Namespace associated with this project and any connected scratch orgs.
‑‑output‑dir
‑d
Type: Value Default value:.
Directory for saving the created files.
The location can be an absolute path or relative to the current working directory. The default is the current directory.
The template determines the sample configuration files and directories that this command generates. For example, the empty template provides these files and directory to get you started.
.forceignore
config/project-scratch-def.json
sfdx-project.json
package.json
force-app (basic source directory structure)
The standard template provides a complete force-app directory structure so you know where to put your source. It also provides additional files and scripts, especially useful when using Salesforce Extensions for VS Code. For example:
.gitignore: Use Git for version control.
.prettierrc and .prettierignore: Use Prettier to format your Aura components.
.vscode/extensions.json: When launched, Visual Studio Code, prompts you to install the recommended extensions for your project.