CLI

Command-Line Interface

This document is a work in progress.

Overview

Tekton provides a CLI, tkn, for easier interaction with Tekton components.It is available as a binary executable on major platforms; you may also buildit from the source, or set it up as a kubectl plugin.

Installation

tkn is available on macOS via brew:

  1. brew tap tektoncd/tools
  2. brew install tektoncd/tools/tektoncd-cli

You can also download it as a tarball from the tkn Releases page.After downloading the file, extract it to your PATH:

  1. # Replace YOUR-DOWNLOADED-FILE with the file path of your own.
  2. sudo tar xvzf YOUR-DOWNLOADED-FILE -C /usr/local/bin/ tkn

tkn is available on Windows via Chocolatey:

  1. choco install tektoncd-cli --confirm

You can also download it as a .zip file from the tkn Releases page.After downloading the file, add it to your Path:

  • Uncompress the .zip file.
  • Open Control Panel > System and Security > System > Advanced System Settings.
  • Click Environment Variables, select the Path variable and click Edit.
  • Click New and add the path to your uncompressed file.
  • Click OK.

tkn is available on Linux as a .deb package (for Debian, Ubuntu andother deb-based distros) and .rpm package (for Fedora, CentOS, and otherrpm-based distros).

  • Debian, Ubuntu, and other deb-based distros

Find the .deb package of the tkn release you would like to install onthe tkn Releases page andinstall it with

  1. # Replace LINK-TO-THE-PACKAGE with the package URL you would like to use.
  2. rpm -Uvh LINK-TO-THE-PACKAGE

If you are using the latest releases of Ubuntu or Debian, you may use theTektonCD CLI PPA instead:

  1. sudo apt update;sudo apt install -y gnupg
  2. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3EFE0E0A2F2F60AA
  3. echo "deb http://ppa.launchpad.net/tektoncd/cli/ubuntu eoan main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list
  4. sudo apt update && sudo apt install -y tektoncd-cli
  • Fedora, CentOS, and other rpm-based distros

Find the .rpm package of the tkn release you would like to install onthe tkn Releases page andinstall it with

  1. # Replace LINK-TO-THE-PACKAGE with the package URL you would like to use.
  2. rpm -Uvh LINK-TO-THE-PACKAGE

If you are using Fedora 30⁄31, CentOS 7⁄8, EPEL, or RHEL 8, @chmouselprovides an unofficial copr package repository for installing thepackage:

  1. dnf copr enable chmouel/tektoncd-cli
  2. 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 pageand install it with

  1. # Replace LINK-TO-TARBALL with the package URL you would like to use.
  2. curl -LO LINK-TO-TARBALL
  3. # Replace YOUR-DOWNLOADED-FILE with the file path of your own.
  4. sudo tar xvzf YOUR-DOWNLOADED-FILE -C /usr/local/bin/ tkn

Build from source

If you would like to build tkn from the source, set up your Go developmentenvironment, clone the GitHub repository for tkn,and run the following commands in the cloned directory:

  1. export GO111MODULE=on
  2. make bin/tkn

The tkn executable will be available at /bin.

Add as a kubectl plugin

To add tkn as a kubectl plugin, run the following commands:

  1. # The following commands assumes that your `tkn` executable is available
  2. # at /usr/local/bin/tkn. You may need to use a different value on your
  3. # system.
  4. ln -s /usr/local/bin/tkn /usr/local/bin/kubectl-tkn
  5. kubectl plugin list

If configured correctly, you should see tkn listed in the output.

Usage

Run tkn help to see the list of available commands.

What’s next

A manual for using Tekton CLI is available on GitHub.