- Export your customerconnect.vmware.com credentials as
VCC_USER
andVCC_PASS
- (optional) Specify the Tanzu CLI version with
TANZU_VERSION
, defaults to latest. - (optional) Specify Tanzu CLI directory with $TANZU_DIR. Defaults to $HOME/tanzu.
This one-liner can be used to upgrade and downgrade the Tanzu CLI. The only consideration is that during downgrades you will need to remove the contents of the $HOME/.config/tanzu
directory, as the CLI will not handle downgrading of the content.
Requires $HOME/.local/bin must exist and be in your $PATH environment variable
TKG version >=2.3
export TANZU_CLI_VERSION="1.0.0"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
mv vcc-${os}-v1.1.5 "$HOME/.local/bin/vcc"; chmod +x "$HOME/.local/bin/vcc"; fi && version=${TANZU_CLI_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_cli -s tcli -v "$version" -f "tanzu-cli-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p "$tanzu_dir" && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-${os}-amd64.tar.gz" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-cli-${os}_amd64)" || (exit 1) && echo "$cli" && \
mv "$cli" "$HOME/.local/bin/tanzu" && tanzu plugin clean && tanzu init
TKG version >=1.5
export TANZU_VERSION="1.6.1"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
mv vcc-${os}-v1.1.5 "$HOME/.local/bin/vcc"; chmod +x "$HOME/.local/bin/vcc"; fi && version=${TANZU_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_kubernetes_grid -s tkg -v "$version" -f "tanzu-cli-bundle-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p "$tanzu_dir" && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-bundle-${os}-amd64.tar.gz" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-core-${os}_amd64)" || (exit 1) && echo "$cli" && \
mv "$cli" "$HOME/.local/bin/tanzu" && tanzu plugin clean && tanzu init
TKG version <=1.4
export TANZU_VERSION="1.4.2"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
mv vcc-${os}-v1.1.5 "$HOME/.local/bin/vcc"; chmod +x "$HOME/.local/bin/vcc"; fi && version=${TANZU_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_kubernetes_grid -s tkg -v "$version" -f "tanzu-cli-bundle-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p "$tanzu_dir" && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-bundle-${os}-amd64.tar" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-core-${os}_amd64)" || (exit 1) && echo "$cli" && \
mv "$cli" "$HOME/.local/bin/tanzu" && tanzu plugin clean && tanzu init
Requires password input for sudo commands to work
TKG version >=2.3
export TANZU_CLI_VERSION="1.0.0"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
sudo mv vcc-${os}-v1.1.5 "/usr/local/bin/vcc"; sudo chmod +x "/usr/local/bin/vcc"; fi && version=${TANZU_CLI_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_cli -s tcli -v "$version" -f "tanzu-cli-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p $tanzu_dir && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-${os}-amd64.tar.gz" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-cli-${os}_amd64)" || (exit 1) && echo "$cli" && \
sudo mv "$cli" "/usr/local/bin/tanzu" && tanzu plugin clean && tanzu init
TKG version >=1.5
export TANZU_VERSION="1.6.1"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
sudo mv vcc-${os}-v1.1.5 "/usr/local/bin/vcc"; sudo chmod +x "/usr/local/bin/vcc"; fi && version=${TANZU_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_kubernetes_grid -s tkg -v "$version" -f "tanzu-cli-bundle-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p $tanzu_dir && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-bundle-${os}-amd64.tar.gz" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-core-${os}_amd64)" || (exit 1) && echo "$cli" && \
sudo mv "$cli" "/usr/local/bin/tanzu" && tanzu plugin clean && tanzu init
TKG version <=1.4
export TANZU_VERSION="1.4.2"
os="$(uname -s | awk '{print tolower($0)}')" && if ! command -v vcc &> /dev/null; then umask 002; \
curl -OLf "https://github.com/vmware-labs/vmware-customer-connect-cli/releases/download/v1.1.5/vcc-${os}-v1.1.5"; \
sudo mv vcc-${os}-v1.1.5 "/usr/local/bin/vcc"; sudo chmod +x "/usr/local/bin/vcc"; fi && version=${TANZU_VERSION:-*} && \
echo "Attempting to download version $version" && \
vcc download -p vmware_tanzu_kubernetes_grid -s tkg -v "$version" -f "tanzu-cli-bundle-${os}-amd64.*" --accepteula && \
tanzu_dir="${TANZU_DIR:-$HOME/tanzu}" && echo "Exporting to $tanzu_dir" && mkdir -p "$tanzu_dir" && \
find $tanzu_dir -mindepth 1 -maxdepth 1 | xargs -rn1 rm -rf && \
tar -xvf "$HOME/vcc-downloads/tanzu-cli-bundle-${os}-amd64.tar" --directory "$tanzu_dir" && \
cli="$(find $tanzu_dir -name tanzu-core-${os}_amd64)" || (exit 1) && echo "$cli" && \
sudo mv "$cli" "/usr/local/bin/tanzu" && tanzu plugin clean && tanzu init
os
type is set- vcc is downloaded if not available to $HOME/.local/bin
curl -OLf
will downloadvcc
, show the status on screen and return an error on failure.version
variable is set to*
meaning latest ifTANZU_VERSION
is unsetvcc
attempts the downloadtanzu_dir
is set to$HOME/tanzu
unlessTANZU_DIR
is set- The
tanzu_dir
is created if it does not already exist and emptied - The executable file is found, made executable and moved to the final location