Installation #

Users can get kpt CLI in a variety of ways:

Binaries #

Download pre-compiled binaries:

Optionally verify the SLSA3 signatures generated using the OpenSSF’s slsa-framework/slsa-github-generator during the release process. To verify a release binary:

  1. Install the verification tool from slsa-framework/slsa-verifier#installation.
  2. Download the signature file attestation.intoto.jsonl from the GitHub releases page.
  3. Run the verifier:
slsa-verifier -artifact-path kpt-<os>-<arch> -provenance attestation.intoto.jsonl -source github.com/kptdev/kpt -tag <the-tag>

On Linux and MacOS, make it executable:

$ chmod +x kpt

On MacOS the first time, it may be necessary to open the program from the finder with ctrl-click open.

Verify the version:

$ kpt version

(Optional) enable shell auto-completion #

kpt provides auto-completion support for several of the common shells. To see the options for enabling shell auto-completion:

$ kpt completion -h

Prerequisites #

Previous installations of kpt completion may have added the following line to the shell’s config file (e.g. .bashrc, .zshrc, etc.):

$ complete -C <KPT_PATH> kpt

This line needs to be removed for kpt’s completion implementation to function properly.

Enable kpt auto-completion #

The kpt completion script for a shell can be generated with the commands kpt completion bash, kpt completion zsh, etc. For instructions on how to enable the script for the given shell, see the help page with the commands kpt completion bash -h, kpt completion zsh -h, etc.

gcloud #

Install with gcloud.

$ gcloud components install kpt
$ kpt version

The version of kpt installed using gcloud may not be the latest released version, and can lag behind. Please use another installation method if you need to latest release.

Homebrew #

Install the latest release with Homebrew on MacOS.

$ brew tap kptdev/kpt https://github.com/kptdev/kpt.git
$ brew install kpt
$ kpt version

The version of kpt installed using brew can only be a tagged release, master releases are not shipped.

Docker #

Use one of the kpt docker images.

Featurekptkpt-gcloud
kpt
git
diffutils
gcloud

<code>kpt</code> #

$ docker run gcr.io/kpt-dev/kpt:v1.0.0-beta.49 version

<code>kpt-gcloud</code> #

An image which includes kpt based upon the Google cloud-sdk alpine image.

$ docker run gcr.io/kpt-dev/kpt-gcloud:v1.0.0-beta.49 version

Source #

Install by compiling the source. This requires having Go version 1.21+:

$ go install -v github.com/kptdev/kpt@main

kpt version will return unknown for binaries built from source:

$ kpt version
Last modified June 16, 2025: Move docs to hugo (#4215) (2f0d4026)