Arc XP CLI
The Arc XP CLI is your command center for streamlining development and automating key workflows. Accelerate engineering tasks by executing processes directly from the command line using the new @arcxp/cli
npm package.
You can use the CLI to manage processes for products such as IFX, Themes, PageBuilder and more.
Setup
-
On your local machine, install the package globally
npm i -g @arcxp/cli
If you get an error like ‘npm package “cli” does not exist…”,
ensure you have the following in your
.npmrc
:~/.npmrc @arcxp:registry=https://registry.npmjs.org/
If you are still having issues, visit https://docs.npmjs.com/getting-started for help. -
Create a file to to store your authenticaion variables. Options for storage location:
- Option 1:
Create an Arc-specific directory to store the variablesmkdir ~/.arcxp-cli && vim ~/.arcxp-cli/.env
- Option 2:
Add a file to your home directory to store the variablesvim ~/.env
Add the variables to the file as shown below. You can swap environments by changing which variables are commented out:
Terminal window # sandboxCONTENT_BASE=https://api.sandbox.{org}.arcpublishing.comARC_ACCESS_TOKEN={yourToken}# prod# CONTENT_BASE=https://api.{org}.arcpublishing.com# ARC_ACCESS_TOKEN={yourToken} - Option 1:
-
Run
arcxp
to confirm the package is running as expected. You should see a prompt for selecting a product. Choose the desired product and follow the prompts.
From here, you can run the CLI globally.
Usage Modes
The CLI offers both script and interactive modes.
Interactive Mode
Interactive mode will guide you through each command and prompt you with questions to input. Run this mode by entering arcxp
and then following the prompts.
Script Mode
Use script mode by running arcxp {productName} [command] [options]
. This can be useful for automating repetitive development tasks.