skuid-sfdx

skuid-sfdx is a plugin for Salesforce’s command line interface (CLI), also known as Salesforce DX (SFDX).

SFDX can be used for a variety of org management actions, and the skuid-sfdx plugin is used for retrieving and deploying Skuid pages to orgs.

Prerequisites

  • Some basic knowledge of the command line is required, including how to open and use a command line program such as Terminal or Powershell.
    • You should feel comfortable interacting with the file system with commands like cd, mv, and rm.
    • You should feel comfortable using the skuid-sfdx plugin with the necessary environment variables and flags.
  • We assume you’ve already installed and set up SFDX, as well as configured authentication to any orgs you want to connect to.

Installation

Install the skuid-sfdx plugin via SFDX’s plugin:install command:

echo 'y' | sfdx plugins:install skuid-sfdx

Note: When you install an sfdx plugin, it will ask you to trust the plugin by typing y. The echo 'y' above skips that step as a convenience.

Why do this? Currently, only Salesforce’s internal developers can sign plugins. Because other plugin creators cannot sign their SFDX plugins so they are “trusted,” the echo 'y' is necessary for the time being.

To use skuid-sfdx in a CI environment, you will either need to auto-trust the plugin with echo 'y' as above or add the plugin to a whitelist of trusted SFDX plugins, as described in the “CI and CD Impact” section of this Salesforce blog post.

Usage

Currently skuid-sfdx is designed to do two things:

  1. Pull Skuid pages from a Salesforce org and store it on the local machine.
  2. Push Skuid pages from the local machine to a Salesforce org.

Because skuid-sfdx is an SFDX plugin, all commands are evoked through it using the following syntax:

sfdx skuid:[command] [options]

Pulling pages

Using sfdx skuid:page:pull will pull all pages from an org to the local machine.

After running this command, skuid-sfdx will report the results of the action:

sfdx skuid:page:pull
Wrote 85 pages to skuidpages

Options

It’s also possible to use options with this command for more advanced actions:

# Pull Skuid pages in a different org in a certain module
sfdx skuid:page:pull --targetusername [email protected] --module CommunityPages
# Only pull Skuid pages that have no module set
sfdx skuid:page:pull --nomodule
# Pull specific pages and store them in a newpages directory
sfdx skuid:page:pull --page Page1,Page2,Page3 --dir newpages

The following options are available:

  • --dir=dir: Output directory to write pages to.
    • Shortcut: -d
  • --module=module: Module name(s), separated by a comma.
    • Shortcut: -m
  • --page=page: Page name(s), separated by a comma.
  • Shortcut: -p
  • --targetusername=targetusername: Username or alias for the target org; overrides default target org set within SFDX
    • Shortcut: -u
  • --apiversion=apiversion: Override the API version used for API requests made by this command
  • --json: Format output as JSON
  • --loglevel=level: Logging level for this command invocation. Defaults to WARN. Options include:
    • trace
    • debug
    • info
    • warn
    • error
    • fatal
    • TRACE
    • DEBUG
    • INFO
    • WARN
    • ERROR
    • FATAL
  • --nomodule: Retrieve only those pages that do not have a module

Pushing pages

Using sfdx skuid:page:push will push all pages in the current directory to the default Salesforce org set within SFDX.

After running this command, skuid-sfdx will report the results of the action:

sfdx skuid:page:push
3 Pages successfully pushed.

Options

It’s also possible to use options with this command for more advanced actions:

# Push pages to a different org
sfdx skuid:page:push --targetusername [email protected]
# Push pages within the SalesApp directory, which is several levels down within the skuidpages directory
sfdx skuid:page:push --dir skuidpages/*SalesApp

The following options are available:

  • --dir=dir: Source directory to push pages from. Use of the * wildcard is permitted for globbing.
    • Shortcut: -d
  • --targetusername=targetusername: Username or alias for the target org; overrides default target org set within SFDX
    • Shortcut: -u
  • --apiversion=apiversion: Override the API version used for API requests made by this command
  • --json: Format output as JSON
  • --loglevel=level: Logging level for this command invocation. Defaults to WARN. Options include:
    • trace
    • debug
    • info
    • warn
    • error
    • fatal
    • TRACE
    • DEBUG
    • INFO
    • WARN
    • ERROR
    • FATAL
  • --nomodule: Retrieve only those pages that do not have a module

Contributing

For more information about contributing to this plugin, see skuid-sfdx Github repository.