Configure the CLI

The config namespace contains all the commands that you will need to configure the CLI as per your requirements. The CLI, by default, uses the North America (NA) region. However, If you wish to configure the CLI to use on any other region, you can use the following set of commands.

Prerequisites

Commands

Get region

The config:get:region command will return the name of the region on which you are performing actions in Contentstack, via CLI.

Usage

csdx config:get:region

Set region

The config:set:region command lets you select a region, from the available Contentstack regions, to perform actions using CLI.

Usage

csdx config:set:region <Region>

Arguments

  • Region: Specifies the region that you want to use while executing the CLI commands. Possible values are as follows:
    • EU for Europe
    • NA for North America

Example

csdx config:set:region EU

Set custom host and region

By using the config:set:region command, you can also set a custom host for Content Delivery and Content Management APIs, and set a custom region name for the hosts.

Usage

csdx config:set:region -d <custom_cda_host_url> -m <custom_cma_host_url> -n <custom_region_name>

Options

  • -d, --cda=cda: Custom host to set for the Content Delivery API. If this option is used, then cma and name options are required.
  • -m, --cma=cma: Custom host to set for the Content Management API. If this option is used, then cda and name options are required.
  • -n, --name=name: The name for the region. If this option is used, then cda and cma options are required

Example

csdx config:set:region -d "https://in-cda.contentstack.com" -m "https://in-api.contentstack.com" -n "India"

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

top-arrow