Use the command line interface (CLI) to manage Datastore
The Experience Cloud CLI lets you manage products that are part of the Squiz Digital Experience Platform (DXP).
If you are using Datastore, you need to use the command line interface (CLI) to deploy your blueprints.
There are multiple steps required to set up the CLI. However, the process should not take long.
You need to install Node and NPM to use the Experience Cloud CLI.
Install Node and NPM from https://nodejs.org/en/download/.
Ensure you have the right versions by running the following commands, which should each display a version number:
The output should be higher than version 7 for NPM and higher than version 14 for Node, both of which are the minimum supported versions.
|If you already have Node and NPM installed, make sure you are using the minimum supported versions or higher.|
To install the Experience Cloud CLI package, run the following command:
npm install --global @squiz/dxp-cli
When the command has run, you should see the following output:
✔ Successfully added plugins @squiz/dxp - plugin - plugin add - plugin list - plugin remove @squiz/dxp-plugin-core - help - login - logout - whoami
Run the following two commands:
$ rm -rf ~/.config/dxp $ npm uninstall -g @squiz/dxp-cli
You should get some output something like this:
removed 239 packages in 7.252s
You can now repeat the installation step above to install the latest version of the Experience Cloud CLI.
When a new version of the Experience Cloud CLI is released, CLI will prompt the notification message on any command execution like:
$ dxp whoami A new version of DXP CLI is available (x.1.x -> x.2.x). Do you want to continue without upgrading?
It is always recommended to update the Experience Cloud CLI tool to the latest version via
The command installs the latest Experience Cloud CLI tool including all the existing plugins.
Now that you have installed the required plugins and the Experience Cloud CLI package, you can test it out by typing
dxp into your console.
This command lists the basic CLI commands that are now available to you.
Type the following command and press enter:
You should see the following output:
The command-line interface for dxp Usages $ dxp help <command> $ dxp login [--email|--phone-number|--username] [--password] $ dxp logout $ dxp plugin add <plugin> [<plugin>...] $ dxp plugin list $ dxp plugin remove <plugin> [<plugin>...] $ dxp whoami Options --lang The language to use when printing messages to the terminal --version Show the version number Examples $ dxp help add $ dxp login --email firstname.lastname@example.org --password 'my-super-secret-password'
If you want to use product-specific CLI commands, you must install the relevant plugins. For now, this only applies to Datastore, which is a command-line based tool.
Install the Datastore plugin using the following commands:
dxp plugin add @squiz/dxp-plugin-datastore
Read the Datastore documentation for more information on using Datastore.
Sign in to the CLI, use the
dxp login command, and provide your email address and password:
dxp login --username 'email@example.com' --password 'password'
If your sign-in is successful, you see the following confirmation in the terminal.
✔ Login to dxp succeeded
After signing in to Experience Cloud, you can confirm your authentication status with the
dxp whoami command.
If you authenticate successfully, the command returns your email address.