| title | CLI | ||
|---|---|---|---|
| linkTitle | CLI | ||
| weight | 5 | ||
| description | Command-Line Interface | ||
| cascade |
|
{{% pageinfo %}} This document is a work in progress. {{% /pageinfo %}}
Tekton provides a CLI, tkn, for easier interaction with Tekton components.
It is available as a binary executable on major platforms; you may also build
it from the source, or set it up as a kubectl plugin.
{{% tabs %}}
{{% tab "macOS" %}}
tkn is available on macOS via brew:
brew install tektoncd-cliFor Mac OS X with Homebrew
ln -s $(brew --prefix)/opt/tektoncd-cli/bin/tkn /usr/local/bin/kubectl-tknYou can also download it as a tarball from the tkn Releases page.
After downloading the file, extract it to your PATH:
# Replace YOUR-DOWNLOADED-FILE with the file path of your own.
sudo tar xvzf YOUR-DOWNLOADED-FILE -C /usr/local/bin/ tkn{{% /tab %}}
{{% tab "Windows" %}}
tkn is available on Windows via Chocolatey:
choco install tektoncd-cli --confirmYou can also download it as a .zip file from the tkn Releases page.
After downloading the file, add it to your Path:
- Uncompress the
.zipfile. - Open Control Panel > System and Security > System > Advanced System Settings.
- Click Environment Variables, select the
Pathvariable and click Edit. - Click New and add the path to your uncompressed file.
- Click OK. {{% /tab %}}
{{% tab "Linux" %}}
tkn is available on Linux as a .deb package (for Debian, Ubuntu and
other deb-based distros) and .rpm package (for Fedora, CentOS, and other
rpm-based distros).
-
Debian, Ubuntu, and other deb-based distros
Find the
.debpackage of thetknrelease you would like to install on thetknReleases page and install it with# Replace LINK-TO-THE-PACKAGE with the package URL you would like to use. curl -LO LINK-TO-THE-PACKAGE sudo dpkg -i ./PACKAGE-NAMEIf you are using the latest releases of Ubuntu or Debian, you may use the TektonCD CLI PPA instead:
sudo apt update;sudo apt install -y gnupg sudo mkdir -p /etc/apt/keyrings/ sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/tektoncd.gpg --keyserver keyserver.ubuntu.com --recv-keys 3EFE0E0A2F2F60AA echo "deb [signed-by=/etc/apt/keyrings/tektoncd.gpg] http://ppa.launchpad.net/tektoncd/cli/ubuntu eoan main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list sudo apt update && sudo apt install -y tektoncd-cli
-
Fedora, CentOS, and other rpm-based distros
Find the
.rpmpackage of thetknrelease you would like to install on thetknReleases page and install it with# Replace LINK-TO-THE-PACKAGE with the package URL you would like to use. rpm -Uvh LINK-TO-THE-PACKAGEIf you are using the latest releases of Fedora or RHEL or CentOS, you may use the TektonCD CLI unofficial
coprpackage repository instead:dnf copr enable chmouel/tektoncd-cli dnf install tektoncd-cli
Alternatively, you may download tkn as a tarball:
Find the tarball of the tkn release for your platform (ARM or X86-64)
you would like to install on the tkn Releases page
and install it with
# Replace LINK-TO-TARBALL with the package URL you would like to use.
curl -LO LINK-TO-TARBALL
# Replace YOUR-DOWNLOADED-FILE with the file path of your own.
sudo tar xvzf YOUR-DOWNLOADED-FILE -C /usr/local/bin/ tkn{{% /tab %}}
{{% /tabs %}}
If you would like to build tkn from the source, set up your Go development
environment, clone the GitHub repository for tkn,
and run the following commands in the cloned directory:
export GO111MODULE=on
make bin/tknThe tkn executable will be available at /bin.
To add tkn as a kubectl plugin, run the following commands:
# The following commands assumes that your `tkn` executable is available
# at /usr/local/bin/tkn. You may need to use a different value on your
# system.
ln -s /usr/local/bin/tkn /usr/local/bin/kubectl-tkn For Mac OS X with Homebrew
ln -s $(brew --prefix)/opt/tektoncd-cli/bin/tkn /usr/local/bin/kubectl-tknIf configured correctly, you should see tkn listed in the output.
kubectl plugin listRun tkn help to see the list of available commands.