Skip to main content

ewx-cli

ewx-cli is the command-line tool for working with the configurations of an Energyworx namespace: flows, rules, market adapters, transformation configurations, classifiers, trigger schedules, task boards, namespace properties and more. It resolves the dependencies between them and maps the IDs that differ between namespaces, so a release to production is one reviewed command instead of a checklist.

What you can do with it:

TaskCommand groupPage
Copy configurations from one namespace to another, for example from acceptance to productionewx-cli config transferManaging configurations
Store configurations in a git repository and deploy from itewx-cli config download / uploadManaging configurations
See what a release would change before running it--dry-runManaging configurations
Roll a release backewx-cli config upload-history revertUpload history and rollback
Copy dashboards to other users or namespacesewx-cli config dashboardsDashboards
Draw the dependencies of a configuration setewx-cli config describeDescribing configurations
Switch every trigger schedule off for a maintenance window and back on afterwardsewx-cli trigger-schedulesTrigger schedules
Find slow or complex rules and flowsewx-cli analyzeAnalyzing rules and flows

Every command prints --help; ewx-cli --help lists the command groups and ewx-cli config upload --help the options of one command.

Prerequisites​

  • Python (see the version range on this page)
  • The gcloud CLI
  • A Google Account with access to the python-shared repository in the ewx-global Artifact Registry project. Ask Service Desk to grant it if you do not have it yet.

Authenticate once per machine:

gcloud auth application-default login

Installation​

The examples pin ewx-cli to 26.8.0, the version that matches platform release 26.08. Replace it with the version matching your environment, see Versioning. Python 3.10 to 3.14; the examples use 3.13.

Install with pip

mkdir my_ewx_cli
cd my_ewx_cli
python3.13 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install keyring keyrings.google-artifactregistry-auth
pip install \
--index-url https://europe-west1-python.pkg.dev/ewx-global/python-shared/simple/ \
--extra-index-url https://pypi.org/simple/ \
ewx-cli==26.8.0

Install with uv

Use this pyproject.toml as a starting point:

pyproject.toml
[project]
name = "my-ewx-cli"
version = "0.1.0"
description = "Configuration management for Energyworx namespaces."
requires-python = ">=3.13,<3.14"
dependencies = [
"ewx-cli==26.8.0",
]

[tool.uv]
package = false

[[tool.uv.index]]
name = "ewx-global"
url = "https://europe-west1-python.pkg.dev/ewx-global/python-shared/simple/"
explicit = true

[tool.uv.sources]
ewx-cli = { index = "ewx-global" }

Then resolve and install:

gcloud auth application-default login
export UV_INDEX_EWX_GLOBAL_USERNAME=oauth2accesstoken
export UV_INDEX_EWX_GLOBAL_PASSWORD="$(gcloud auth print-access-token)"
uv sync --python 3.13

The access token expires after an hour. Re-run the UV_INDEX_EWX_GLOBAL_PASSWORD assignment when uv sync reports an authorization error.

Verify with ewx-cli --help. If you also run automated tests, install pytest-bdd-ewx into the same environment.

First run​

The first command against a project asks you to authenticate. Follow Authentication, projects and namespaces once, then try a read-only command such as:

ewx-cli config download company-prd/enrx_org_001 ./configs --flow my_flow

Installation issues​

SymptomCause and fix
401/403 or Authorization error from pkg.devYour Google Account is not authenticated or has no access to the repository. Re-run gcloud auth application-default login; if it persists, ask Service Desk to check your access. With uv, re-export UV_INDEX_EWX_GLOBAL_PASSWORD, the token expires after an hour.
No matching distribution or doesn't match any versionspip is not looking at the Energyworx index (check --index-url) or the pinned version does not exist. Pins follow the platform release, see Versioning; 2.x versions are no longer published.
keyring backend not foundInstall keyring keyrings.google-artifactregistry-auth in the same environment before running pip install against the index.
Activate.ps1 cannot be loaded (Windows)Run Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned once and reopen PowerShell.
Plugin not loaded in pytestConfirm pytest-bdd-ewx is installed in the active environment (pip show pytest-bdd-ewx).

If the problem persists, contact Service Desk with the full command, the full error output, your Python version and whether you use pip or uv.