Skip to main content

Configuration

Precedence of supplied values

The Peridio CLI can be configured three ways, from highest to lowest precedence:

  1. CLI arguments
  2. Environment variables
  3. Configuration files

Configuration files

The Peridio CLI supports profile based configuration files as a means of supplying options that are relevant to many subcommands. A particular profile can be choosen explicitly via --profile. To use this functionality you must specify at least a config.json file and optionally, if you wish to specify API keys via this method, a credentials.json in the same directory.

By default, the directory searched for these files is:

OSDefault config directory
Linux$HOME/.config/peridio
Windows{FOLDERID_RoamingAppData}/peridio/config
macOS$HOME/Library/Application\ Support/peridio

To override this directory, see --config-directory.

config.json

Contains a single object of the format:

Example
{
"version": 1,
"profiles": {
"my-profile-name": {}
},
"signing_key_pairs": {
"my-signing-key-pair-name": {
"signing_key_prn": "prn:1:b8af964b-2736-423c-852b-a19d05e00d83:signing_key:15ba050a-82ee-4381-b461-d42181f9a81b",
"signing_key_private_path": "private.pem"
}
},
"ca_certificates": {
"my-ca-certificate-name": {
"certificate": "certificate.pem",
"private_key": "private-key.pem"
}
}
}
Schema
{
"version": VERSION,
"profiles": {
PROFILE_NAME: {
"base_url": BASE_URL,
"ca_path": CA_PATH
}
},
"signing_key_pairs": {
SIGNING_KEY_PAIR_NAME: {
"signing_key_prn": SIGNING_KEY_PRN,
"signing_key_private_path": SIGNING_KEY_PRIVATE_PATH
}
},
"ca_certificates": {
CA_CERTIFICATE_NAME: {
"certificate": CA_CERTIFICATE_PATH,
"private_key": PRIVATE_KEY_PATH
}
}
...
}
FieldRequiredTypeDescription
VERSIONtrueinteger

Should be 1. See versioning.

PROFILE_NAMEfalsestringThe name of a profile. Corresponds to an entry in credentials.json. A particular profile can be choosen explicitly via --profile.
BASE_URLfalsestringSee --base-url.
CA_PATHfalsestringSee --ca-path.
SIGNING_KEY_PAIR_NAMEfalsestringThe name of a signing key pair. Some commands that make use of signing keys will let you reference this configuration by name.
SIGNING_KEY_PRNtruestringThe PRN of the signing key that corresponds to the private key identified by the sibling SIGNING_KEY_PRIVATE_PATH field.
SIGNING_KEY_PRIVATE_PATHtruestringThe path to a private key's PEM file.
CA_CERTIFICATE_NAMEfalsestringThe name of a CA certificate. Some commands that make use of CA certificates will let you reference this configuration by name.
CA_CERTIFICATE_PATHtruestringThe path to a CA certificate's PEM file.
PRIVATE_KEY_PATHtruestringThe path to a CA certificate's private key's PEM file.

credentials.json

Contains a single object of the format:

Example
{
"my-profile-name": {
"api_key": "my-api-key"
}
}
Schema
{
PROFILE_NAME: {
"api_key": API_KEY
},
...
}
FieldRequiredTypeDescription
PROFILE_NAMEfalsestringThe name of a profile. Must correspond to an entry in config.json. A particular profile can be choosen explicitly via --profile.
API_KEYfalsestringSee --api-key.

Global options

Global options are options that are relevant to many commands. They are supplied after peridio but before a command, e.g., peridio --profile foo products list.

API key

-a, --api-key <api-key>, $PERIDIO_API_KEY

The API key used to authenticate and authorize requests against the Peridio Admin API.

Can be provided via configuration files.

Base URL

-b, --base-url <base-url>, $PERIDIO_BASE_URL

Defaults to https://api.cremini.peridio.com.

The base URL of the Peridio Admin API.

Can be provided via configuration files.

CA path

-c, --ca-path <ca-path>, $PERIDIO_CA_PATH

A path identifying a file containing PEM encoded CA certificates to additionally trust when making API requests.

Can be provided via configuration files.

Config directory

-d, --config-directory <config-directory>, $PERIDIO_CONFIG_DIRECTORY

Defaults to $HOME/Library/Application\ Support/peridio on macOS.

A path identifying the directory the CLI should look within to find Peridio CLI configuration files.

Profile

-p, --profile <profile>, $PERIDIO_PROFILE

Explicitly chooses a profile within a config.json to use. See configuration files.