---
canonical: https://amplience.com/developers/docs/dev-tools/cli-tool/setting-up-cli-tool/
title: Setting up the CLI tool
description: Guide for installing and configuring the Amplience Dynamic Content CLI tool, including how to set up API access credentials and use the built-in help system.
image: https://cdn.media.amplience.net/i/ampproduct/Screenshot-1?w=1200&h=630
image_width: 1200
image_height: 630
audience: Developer
date_published: 2022-07-01
date_modified: 2025-04-30
---
# Setting up the CLI tool

This page guides you through how to install and configure the CLI tool. The CLI tool includes comprehensive online help and we show you how to use the to get more information about the parameters and options for each command.

### Installing the CLI tool

You can install the CLI tool using the [Node package manager](https://www.npmjs.com/) with the following command:

```
npm install -g @amplience/dc-cli
```

You can also download an executable for macOS, Windows or Unix from the releases page on [GitHub](https://github.com/amplience/dc-cli/releases).

### Getting help

The CLI tool contains documentation built in to help you use each command. To get help type the following into the command line:

```
dc-cli --help
```

The list of available commands and options is displayed:

```
dc-cli <command>

Commands:
  dc-cli configure            Saves the configuration options to a file
  dc-cli content-item         Content Item
  dc-cli content-repository   Content Repository
  dc-cli content-type-schema  Content Type Schema
  dc-cli content-type         Content Type
  dc-cli event                Event
  dc-cli extension            Extension
  dc-cli hub                  Hub
  dc-cli search-index         Search Index
  dc-cli settings             Settings

Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  --clientId                                                 [string] [required]
  --clientSecret                                             [string] [required]
  --hubId                                                    [string] [required]
  --config        Path to JSON config file

```

To get help for a specific command, add --help to the end of the command.

For example, to get more information about what you can do with content type schemas, enter the following in the command line:

```
dc-cli content-type-schema --help
```

The commands and options available for content type schemas will be displayed by appending --help.

```
Content Type Schema

Commands:
  dc-cli content-type-schema archive [id]   Archive Content Type Schemas
  dc-cli content-type-schema create         Create Content Type Schema
  dc-cli content-type-schema export <dir>   Export Content Type Schemas
  dc-cli content-type-schema get <id>       Get Content Type Schema by ID
  dc-cli content-type-schema import <dir>   Import Content Type Schemas
  dc-cli content-type-schema list           List Content Type Schemas
  dc-cli content-type-schema unarchive      Unarchive Content Type Schemas
  [id]
  dc-cli content-type-schema update <id>    Update Content Type Schema

Options:
  --version       Show version number                                  [boolean]
  --clientId                                                 [string] [required]
  --clientSecret                                             [string] [required]
  --hubId                                                    [string] [required]
  --config        Path to JSON config file
```

### Setting up your access

**API key and secret or personal access token**

The CLI tool uses the Dynamic Content Management API which is [authenticated](https://amplience.com/developers/docs/apis/content-management/content-management-overview) using either an API key and secret, or a [personal access token](https://amplience.com/developers/docs/apis/authorization/personal-access-tokens/) (PAT).

To use an API key and secret, request the key and secret with the [developer persona](https://amplience.com/developers/docs/concepts/permissions) and with permission to read and write to the hubs that you want to use.

When using a PAT, ensure that you are assigned the admin or developer [roles](https://amplience.com/developers/docs/user-guides/manage-accounts/set-permissions/) for the hubs you require.

**Hub ID**

The hub ID is available from the "Properties" menu in the Dynamic Content app, as shown in the image below. Click the icon to the right of each hub id to copy it.

![You can find the id of each hub from the properties window](https://cdn.media.amplience.net/i/ampproduct/Screenshot-1?w=1880&fmt=png 'You can find the id of each hub from the properties window')

**Repository ID (repoId)**

The id of each repository in a hub is shown in the repository window.

![The id of each repository in a hub is shown in repository settings](https://cdn.media.amplience.net/i/ampproduct/Screenshot-2?w=1880&fmt=png 'The id of each repository in a hub is shown in repository settings')

**Folder ID (folderId)**

You can choose to copy and export content from a folder specified with its folderId. To find a folderId use the Content Management API, as explained in the [finding folderIds](https://amplience.com/developers/docs/dev-tools/cli-tool/copy-import-export/#finding-folder-ids) section.

### Configuration

Each CLI tool command will require either an API key and secret or a PAT. This can either be specified on the command line or read from a configuration file. To set up a configuration use the `configure` command:

```
dc-cli configure

Saves the configuration options to a file

Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  --clientId                                                            [string]
  --clientSecret                                                        [string]
  --hubId                                                    [string] [required]
  --patToken                                                            [string]
  --config        Path to JSON config file

```

Specify the client Id, secret and the hub you want to perform operations on from the command line:

```
dc-cli configure --clientId <yourClientId> --clientSecret <yourSecret> --hubId <hubId>
```

You can write a PAT to the configuration file in the same way:

```
dc-cli configure --patToken <yourPAT> --hubId <hubId>
```

By default the configuration file will be written to a file name "dc-cli-config.json" in a directory in your home folder, but you can specify another location in the `config` option.

If you are using multiple hubs and multiple keys and secrets, you may want to create multiple configuration files. Alternatively you can specify the client Id, secret and hub Id, _or_ the PAT and hub Id, for each command.

## Related pages

[Dynamic Content CLI tool on GitHub](https://github.com/amplience/dc-cli)
