cli

module
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2023 License: Apache-2.0

README

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
  • Use released tarball

    # Get the tar.xz
    curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.0_Darwin_all.tar.gz
    # Extract tkn to your PATH (e.g. /usr/local/bin)
    sudo tar xvzf tkn_0.28.0_Darwin_all.tar.gz -C /usr/local/bin tkn
    
Windows
choco install tektoncd-cli --confirm
scoop install tektoncd-cli
#Create directory
New-Item -Path "$HOME/tektoncd/cli" -Type Directory
# Download file
Start-BitsTransfer -Source https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.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 AMD 64

    # Get the tar.xz
    curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.0_Linux_x86_64.tar.gz
    # Extract tkn to your PATH (e.g. /usr/local/bin)
    sudo tar xvzf tkn_0.28.0_Linux_x86_64.tar.gz -C /usr/local/bin/ tkn
    
  • Linux AARCH 64

    # Get the tar.xz
    curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.0_Linux_aarch64.tar.gz
    # Extract tkn to your PATH (e.g. /usr/local/bin)
    sudo tar xvzf tkn_0.28.0_Linux_aarch64.tar.gz -C /usr/local/bin/ tkn
    
  • Linux IBM Z

    # Get the tar.gz
    curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.0_Linux_s390x.tar.gz
    # Extract tkn to your PATH (e.g. /usr/local/bin)
    sudo tar xvzf tkn_0.28.0_Linux_s390x.tar.gz -C /usr/local/bin/ tkn
    
  • Linux IBM P

    # Get the tar.gz
    curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tkn_0.28.0_Linux_ppc64le.tar.gz
    # Extract tkn to your PATH (e.g. /usr/local/bin)
    sudo tar xvzf tkn_0.28.0_Linux_ppc64le.tar.gz -C /usr/local/bin/ tkn
    
Linux RPMs

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

  • Latest Fedora and the two versions behind.
  • Centos Stream
  • EPEL
  • Latest RHEL

you would be able to use @chmouel's unofficial copr package repository by running the following commands:

dnf copr enable chmouel/tektoncd-cli
dnf install tektoncd-cli

On any other RPM based distros, you can install the rpm directly:

 rpm -Uvh https://github.com/tektoncd/cli/releases/download/v0.28.0/tektoncd-cli-0.28.0_Linux-64bit.rpm
Linux Debs

If you are running on the latest rolling Ubuntu or Debian, you can use the TektonCD CLI PPA:

sudo apt update;sudo apt install -y gnupg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3EFE0E0A2F2F60AA
echo "deb http://ppa.launchpad.net/tektoncd/cli/ubuntu jammy main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list
sudo apt update && sudo apt install -y tektoncd-cli

The PPA may work with older releases, but that hasn't been tested.

On any other Debian or Ubuntu based distro, you can simply install the binary package directly with dpkg:

curl -LO https://github.com/tektoncd/cli/releases/download/v0.28.0/tektoncd-cli-0.28.0_Linux-64bit.deb
dpkg -i tektoncd-cli-0.28.0_Linux-64bit.deb
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 tektoncd-cli from the official arch package repository :

pacman -S tektoncd-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!

Directories

Path Synopsis
cmd
tkn
pkg
cli
cmd
log
test
cli
third_party
VENDOR-LICENSE/github.com/hashicorp/errwrap
Package errwrap implements methods to formalize error wrapping in Go.
Package errwrap implements methods to formalize error wrapping in Go.
VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp
Package cleanhttp offers convenience utilities for acquiring "clean" http.Transport and http.Client structs.
Package cleanhttp offers convenience utilities for acquiring "clean" http.Transport and http.Client structs.
VENDOR-LICENSE/github.com/hashicorp/go-plugin
The plugin package exposes functions and helpers for communicating to plugins which are implemented as standalone binary applications.
The plugin package exposes functions and helpers for communicating to plugins which are implemented as standalone binary applications.
VENDOR-LICENSE/github.com/hashicorp/go-retryablehttp
Package retryablehttp provides a familiar HTTP client interface with automatic retries and exponential backoff.
Package retryablehttp provides a familiar HTTP client interface with automatic retries and exponential backoff.
VENDOR-LICENSE/github.com/hashicorp/go-rootcerts
Package rootcerts contains functions to aid in loading CA certificates for TLS connections.
Package rootcerts contains functions to aid in loading CA certificates for TLS connections.
VENDOR-LICENSE/github.com/hashicorp/go-sockaddr
Package sockaddr is a Go implementation of the UNIX socket family data types and related helper functions.
Package sockaddr is a Go implementation of the UNIX socket family data types and related helper functions.
VENDOR-LICENSE/github.com/hashicorp/golang-lru
Package lru provides three different LRU caches of varying sophistication.
Package lru provides three different LRU caches of varying sophistication.
VENDOR-LICENSE/github.com/hashicorp/hcl
Package hcl decodes HCL into usable Go structures.
Package hcl decodes HCL into usable Go structures.
VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/ast
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/parser
Package parser implements a parser for HCL (HashiCorp Configuration Language)
Package parser implements a parser for HCL (HashiCorp Configuration Language)
VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer
Package printer implements printing of AST nodes to HCL format.
Package printer implements printing of AST nodes to HCL format.
VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/scanner
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/token
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
VENDOR-LICENSE/github.com/hashicorp/vault/sdk/helper/certutil
Package certutil contains helper functions that are mostly used with the PKI backend but can be generally useful.
Package certutil contains helper functions that are mostly used with the PKI backend but can be generally useful.
VENDOR-LICENSE/github.com/hashicorp/vault/sdk/helper/strutil
DEPRECATED: this has been moved to go-secure-stdlib and will be removed
DEPRECATED: this has been moved to go-secure-stdlib and will be removed
VENDOR-LICENSE/github.com/letsencrypt/boulder/identifier
The identifier package defines types for RFC 8555 ACME identifiers.
The identifier package defines types for RFC 8555 ACME identifiers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL