Skip to content
pdcli
Get started

Config & environment

A flat reference for how pdcli is configured. For the workflow, see Profiles & configuration.

  1. Flags--output, --profile, --timeout, … (--company and --api-token exist only on pdcli auth login.)
  2. Environment variablesPDCLI_COMPANY_DOMAIN, PDCLI_API_TOKEN, PDCLI_PROFILE, …
  3. Profile config — per-profile keys in the config file.
  4. Global config — shared defaults.
  5. Built-in defaults.

The company domain and the token resolve independently, each down this chain. So a profile domain plus an env token (PDCLI_API_TOKEN=… pdcli deal list), or an env domain plus the keychain token, both work.

VariablePurpose
PDCLI_COMPANY_DOMAINCompany subdomain (acme from acme.pipedrive.com). Forms and locks the API host.
PDCLI_API_TOKENPersonal API token, sent as x-api-token. Preferred over --api-token so it stays out of shell history.
PDCLI_PROFILEActive profile name (same as --profile).
PDCLI_CLIENT_IDOAuth app client ID (used with auth login --oauth).
PDCLI_CLIENT_SECRETOAuth app client secret (used with auth login --oauth).
NO_COLORAny value disables colored output (same as --no-color).
DEBUGSet to pd:* for debug logging (--verbose enables this automatically).

Setting PDCLI_COMPANY_DOMAIN + PDCLI_API_TOKEN is the recommended way to run in CI — no keychain needed. Env values take precedence over stored credentials.

Every command accepts these. Run any command with --help to confirm.

FlagDefaultDescription
--output, -otable (TTY) / json (piped)Output format: table, json, yaml, or csv.
--jq <expr>Filter output through a jq expression.
--fields <a,b,c>Comma-separated columns to display.
--profile <name>defaultNamed auth profile (env PDCLI_PROFILE).
--no-coloroffDisable colored output.
--verboseoffShow request path, status, and error_info on errors; enables pd:* debug.
--no-retryoffDisable automatic retry on 429 and 5xx.
--timeout <ms>30000Per-request timeout in milliseconds.
--limit <n>Max items to return from a list (auto-pages up to this; API caps a page at 500).

Output defaults to a table in a TTY and JSON when piped; --output overrides both.

Config is per profile. pdcli config set <key> <value> writes to the active profile and pdcli config get <key> reads it back (config get prints not set for an unset key). These keys are written and read by pdcli:

KeySet byDescription
company_domainauth loginBare company subdomain for the profile's API host.
auth_modeauth logintoken or oauth. Selects how credentials are resolved.
default_outputyouDefault output format (table/json/yaml/csv) when no --output flag is given. Applies to errors too when set to json.
Terminal window
pdcli config set company_domain acme
pdcli config get company_domain # → acme
pdcli config list # all keys for the active profile

The token is never stored in config — only in the OS keychain. See Security model.

Config is managed by conf under the project name pdcli, so the file lives in your platform's standard config directory:

PlatformPath
Linux~/.config/pdcli/config.json (XDG)
macOS~/Library/Preferences/pdcli-nodejs/config.json
Windows%APPDATA%\pdcli-nodejs\Config\config.json

It holds only activeProfile, the non-secret per-profile keys above, and any command aliases under the global aliases key (shared across profiles). Credentials are in the OS keychain, not this file.

pdcli v0.18.0 · MIT · not affiliated with Pipedrive