tektoncd / cli

A CLI for interacting with Tekton!
Apache License 2.0
423 stars 240 forks source link
cli command-line hacktoberfest pipeline tekton

Tekton Pipelines CLI (tkn)

Go Report Card CII Best Practices

Tekton logo

The Tekton Pipelines CLI project provides a command-line interface (CLI) for interacting with Tekton, an open-source framework for Continuous Integration and Delivery (CI/CD) systems.

Installing tkn

Download the latest binary executable for your operating system.

Mac OS X

  brew install tektoncd-cli

Windows

choco install tektoncd-cli --confirm
#Create directory
New-Item -Path "$HOME/tektoncd/cli" -Type Directory
# Download file
Start-BitsTransfer -Source https://github.com/tektoncd/cli/releases/download/v0.37.0/tkn_0.37.0_Windows_x86_64.zip -Destination "$HOME/tektoncd/cli/."
# Uncompress zip file
Expand-Archive $HOME/tektoncd/cli/*.zip -DestinationPath C:\Users\Developer\tektoncd\cli\.
#Add to Windows `Environment Variables`
[Environment]::SetEnvironmentVariable("Path",$($env:Path + ";$Home\tektoncd\cli"),'User')

Linux tarballs

Linux RPMs

If you are running on any of the following rpm based distros:

Linux Debs

NixOS/Nix

You can install tektoncd-cli from nixpkgs on any system that supports the nix package manager.

nix-env --install tektoncd-cli

Arch / Manjaro

You can install tekton-cli from the official arch package repository :

pacman -S tekton-cli

Homebrew on Linux

You can install the latest tektoncd-cli if you are using Homebrew on Linux as for the osx version you need to simply do :

brew install tektoncd-cli

Source install

If you have go installed and you want to compile the CLI from source, you can checkout the Git repository and run the following commands:

  make bin/tkn

This will output the tkn binary in bin/tkn

tkn as a kubectl plugin

kubectl will find any binary named kubectl-* on your PATH and consider it as a plugin. After installing tkn, create a link as kubectl-tkn

ln -s /usr/local/bin/tkn /usr/local/bin/kubectl-tkn

Run the following to confirm tkn is available as a plugin:

kubectl plugin list

You should see the following after running kubectl plugin list if tkn is available as a plugin:

/usr/local/bin/kubectl-tkn

If the output above is shown, run kubectl-tkn to see the list of available tkn commands to run.

Useful Commands

The following commands help you understand and effectively use the Tekton CLI:

For every tkn command, you can use -h or --help flags to display specific help for that command.

Disable Color and Emojis in Output

For many tkn commands, color and emojis by default will appear in command output.

It will only shows if you are in interactive shell with a standard input attached. If you pipe the tkn command or run it in a non interactive way (ie: from tekton itself in a Task) the coloring and emojis will always be disabled.

tkn offers two approaches for disabling color and emojis from command output.

To remove the color and emojis from all tkn command output, set the environment variable NO_COLOR, such as shown below:

export NO_COLOR=""

More information on NO_COLOR can be found in the NO_COLOR documentation.

To remove color and emojis from the output of a single command execution, the --no-color option can be used with any command, such as in the example below:

tkn taskrun describe --no-color

Want to contribute

We are so excited to have you!