---
schema_version: "1"
id: 397b7844f2011ddf753438dec11e5b2665f379546c626d11a4863bdd3fcbf465
title: template generate project
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/template/cli_reference_template_generate_project.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_template_generate_project.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d2585cb7acf0bc2f36fd10869fa36de29421c7f5fc7004e4e320e940d363b377
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# template generate project

Generate a Salesforce DX project.

## Description for template generate project

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 |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Will set this version as sourceApiVersion in the sfdx-project.json file<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;default&#8209;package&#8209;dir</code> | <code>&#8209;p</code> | **Type:** Value<br>**Default value:** `force-app`<br><br>Default package directory name.<br><br>Metadata items such as classes and Lightning bundles are placed inside this folder. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;lwc&#8209;language</code> | N/A | **Type:** Value<br>**Valid Values:** `javascript`, `typescript`<br><br>Language of the Lightning Web Components. If not specified, "javascript" is used.<br><br>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. |
| <code>&#8209;&#8209;manifest</code> | <code>&#8209;x</code> | **Type:** Boolean<br><br>Generate a manifest (package.xml) for change-set based development.<br><br>Generates a default manifest (package.xml) for fetching Apex, Visualforce, Lightning components, and static resources. |
| <code>&#8209;&#8209;name</code> | <code>&#8209;n</code> | **Type:** Value<br>**Required**<br><br>Name of the generated project.<br><br>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. |
| <code>&#8209;&#8209;namespace</code> | <code>&#8209;s</code> | **Type:** Value<br><br>Namespace associated with this project and any connected scratch orgs. |
| <code>&#8209;&#8209;output&#8209;dir</code> | <code>&#8209;d</code> | **Type:** Value<br>**Default value:** `.`<br><br>Directory for saving the created files.<br><br>The location can be an absolute path or relative to the current working directory. The default is the current directory. |
| <code>&#8209;&#8209;template</code> | <code>&#8209;t</code> | **Type:** Value<br>**Valid Values:** `standard`, `empty`, `analytics`, `reactinternalapp`, `reactexternalapp`, `angularinternalapp`, `angularexternalapp`, `agent`<br>**Default value:** `standard`<br><br>Template to use for project creation.<br><br>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.<br><br><ul><li>.forceignore</li><li>config/project-scratch-def.json</li><li>sfdx-project.json</li><li>package.json</li><li>force-app (basic source directory structure)</li></ul><br><br>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:<br><br><ul><li>.gitignore: Use Git for version control.</li><li>.prettierrc and .prettierignore: Use Prettier to format your Aura components.</li><li>.vscode/extensions.json: When launched, Visual Studio Code, prompts you to install the recommended extensions for your project.</li><li>.vscode/launch.json: Configures Replay Debugger.</li><li>.vscode/settings.json: Additional configuration settings.</li></ul><br><br>The analytics template provides similar files and the force-app/main/default/waveTemplates directory.<br><br>The reactinternalapp and reactexternalapp templates provide React-based project scaffolding for internal and external UI bundle use cases.<br><br>The angularinternalapp and angularexternalapp templates provide Angular-based project scaffolding for internal and external UI bundle use cases.<br><br>The agent template provides project scaffolding for building Agentforce agents and includes a sample agent called Local Info Agent. |

## Examples for template generate project

Generate a project called "mywork":

```shell
sf template generate project --name mywork
```

Similar to previous example, but generate the files in a directory called "myapp":

```shell
sf template generate project --name mywork --default-package-dir myapp
```

Similar to prevoius example, but also generate a default package.xml manifest file:

```shell
sf template generate project --name mywork --default-package-dir myapp --manifest
```

Generate a project with the minimum files and directories:

```shell
sf template generate project --name mywork --template empty
```

Generate a project in which the Lightning Web Components use TypeScript rather than the default JavaScript:

```shell
sf template generate project --name mywork --lwc-language typescript
```
<!-- prettier-ignore-end -->
