Sign up for the quarterly Flings Newsletter here!

MyVMware CLI

MyVMware CLI is a command line client used to login and interact with my.vmware.com.
It provides an interface for programmatic query and download of VMware product binaries.

This Fling is in early preview and allows you to find and download:

  • Every product
  • Every version
  • Every file

Note: Any download attempts will be restricted to the entitlements afforded by your my.vmware.com account.

MyVMware CLI is tested and supports Linux or MacOS.
There are 2 different methods to installing and running the MyVMware CLI Fling:

via NodeJS:

Installing using NPM requires NodeJS >= 8.x running on your system.
Some older Linux distros need to have NodeJS manually updated.

Issue the following command to verify the current NodeJS version:

node --version

If required, refer to the NodeJS installation instructions for your distribution here:

https://nodejs.org/en/download/package-manager

Once installed, MyVMware CLI can be leveraged directly via the vmw-cli shell command.
See Instructions for more details.

via Docker:

This method requires that Docker be installed on your system.
Please refer to the installation instructions for your platform at:

https://docs.docker.com/install

On your system (Linux or MacOS) - configure credentials for my.vmware.com using ENV variables:

export VMWUSER='<username>'
export VMWPASS='<password>'

Note: Any download attempts will be restricted to the entitlements afforded by your account.

Alternatively, if using docker commands, you can pass credentials directly to the container instead.

Install

MyVMware CLI can be installed natively via NPM or consumed using a pre-built docker image.
Requested files via the get command will be downloaded to current working directory.

via NPM

Installing using NPM requires NodeJS >= 8.x running on your system.
Some older Linux distros need to have NodeJS manually updated.

Issue the following command to verify the current NodeJS version: node --version
If required, refer to the NodeJS installation instructions for your distribution here:

https://nodejs.org/en/download/package-manager

Once installed, MyVMware CLI can be leveraged directly via the vmw-cli shell command.
See Instructions for more details.

npm install vmw-cli --global

via Docker run

This is where we simply use docker run with the required ENV parameters set:

docker run -t --rm -e VMWUSER='<username>' -e VMWPASS='<password>' -v ${PWD}:/files apnex/vmw-cli <cmd>

Where:

  • <username> is your my.vmware.com username
  • <password> is your my.vmware.com password
  • <cmd> is one of [list, index, refresh, find, get, json]
  • ${PWD} ENV will resolve to current working directory in BASH for file downloads
    See Usage for examples

via Docker exec

This is where we start the container using docker run with the required ENV parameters set.
Subsequent commands are then issued using docker exec commands.
Start the container in background:

docker run -itd --name vmw -e VMWUSER='<username>' -e VMWPASS='<password>' -v ${PWD}:/files --entrypoint=sh apnex/vmw-cli

Where:

  • <username> is your my.vmware.com username
  • <password> is your my.vmware.com password
  • ${PWD} ENV will resolve to current working directory in BASH for file downloads

Then issue one or more docker exec commands:

docker exec -t vmw vmw-cli <cmd>

Clean up docker container when done:

docker rm -f vmw

See Usage for more examples

Index some files in productGroup OVFTOOL430 and NSX-T-240

vmw-cli index OVFTOOL430
vmw-cli index NSX-T-220
vmw-cli get VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle
vmw-cli get nsx-unified-appliance-2.4.0.0.0.12456291.ova

Force a refresh of the current main category index! (download latest available)

vmw-cli refresh
vmw-cli list

Usage

vmw-cli list

The list command displays the current high-level <solutions> available on my.vmware.com.

You will need to first generate an index of files under at least 1 solution or productGroup (such as NSX-T-240) before proceeding with other commands.

vmw-cli index

The index command creates an index of files available to you as fileIndex.json.
You will need to use one of the <solution> entries available from the list command.
The index intentionally creates duplicate entries for files, as a product may map to multiple <solutions>.

You can issue the index command multiple times to generate a consolidated index of all files.

WARNING: Some solutions such as vmware-vsphere and vmware-vsan contain a large number of products, and could take 10-15 mins to index

You can also issue the index command for a single productGroup if you provide the correct productGroup name. Some examples of this usage are below.

Examples

Index / View / Download OVFTool

vmw-cli index OVFTOOL430
vmw-cli find fileName:ovftool.*x86_64.bundle
vmw-cli get VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle

Index / View / Download NSX-T Manager

vmw-cli index vmware-nsx-t-data-center
vmw-cli find fileName:unified,fileType:ova
vmw-cli get nsx-unified-appliance-2.4.0.0.0.12456291.ova

For additional examples, please see:
https://github.com/apnex/vmw-cli

Report a Bug