Install the CLI

This guide will help you how to install command-line interface (CLI).

Prerequisites

Install CLI

To install CLI as a global module in your machine, open your terminal (command prompt) and run this command:

npm install -g @contentstack/cli

Once the CLI is successfully installed, you can use the csdx command from your terminal. The csdx is a top-level namespace in Contentstack that gives you access to various other commands to help you interact with Contentstack.

Additional Resource: Visit our CLI GitHub's page for more information. Also you can read more about CLI on the npm page.

Next, let’s verify the CLI installation.

Verify installation

Verify your installation by running the csdx --help, in your terminal, to get a list of commands that will help you to interact with Contentstack.

CLI_installation

As shown in the above image, the csdx help namespace contains other namespaces within it.
Let’s understand the Namespaces in detail.

Namespaces

Namespace is used to categorize commands as per their functionality or purpose.

The following namespaces exist within csdx:

Note: The guide to create your own plugin within csdx is yet to come. But, as our CLI is built using the oclif package, you can create your custom plugin by referring to oclif plugin documentation.

Here are the commands within each namespace:

To keep yourself updated with our CLI, refer to the section below to check the CLI version on your machine and update it

Check CLI Version

To check the current version of CLI, installed on your machine, run this command in the terminal:

csdx --version

Running this command will display the current version, as shown below:

image.png

Update CLI Version

As mentioned above, you can check the version of CLI installed on your machine.
To get the latest version of CLI, run the following command in your terminal:

npm install @contentstack/cli update

Next Step

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

^