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:
| Task | Command group | Page |
|---|---|---|
| Copy configurations from one namespace to another, for example from acceptance to production | ewx-cli config transfer | Managing configurations |
| Store configurations in a git repository and deploy from it | ewx-cli config download / upload | Managing configurations |
| See what a release would change before running it | --dry-run | Managing configurations |
| Roll a release back | ewx-cli config upload-history revert | Upload history and rollback |
| Copy dashboards to other users or namespaces | ewx-cli config dashboards | Dashboards |
| Draw the dependencies of a configuration set | ewx-cli config describe | Describing configurations |
| Switch every trigger schedule off for a maintenance window and back on afterwards | ewx-cli trigger-schedules | Trigger schedules |
| Find slow or complex rules and flows | ewx-cli analyze | Analyzing 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-sharedrepository in theewx-globalArtifact 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
- macOS / Linux
- Windows (PowerShell)
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
mkdir my_ewx_cli
cd my_ewx_cli
py -3.13 -m venv .venv
.venv\Scripts\Activate.ps1
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
If Activate.ps1 is blocked by the execution policy, run Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned once and reopen PowerShell.
Install with uv
Use this pyproject.toml as a starting point:
[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:
- macOS / Linux
- Windows (PowerShell)
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
gcloud auth application-default login
$env:UV_INDEX_EWX_GLOBAL_USERNAME = "oauth2accesstoken"
$env: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
| Symptom | Cause and fix |
|---|---|
401/403 or Authorization error from pkg.dev | Your 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 versions | pip 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 found | Install 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 pytest | Confirm 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.