@commercecloudintegrations/epx-cli

中文文档
0.3.0发布于 2026/11/06Apache-2.0零依赖构建来源已验证近 30 天下载 3971

epx, a command-line client for the Emporix Commerce APIs

原始使用文档
文档目录18 节
  1. Installation
  2. Install script
  3. Homebrew
  4. Scoop
  5. npm
  6. Release archive
  7. Go
  8. From source
  9. Upgrading
  10. Uninstalling
  11. Getting started
  12. Usage
  13. Commands
  14. Safety
  15. Exit codes
  16. Documentation
  17. Development
  18. License

epx

Release npm Quality gate status Go License Documentation

epx is a command-line client for the Emporix Commerce APIs. It helps you read, script, and change the data of an Emporix tenant right from the terminal.

Documentation: commerce-cloud-integrations.github.io/emporix-cli covers installation, authentication, every command, and the Emporix API coverage.

With epx, you can:

  • Read products, categories, catalogs, prices, availability, customers, orders, and nearly every other Emporix resource as a table, CSV, JSON, YAML, or JSON Lines.
  • Filter, sort, and page through any list without writing paging code.
  • Change data safely: every write shows its exact request with --dry-run and asks before it sends.
  • Call any Emporix API endpoint with epx api, using only the OAuth scopes you name.
  • Script reliably with stable output and exit codes that tell a missing item from a missing scope.

epx demo

epx is an unofficial project. It isn't affiliated with or endorsed by Emporix.

Installation

epx is a single binary for macOS, Linux, and Windows, on x64 (amd64) and arm64.

Install script

On macOS or Linux:

curl -fsSL https://github.com/commerce-cloud-integrations/emporix-cli/releases/latest/download/install.sh | sh

On Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://github.com/commerce-cloud-integrations/emporix-cli/releases/latest/download/install.ps1 | iex"

The script downloads the latest release for your platform, checks it against the release's checksums and installs epx into ~/.local/bin (on Windows %LOCALAPPDATA%\Programs\epx\bin) without sudo, adding that directory to your PATH if needed. On macOS and Linux, it installs the man pages into ~/.local/share/man/man1. Set EPX_VERSION (such as v0.3.0) to pin a release, EPX_INSTALL_DIR to choose the directory, or EPX_NO_MODIFY_PATH=1 to leave your shell profile alone.

Homebrew

On macOS or Linux:

brew install commerce-cloud-integrations/tap/epx

Homebrew installs the binary, the man pages and shell completion for bash, zsh and fish.

Scoop

On Windows, in PowerShell:

scoop bucket add commerce-cloud-integrations https://github.com/commerce-cloud-integrations/scoop-bucket
scoop install commerce-cloud-integrations/epx

npm

With Node.js 18 or later:

npm install --global @commercecloudintegrations/epx-cli

npm installs only the binary of your platform. Nothing is compiled and no install script runs. To run epx once without installing it:

npx @commercecloudintegrations/epx-cli version

Release archive

Each release holds an archive per platform and a checksums file. For example, on Linux x64:

version=v0.3.0
base=https://github.com/commerce-cloud-integrations/emporix-cli/releases/download/$version
curl -fsSLO "$base/epx_${version}_linux_amd64.tar.gz" &&
  curl -fsSLO "$base/epx_${version}_checksums.txt" &&
  sha256sum --check --ignore-missing "epx_${version}_checksums.txt" &&
  tar -xzf "epx_${version}_linux_amd64.tar.gz" &&
  sudo install "epx_${version}_linux_amd64/epx" /usr/local/bin/epx

On macOS, use shasum -a 256 --check --ignore-missing instead of sha256sum.

Go

With Go 1.27.3 or later:

go install github.com/commerce-cloud-integrations/emporix-cli/cmd/epx@latest

From source

git clone https://github.com/commerce-cloud-integrations/emporix-cli.git
cd emporix-cli
go build -o bin/epx ./cmd/epx

Upgrading

Installed withUpgrade
Homebrewbrew upgrade epx
Scoopscoop update epx
npmnpm update --global @commercecloudintegrations/epx-cli
The install scriptRun the script again.
A release archiveReplace the binary with the one from the new release.
GoRun go install again.

Uninstalling

  1. If you use profiles, remove each one with epx profile remove NAME, which also deletes its client secret from the OS keychain.
  2. Remove epx: brew uninstall epx, scoop uninstall epx or npm uninstall --global @commercecloudintegrations/epx-cli, or delete the epx binary you installed.
  3. Delete the epx folder from your configuration directory: ~/.config on Linux, ~/Library/Application Support on macOS, %AppData% on Windows.

Getting started

epx authenticates with an Emporix API key. Create a key with only the scopes of the commands you run, then give it to epx through the environment:

export EMPORIX_TENANT=acme1
export EMPORIX_CLIENT_ID=...
export EMPORIX_CLIENT_SECRET=...

Or keep it in a profile, whose client secret goes to the OS keychain:

epx profile add dev --tenant acme1 --client-id ... --site AcmeStore_NL   # asks for the secret

Then make your first reads:

epx auth status --scope product.product_read_unpublished    # check the key and its scopes
epx sites list
epx products list --query published:false --sort code:desc --limit 20
epx products get 100200 -o json
epx api get '/catalog/{tenant}/catalogs'                     # any endpoint

And preview a write before you send it:

epx units create --file gram.json --dry-run    # print the exact request
epx units create --file gram.json              # send it after you confirm

Usage

epx [command]

# Run `--help` for detailed information about a command, its flags, and its scopes
epx [command] --help

# Or read the manual: epx, and each top-level command (installed by Homebrew, the script and npm)
man epx
man epx-products

Commands

Every command's help names the OAuth scopes it requests. The CLI reference documents every command and flag.

AreaCommands
Products and catalogproducts, categories, category-trees, catalogs, brands, labels, media, product-templates, units
Prices and promotionsprices, price-lists, price-models, fees, taxes, currencies, exchange-rates, coupons, reward-points
Stock and shippingavailability, shipping, delivery-times
Customers and B2Bcustomers, segments, legal-entities, customer-locations, contact-assignments, shopping-lists
Orders and checkoutcarts, quotes, orders, returns, invoice-jobs, payment-modes, payment-transactions
Vendorsvendors, vendor-locations
Tenant setupsites, countries, regions, configurations, iam, webhooks, schemas, custom-entities, sequential-ids, session-contexts, imports, changelog
Search and AIsearch, indexing, ai
Any endpointapi get|post|put|patch|delete
epx itselfauth, profile, completion, version

Safety

  • Reads change nothing, including those that Emporix serves as POST or PUT, such as searches and shipping quotes.
  • Writes are explicit. Every write shows its exact request with --dry-run, asks before it sends (a delete only once you type what it deletes), needs --yes in scripts, and is never sent again once it may have reached Emporix.
  • Least privilege. Every command requests a token with only the scopes it needs, and fails with exit code 3 when your API key lacks one, instead of silently returning less data. Reads that need a write-capable scope run only with --allow-write-scope.
  • Credentials stay private. epx reads its API key from the environment or a profile, never from flags, and never prints its token or client secret.
  • One host, HTTPS only. Requests go only to the configured API host, over HTTPS (plain HTTP only to a loopback address, such as a local test server), and redirects are never followed.

-o json and -o yaml print responses as Emporix sends them, secrets included. See the security model.

Exit codes

CodeMeaning
0Success
1Error
2Invalid usage or configuration; nothing was sent
3Authentication failed or scopes missing
4Not found
5Conflict: the item changed since you read it, already exists, or can't take the change in its current state; the error says what to do next

Documentation

The epx documentation covers installation, authentication, output formats, lists, writes, scripting, and the Emporix API coverage of every command. COMPATIBILITY.md lists the Emporix API operations epx sends, per reference version.

Development

epx is written in Go with Cobra.

go build -o bin/epx ./cmd/epx
go test ./...    # API calls go to local fake servers; no credentials needed

Besides Cobra, epx depends on go-keyring for the client secrets of profiles in the OS keychain (no cgo), and on x/term and x/sys to read a secret without showing it and to lock the configuration file on Windows.

See CONTRIBUTING.md to report a bug or send a change, SECURITY.md to report a vulnerability, and CHANGELOG.md for the changes in each release.

License

Licensed under the Apache License 2.0.

epx is maintained by Commerce Cloud Integrations.

版本与发布记录

@commercecloudintegrations/epx-cli 共发布 29 个版本,首次发布于 2026/10/22;过去 12 个月发布了 29 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.0latest2026/11/064 天前
0.3.0-darwin-x64darwin-x642026/11/064 天前
0.3.0-darwin-arm64darwin-arm642026/11/064 天前
0.3.0-win32-arm64win32-arm642026/11/064 天前
0.3.0-linux-arm64linux-arm642026/11/064 天前
0.3.0-linux-x64linux-x642026/11/064 天前

其他发布通道:win32-x64 → 0.3.0-win32-x64,linux-x64 → 0.3.0-linux-x64,linux-arm64 → 0.3.0-linux-arm64,win32-arm64 → 0.3.0-win32-arm64,darwin-arm64 → 0.3.0-darwin-arm64,darwin-x64 → 0.3.0-darwin-x64。

关于 @commercecloudintegrations/epx-cli 的常见问题

@commercecloudintegrations/epx-cli 是什么?

epx, a command-line client for the Emporix Commerce APIs

如何安装 @commercecloudintegrations/epx-cli?

在项目目录运行 npm install @commercecloudintegrations/epx-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 epx,可以用 npx epx 直接运行。

@commercecloudintegrations/epx-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/commercecloudintegrations__epx-cli 是否存在。

@commercecloudintegrations/epx-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@commercecloudintegrations/epx-cli 可以商用吗?

@commercecloudintegrations/epx-cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@commercecloudintegrations/epx-cli 的下载量有多少?

根据 npm 官方下载统计,@commercecloudintegrations/epx-cli 在 2026/10/11 – 2026/11/09 这 30 天内被下载 3,971 次,日均约 132 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@commercecloudintegrations/epx-cli 还在维护吗?

最新版本 0.3.0 发布于 2026/11/06(4 天前);至今共发布 29 个版本,其中过去 12 个月发布了 29 个;首次发布于 2026/10/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。