Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erxes CLI

First-party command-line client for erxes.

Install

Node.js 20 or newer is required.

npm install --global --install-links erxes/erxes-cli

--install-links makes npm copy the GitHub package instead of linking its temporary clone.

Confirm the installation:

erxes version
erxes --help

Re-run the install command to update to the latest default-branch revision.

Authenticate

Create a public OAuth client in erxes and enable these public operations:

  • core.contacts.customers.list.v1
  • core.contacts.customers.detail.v1
  • core.contacts.customers.create.v1

Then authenticate using the OAuth device flow:

erxes login \
  --host https://your-erxes-host \
  --client-id <generated-client-id>

Use --no-browser when the CLI should only print the verification URL and code. Named profiles support multiple erxes installations:

erxes --profile production login --host https://example.com --client-id <id>
erxes --profile production whoami

Contacts

erxes contacts list
erxes contacts list --limit 25 --search customer@example.com
erxes contacts get <customer-id>
erxes contacts create --first-name Jane --last-name Doe --email jane@example.com

Add --json to any data command for machine-readable output:

erxes --json contacts list

Environment variables

  • ERXES_HOST — default gateway URL for login
  • ERXES_CLIENT_ID — default public OAuth client ID
  • ERXES_TOKEN — OAuth access token for non-interactive commands; use with ERXES_HOST
  • ERXES_CONFIG_DIR — override the configuration directory

Profile configuration and OAuth credentials are stored separately. On Unix-like systems the configuration directory uses mode 0700 and credential files use mode 0600.

License

MIT

Releases

Packages

Used by

Contributors

Languages