Skip to content

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

  1. 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…”,

    NPM error

    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.

  2. Create a file to to store your authenticaion variables. Options for storage location:

    • Option 1:
      Create an Arc-specific directory to store the variables mkdir ~/.arcxp-cli && vim ~/.arcxp-cli/.env
    • Option 2:
      Add a file to your home directory to store the variables vim ~/.env

    Add the variables to the file as shown below. You can swap environments by changing which variables are commented out:

    Terminal window
    # sandbox
    CONTENT_BASE=https://api.sandbox.{org}.arcpublishing.com
    ARC_ACCESS_TOKEN={yourToken}
    # prod
    # CONTENT_BASE=https://api.{org}.arcpublishing.com
    # ARC_ACCESS_TOKEN={yourToken}
  3. 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.