Configuration of the Contentful CLI

Requirements

General

Your added config parameters are stored in a .contentfulrc.json file in your home directory (~/.contentfulrc.json). The values in this map are used for every command.

The CLI will try to find other .contentfulrc.json files upstream. You can create a .contentfulrc.json file in your current directory to use other stored values for your projects.

Config list

Display a table with all currently used values.

$contentful config list

The output should look similar to this:

$┌───────────────────────────────────────────┐
$ activeEnvironmentId: master
$ host: api.contentful.com
$└───────────────────────────────────────────┘

Config add

Add a value to the config file.

$contentful config add --management-token <management-token>

The output should look similar to this:

$ config added successfully

Display a list of all flags/values you can add to the config file.

$contentful config add --help

The output should look similar to this:

$Usage: contentful config add [options]
$
$Options:
$ -h, --help Show help [boolean]
$ --management-token, --mt Contentful management API token
$ --active-space-id, --as active space id
$ --active-environment-id, --ae active environment id
$ --host, --ho management host
$ --proxy, -p Proxy configuration in HTTP auth format:
$ host:port or user:password@host:port [string]
$ --raw-proxy, --rp Pass proxy config as raw config instead of
$ creating a httpsAgent [boolean]
$ --config set all the config options at once

Config remove

Remove a value from the config map.

$contentful config remove --management-token

The output should look similar to this:

$ config removed successfully

Next steps