Newer Version Available

This content describes an older version of this product. View Latest

project Commands

Use the project commands to set up a Salesforce DX project.

project:create

Creates a Salesforce DX project in the specified directory or the current working directory. The command creates the necessary configuration files and folders.

Command Syntax

sfdx force:project:create
[--json]
[--loglevel LOGLEVEL]
-n PROJECTNAME
[-t TEMPLATE]
[-d OUTPUTDIR]
[-s NAMESPACE]
[-p DEFAULTPACKAGEDIR]
[-x]

Parameters

--json
Optional

Formats output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: warn
-n | --projectname PROJECTNAME
Required

The name for the new project. Any valid folder name is accepted.

Type: string
-t | --template TEMPLATE
Optional

The template to use to create the project. Supplied parameter values or default values are filled into a copy of the template.

Type: string
Permissible values are: empty, standard, Defaultsfdx-project.json
Default value: empty
-d | --outputdir OUTPUTDIR
Optional

The directory to store the newly created files. The location can be an absolute path or relative to the current working directory. The default is the current directory.

Type: string
-s | --namespace NAMESPACE
Optional

The namespace associated with this project and any connected scratch orgs.

Type: string
-p | --defaultpackagedir DEFAULTPACKAGEDIR
Optional

The default package directory name. Metadata items such as classes and Lightning bundles are placed inside this folder.

Type: string
Default value: force-app
-x | --manifest
Optional

Generates a default manifest (package.xml) for fetching Apex, Visualforce, Lightning web components, Aura components, and static resources.

Type: boolean

Help for project:create

project:upgrade

Updates project configuration and definition files to the latest format.

Command Syntax

sfdx force:project:upgrade
[--json]
[--loglevel LOGLEVEL]
[-f]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: warn
-f | --forceupgrade
Optional

Run all upgrades, even if the project definition files have already been upgraded.

Type: boolean

Help for project:upgrade

Examples:

$ sfdx force:project:upgrade

$ sfdx force:project:upgrade -f