community Commands
force:community:create
Help for force:community:create
See "Which Experience Cloud Template Should I Use?" in Salesforce Help for more information about the different template types available for Experience Cloud.
When creating a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED, UNAUTHENTICATED, or AUTHENTICATED_WITH_PUBLIC_ACCESS. Name and values are case-sensitive. See "ExperienceBundle" in the Metadata API Developer Guide for more information.
When you execute this command, it creates the site in preview status, which means that it isn’t yet live. After you finish building your site, you can make it live.
If you have an Experience Builder site, publish the site using the sfdx force:community:publish command to make it live.
If you have a Salesforce Tabs + Visualforce site, activate the site to make it live by updating the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate.
For Experience Builder sites, activating the site just sends out a welcome email to site members.
Examples:
1$ sfdx force:community:create --name "My Customer Site" --templatename "Customer Service" --urlpathprefix customers --description "My customer site"1$ sfdx force:community:create -n partnercentral -t "Partner Central" -p partners1$ sfdx force:community:create -n lwrsite -t "Build Your Own (LWR)" -p lwrsite templateParams.AuthenticatedType=UNAUTHENTICATEDCommand Syntax
- sfdx force:community:create
- [--json]
- [--loglevel LOGLEVEL]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
- -n NAME
- -t TEMPLATENAME
- -p URLPATHPREFIX
- [-d DESCRIPTION]
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: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
- -n | --name NAME
- Required
-
The name of the site to create.
- Type: string
- -t | --templatename TEMPLATENAME
- Required
-
The template to use to create the site, such as the Customer Service template. Run force:community:template:list to see which templates are available in your org.
- Type: string
- -p | --urlpathprefix URLPATHPREFIX
- Required
-
The URL to append to the domain that you created when you enabled Digital Experiences for this org. For example, if your domain name is UniversalTelco.force.com and you’re creating a customer site, enter "customers" to create the unique URL
UniversalTelco.force.com/customers.
- Type: string
- -d | --description DESCRIPTION
- Optional
-
The description of the site. The description displays in Digital Experiences - All Sites in Setup and helps with site identification.
- Type: string
force:community:publish
Help for force:community:publish
When you publish an Experience Builder site for the first time, you make the site’s URL live and enable login access for site members.
Additionally, to send a welcome email to all site members, you must activate the site. (Activation is also required to successfully set up SEO for Experience Builder sites.) To activate a site, update the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate.
Subsequently, each time you publish the site, you update the live site with all changes made to the site since it was last published.
An email notification informs you when your changes are live.
Example:
1$ sfdx force:community:publish --name "My Customer Site"Command Syntax
- sfdx force:community:publish
- [--json]
- [--loglevel LOGLEVEL]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
- -n NAME
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: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
- -n | --name NAME
- Required
-
The name of the Experience Builder site that you want to publish.
- Type: string
force:community:template:list
Help for force:community:template:list
See "Which Experience Cloud Template Should I Use?" in Salesforce Help for more information about the different template types available for Experience Cloud.
Example:
1$ sfdx force:community:template:listCommand Syntax
- sfdx force:community:template:list
- [--json]
- [--loglevel LOGLEVEL]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
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: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string