community Commands (Deprecated)

Use the community commands to create and publish an Experience Cloud site, and view a list of available templates in you org.

force:community:create (Deprecated)

Creates an Experience Cloud site using a template.

As of January 19, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style community create command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --templatename. New name: --template-name.
  • Changed flag name: Old name --urlpathprefix. New name: --url-path-prefix.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 19, 2023.

Warning

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 for force:community:create

1sfdx force:community:create --name 'My Customer Site' --templatename 'Customer Service' --urlpathprefix customers --description 'My customer site'
1sfdx force:community:create -n partnercentral -t 'Partner Central' -p partners
1sfdx force:community:create -n lwrsite -t 'Build Your Own (LWR)' -p lwrsite templateParams.AuthenticationType=UNAUTHENTICATED

Command 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/.sf/sf.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 https://MyDomainName.my.site.com and you’re creating a customer site, enter 'customers' to create the unique URL

https://MyDomainName.my.site.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 (Deprecated)

Publishes an Experience Builder site to make it live.

As of January 19, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style community publish command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 19, 2023.

Warning

Help for force:community:publish

Each time you publish it, you update the live site with the most recent updates.

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.

Examples for force:community:publish

1sfdx 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/.sf/sf.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 (Deprecated)

Retrieves the list of templates available in your org.

As of January 19, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style community list template command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 19, 2023.

Warning

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.

Examples for force:community:template:list

1sfdx force:community:template:list

Command 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/.sf/sf.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