GreenLake Activate CLI
The purpose of this is to help manage devices in HPE GreenLake Activate with an easy to use CLI interface.
Setup
Requirements
- Python 3.14 or newer
- An HPE GreenLake Activate API credential
- Network access to
activate.arubanetworks.com
The CLI uses the following Python packages, which are installed automatically:
- Typer
- Requests
- Rich
- Python Dotenv
Install With uv
Install uv if it is not already available. For a published release, install the CLI as a global command:
uv tool install greenlake-activate-cli
This installs the CLI in an isolated environment and makes glcli available from
any directory. If uv reports that its tool directory is not on your PATH, run:
uv tool update-shell
Restart your shell, then verify the installation:
glcli --help
To upgrade or remove the installed CLI:
uv tool upgrade greenlake-activate-cli
uv tool uninstall greenlake-activate-cli
pipx is an alternative isolated installer:
pipx install greenlake-activate-cli
For development from a source checkout, clone the repository and run:
git clone <repository-url>
cd greenlake_activate_cli
uv sync
The uv sync command creates the project environment, installs the application and
its dependencies, and makes the glcli command available through uv run:
uv run glcli --help
To install the development dependencies, including the test suite, use:
uv sync --dev
Install With Python and pip
Create a virtual environment, activate it, and install the project from the cloned repository:
python3.14 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .
The glcli command is then available directly:
glcli --help
Configure Credentials
The recommended configuration file is:
mkdir -p ~/.config/greenlake-activate-cli
printf 'CREDENTIAL_1=your_api_key_here\n' \
> ~/.config/greenlake-activate-cli/.env
chmod 600 ~/.config/greenlake-activate-cli/.env
The CLI also accepts the environment variable directly:
export CREDENTIAL_1="your_api_key_here"
Credential sources are checked in this order:
- A non-empty
CREDENTIAL_1environment variable. $XDG_CONFIG_HOME/greenlake-activate-cli/.env, whenXDG_CONFIG_HOMEis set.~/.config/greenlake-activate-cli/.env..envin the current directory, retained for development and backward compatibility.
The configuration file format is:
CREDENTIAL_1=<your_api_key_here>
Do not commit .env or share the credential. If no source contains CREDENTIAL_1,
the CLI reports the supported locations and exits before sending an inventory query.
Usage
Query inventory by serial number:
glcli query serial PHWLKAS02 PHWLKAS03
Query inventory by MAC address:
glcli query mac aa:bb:cc:00:11:22 dd:ee:ff:33:44:55
Query inventory by folder ID or folder name:
glcli query folder 5297450
glcli query folder SiteA-South
glcli query folder SiteA-South 5389522
Folder names are matched case-insensitively and exactly. Numeric values are treated
as folder IDs. Folder names are resolved through Activate before the inventory query;
unknown or ambiguous names are rejected. Folder queries currently accept positional
values only and do not support --file.
Serial numbers and MAC addresses can also be loaded from CSV or newline-delimited files:
glcli query serial --file serials.csv
glcli query mac --file mac_addresses.csv
The file reader uses the first column. Serial files may use a serial, serialNumber,
serial_number, serial number, or sn header.
Use --verbose for diagnostic logging:
glcli --verbose query serial PHWLKAS02
Exit codes are 0 for a complete result, 1 when no devices are returned, and
2 when at least one requested identifier is missing.
Run the offline tests with:
uv run pytest
Metadata
Release files for greenlake-activate-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| greenlake_activate_cli-0.1.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| greenlake_activate_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / greenlake_activate_cli-0.1.0.tar.gz
| Download URL | greenlake_activate_cli-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbdb6d3878e808d4342e7633a817bc562c1bb3ace93009db8558ce513f960284
|
|
BLAKE2b-256 checksum How to use checksums |
40552c8102fdd9763791ace6cc304f7c0f6ee3f1e24cee01cd3e5546e594468e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / greenlake_activate_cli-0.1.0-py3-none-any.whl
| Download URL | greenlake_activate_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
199fc8303d5a84ae0e8f86a2624f774498b0249e35ee628071ac01eef1d2852b
|
|
BLAKE2b-256 checksum How to use checksums |
6e0332bddb7cb3ceb52ace54d5310cb7c8d4c16036bf25d874e85940dc8b5ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|