Skip to main content
Version: Preview

Install kbcli

You can install kbcli on your laptop or virtual machines on the cloud.

Environment preparation

For Windows users, PowerShell version should be 5.0 or higher.

Install kbcli

kbcli now supports macOS, Windows, and Linux.

You can install kbcli with curl or brew.

  • Option 1: Install kbcli using the curl command.
  1. Install kbcli.

    curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash

    If you want to install kbcli with a specified version, follow the steps below.

    1. Check the available versions in KubeBlocks Release.

    2. Specify a version with -s and run the command below.

      curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s x.x.x
    note

    By default, kbcli installs the latest release version and then when installing KubeBlocks, kbcli installs the matched version. Ensure that the major versions of kbcli and KubeBlocks match.

    For instance, you can install kbcli v0.6.1 and KubeBlocks v0.6.3, but mismatched versions like kbcli v0.5.0 and KubeBlocks v0.6.0 may result in errors.

  2. Run kbcli version to check the version of kbcli and ensure that it is successfully installed.

    note

    If a timeout exception occurs during installation, please check your network settings and retry.

  • Option 2: Install kbcli using Homebrew.
  1. Install ApeCloud tap, the Homebrew package of ApeCloud.

    brew tap apecloud/tap
  2. Install kbcli.

    brew install kbcli

    If you want to install kbcli with a specified version, run the commands below.

    # View the available version
    brew search kbcli

    # Specify a version
    brew install kbcli@x.x.x
  3. Verify that kbcli is successfully installed.

    kbcli -h

(Optional) Enable auto-completion for kbcli

kbcli supports command line auto-completion.

# Configure SHELL-TYPE as one type from bash, fish, PowerShell, and zsh
kbcli completion SHELL-TYPE -h

For example, enable kbcli auto-completion for zsh.

Steps:

  1. Check the user guide.

    kbcli completion zsh -h
  2. Enable the completion function of your terminal first.

    echo "autoload -U compinit; compinit" >> ~/.zshrc
  3. Enable the kbcli automatic completion function.

    echo "source <(kbcli completion zsh); compdef _kbcli kbcli" >> ~/.zshrc