The GreenNode CLI (grn) is a unified tool to manage your GreenNode services from the command line.
- No dependencies required —
grnis a single binary
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/GreenNodeHub/greennode-cli/main/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/GreenNodeHub/greennode-cli/main/scripts/install.ps1 | iexWindows (CMD — for environments without PowerShell):
curl -fsSL https://raw.githubusercontent.com/GreenNodeHub/greennode-cli/main/scripts/install.cmd -o install.cmd && install.cmd && del install.cmdBuild from source (fallback):
git clone https://github.com/GreenNodeHub/greennode-cli.git
cd greennode-cli/go
go build -o grn .
# place grn on your PATHVerify:
grn --versionUninstall (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/GreenNodeHub/greennode-cli/main/scripts/uninstall.sh | bashWindows + the --purge option (also removes ~/.greennode config + credentials) are documented at https://greennodehub.github.io/greennode-cli/installation/#uninstall.
Before using the GreenNode CLI, you need to configure your credentials. There are three ways:
Method 1: Environment variables
export GRN_CLIENT_ID=your-client-id
export GRN_CLIENT_SECRET=your-client-secret
export GRN_DEFAULT_REGION=HCM-3
export GRN_DEFAULT_PROJECT_ID=pro-xxxxxxxx # optionalMethod 2: Interactive setup (recommended)
grn configureGRN Client ID [None]: <your-client-id>
GRN Client Secret [None]: <your-client-secret>
Default region name [HCM-3]:
Default output format [json]:
Project ID (leave blank to auto-detect) [None]:
Fetching project_id from HCM-3...
Auto-detected project_id: pro-xxxxxxxx
Method 3: Credentials file (manual)
# ~/.greennode/credentials
[default]
client_id = your-client-id
client_secret = your-client-secret# ~/.greennode/config
[default]
region = HCM-3
output = json
project_id = pro-xxxxxxxxCredentials are obtained from the GreenNode IAM Portal under Service Accounts.
Credential resolution order: environment variables take priority over the credentials file.
To use multiple profiles:
grn configure --profile staging
grn --profile staging vks list-clustersFor more configuration options, see the Configuration Guide.
The GreenNode CLI uses a multi-part command structure:
grn <service> <command> [options and parameters]For example, to list your VKS clusters:
grn vks list-clustersTo get help on any command:
grn help
grn vks
grn vks create-cluster --helpTo check the version:
grn --versionCluster
list-clusters— List all VKS clustersget-cluster— Get cluster detailscreate-cluster— Create a new VKS clusterupdate-cluster— Update a VKS clusterdelete-cluster— Delete a VKS cluster
Node Group
list-nodegroups— List node groups for a clusterget-nodegroup— Get node group detailscreate-nodegroup— Create a new node groupupdate-nodegroup— Update a node groupupdate-nodegroup-metadata— Update labels, tags, and taints of a node groupupgrade-nodegroup-version— Upgrade the Kubernetes version of a node grouplist-nodes— List nodes in a node groupdelete-nodegroup— Delete a node group
Versions
list-cluster-versions— List available Kubernetes versions
Auto-Upgrade
set-auto-upgrade-config— Configure auto-upgrade schedule for a clusterdelete-auto-upgrade-config— Delete auto-upgrade config for a cluster
Auto-Healing
config-auto-healing— Configure auto-healing for a cluster
Events
get-cluster-events— Get the list of events for a cluster
Kubeconfig
generate-kubeconfig— Request generation of a cluster kubeconfigupdate-kubeconfig— Fetch and merge the cluster kubeconfig into your kubeconfig file
Quota
get-quota— Get VKS quota limits and current usage
Waiter
wait cluster-active— Wait until a cluster reaches ACTIVE statuswait cluster-deleted— Wait until a cluster is fully deletedwait nodegroup-active— Wait until a node group reaches ACTIVE statuswait nodegroup-deleted— Wait until a node group is fully deleted
The best way to interact with our team is through GitHub:
- Open an issue — Bug reports and feature requests
- Search existing issues before opening a new one
Apache License 2.0 — see LICENSE.