Skip to main content

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

Installation

Installing with uv is my recommendation.

Install uv if it is not already available.

To install the latest published package 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

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

Run the CLI glcli configure command.

glcli configure

You will be prompted to enter your GreenLake Activate API token. This text is hidden.

This command is essentially doing this:

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

Alternatively, you can set the environment variable manually:

export CREDENTIAL_1="your_api_key_here"

Credential sources are checked in this order:

  1. A non-empty CREDENTIAL_1 environment variable.
  2. $XDG_CONFIG_HOME/greenlake-activate-cli/.env, when XDG_CONFIG_HOME is set.
  3. ~/.config/greenlake-activate-cli/.env.
  4. .env in the current directory, retained for development and backward compatibility.

The configuration file format is:

CREDENTIAL_1=<your_api_key_here>

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.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for greenlake-activate-cli 0.2.0
File Size Uploaded
greenlake_activate_cli-0.2.0.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for greenlake-activate-cli 0.2.0
File Interpreter ABI Platform
greenlake_activate_cli-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / greenlake_activate_cli-0.2.0.tar.gz

Download URL greenlake_activate_cli-0.2.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
71468294495d770959f4ac6c918be7f093868350885886fdb0e8728b7190101a
BLAKE2b-256 checksum
How to use checksums
cece17dbff5b7cd488441617e8723daff345ccb9902d0d35ba81c0182567c41a
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.2.0-py3-none-any.whl

Download URL greenlake_activate_cli-0.2.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135f22506c0d28e9ca57adc0f91cf0a788b927fbb68b935b72a5c781f9577a35
BLAKE2b-256 checksum
How to use checksums
1042e658c34b0c21b108b1f8e671282b72c9a8874c56f9dcd299cdaaf2a3e07b
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 history Release notifications | RSS feed

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page