Skip to content
pdcli
Get started

Profiles & configuration

pdcli stores settings per profile. Each profile has its own company domain, auth mode, and stored credentials, so you can keep several Pipedrive accounts side by side. The active profile defaults to default.

Create a profile by logging in with --profile; the name is created on first use:

Terminal window
pdcli auth login --profile work
pdcli auth login --profile personal

List, switch, and inspect the active profile:

Terminal window
pdcli profile list
* default (authenticated)
work (authenticated)
personal (authenticated)

The * marks the active profile.

Terminal window
pdcli profile use work # switch the active profile
pdcli profile current # print the active profile name

Run a single command against another profile without switching — the global --profile flag works on every command:

Terminal window
pdcli deal list --profile work

config get/set/list operate on the active profile (or the one named with --profile):

Terminal window
pdcli config set company_domain acme
pdcli config set default_output json
pdcli config get company_domain
pdcli config list
pdcli config unset default_output # remove a key from the active profile
company_domain=acme
auth_mode=token
default_output=json

config set default_output validates the value — it must be table, json, yaml, or csv, otherwise the command exits 64 and lists the accepted formats.

Common keys:

KeySet byPurpose
company_domainauth loginThe acme in acme.pipedrive.com; builds the API host.
auth_modeauth logintoken or oauth.
default_outputyouDefault output format when no --output flag is given.

Credentials (the token, or the OAuth bundle) are never in config — they live only in the OS keychain.

Save a frequently typed command as a short alias, then invoke it by name:

Terminal window
pdcli alias set wd "deal list --status won"
pdcli alias list
pdcli alias unset wd

Aliases are stored globally, not per profile — they're shared across every profile. A name that would shadow a real pdcli command is refused (exit 64), so an alias can never mask a built-in.

Aliases execute with your full credentials and can wrap destructive commands (api DELETE, merge) — review aliases in shared configs before running them. Alias writes are not safe under concurrent pdcli invocations sharing one config (last write wins).

For any setting, the most specific source wins:

command-line flag > environment variable > profile config

So PDCLI_COMPANY_DOMAIN=acme pdcli deal list overrides the profile's company_domain, and PDCLI_API_TOKEN overrides the keychain token for that run. (The --company and --api-token flags exist only on pdcli auth login, where they take precedence over the environment.)

VariableEffect
PDCLI_COMPANY_DOMAINCompany subdomain (acme). Overrides profile config.
PDCLI_API_TOKENPersonal API token. Used instead of the keychain; no keychain needed.
PDCLI_PROFILEActive profile name (same as --profile).
PDCLI_CLIENT_IDOAuth app client ID, read by auth login --oauth.
PDCLI_CLIENT_SECRETOAuth app client secret, read by auth login --oauth.
NO_COLORAny value disables colored output (same as --no-color).

Together, PDCLI_COMPANY_DOMAIN + PDCLI_API_TOKEN are all you need for a fully non-interactive, keychain-free run — ideal for CI and agents:

Terminal window
PDCLI_COMPANY_DOMAIN=acme PDCLI_API_TOKEN=$TOKEN pdcli deal list --output json
pdcli v0.18.0 · MIT · not affiliated with Pipedrive