×

Basic syntax

tkn [command or options] [arguments…​]

Global options

--help, -h

Utility commands

tkn

Parent command for tkn CLI.

Example: Display all options
$ tkn

completion [shell]

Print shell completion code which must be evaluated to provide interactive completion. Supported shells are bash and zsh.

Example: Completion code for bash shell
$ tkn completion bash

version

Print version information of the tkn CLI.

Example: Check the tkn version
$ tkn version

Pipelines management commands

pipeline

Manage pipelines.

Example: Display help
$ tkn pipeline --help

pipeline delete

Delete a pipeline.

Example: Delete the mypipeline pipeline from a namespace
$ tkn pipeline delete mypipeline -n myspace

pipeline describe

Describe a pipeline.

Example: Describe the mypipeline pipeline
$ tkn pipeline describe mypipeline

pipeline list

Display a list of pipelines.

Example: Display a list of pipelines
$ tkn pipeline list

pipeline logs

Display the logs for a specific pipeline.

Example: Stream the live logs for the mypipeline pipeline
$ tkn pipeline logs -f mypipeline

pipeline start

Start a pipeline.

Example: Start the mypipeline pipeline
$ tkn pipeline start mypipeline

Pipeline run commands

pipelinerun

Manage pipeline runs.

Example: Display help
$ tkn pipelinerun -h

pipelinerun cancel

Cancel a pipeline run.

Example: Cancel the mypipelinerun pipeline run from a namespace
$ tkn pipelinerun cancel mypipelinerun -n myspace

pipelinerun delete

Delete a pipeline run.

Example: Delete pipeline runs from a namespace
$ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace
Example: Delete all pipeline runs from a namespace, except the five most recently executed pipeline runs
$ tkn pipelinerun delete -n myspace --keep 5 (1)
1 Replace 5 with the number of most recently executed pipeline runs you want to retain.
Example: Delete all pipelines
$ tkn pipelinerun delete --all

Starting with Red Hat OpenShift Pipelines 1.6, the tkn pipelinerun delete --all command does not delete any resources that are in the running state.

pipelinerun describe

Describe a pipeline run.

Example: Describe the mypipelinerun pipeline run in a namespace
$ tkn pipelinerun describe mypipelinerun -n myspace

pipelinerun list

List pipeline runs.

Example: Display a list of pipeline runs in a namespace
$ tkn pipelinerun list -n myspace

pipelinerun logs

Display the logs of a pipeline run.

Example: Display the logs of the mypipelinerun pipeline run with all tasks and steps in a namespace
$ tkn pipelinerun logs mypipelinerun -a -n myspace

Task management commands

task

Manage tasks.

Example: Display help
$ tkn task -h

task delete

Delete a task.

Example: Delete mytask1 and mytask2 tasks from a namespace
$ tkn task delete mytask1 mytask2 -n myspace

task describe

Describe a task.

Example: Describe the mytask task in a namespace
$ tkn task describe mytask -n myspace

task list

List tasks.

Example: List all the tasks in a namespace
$ tkn task list -n myspace

task logs

Display task logs.

Example: Display logs for the mytaskrun task run of the mytask task
$ tkn task logs mytask mytaskrun -n myspace

task start

Start a task.

Example: Start the mytask task in a namespace
$ tkn task start mytask -s <ServiceAccountName> -n myspace

Task run commands

taskrun

Manage task runs.

Example: Display help
$ tkn taskrun -h

taskrun cancel

Cancel a task run.

Example: Cancel the mytaskrun task run from a namespace
$ tkn taskrun cancel mytaskrun -n myspace

taskrun delete

Delete a TaskRun.

Example: Delete the mytaskrun1 and mytaskrun2 task runs from a namespace
$ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace
Example: Delete all but the five most recently executed task runs from a namespace
$ tkn taskrun delete -n myspace --keep 5 (1)
1 Replace 5 with the number of most recently executed task runs you want to retain.

taskrun describe

Describe a task run.

Example: Describe the mytaskrun task run in a namespace
$ tkn taskrun describe mytaskrun -n myspace

taskrun list

List task runs.

Example: List all the task runs in a namespace
$ tkn taskrun list -n myspace

taskrun logs

Display task run logs.

Example: Display live logs for the mytaskrun task run in a namespace
$ tkn taskrun logs -f mytaskrun -n myspace

Condition management commands

condition

Manage Conditions.

Example: Display help
$ tkn condition --help

condition delete

Delete a Condition.

Example: Delete the mycondition1 Condition from a namespace
$ tkn condition delete mycondition1 -n myspace

condition describe

Describe a Condition.

Example: Describe the mycondition1 Condition in a namespace
$ tkn condition describe mycondition1 -n myspace

condition list

List Conditions.

Example: List Conditions in a namespace
$ tkn condition list -n myspace

Pipeline Resource management commands

resource

Manage Pipeline Resources.

Example: Display help
$ tkn resource -h

resource create

Create a Pipeline Resource.

Example: Create a Pipeline Resource in a namespace
$ tkn resource create -n myspace

This is an interactive command that asks for input on the name of the Resource, type of the Resource, and the values based on the type of the Resource.