OpenShift Pipelines tkn reference
This section lists the basic tkn CLI commands.
Basic syntax
tkn [command or options] [arguments…]
Global options
--help, -h
Utility commands
completion [shell]
Print shell completion code which must be evaluated to provide interactive completion. Supported shells are bash and zsh.
bash shell$ tkn completion bash
Pipelines management commands
pipeline delete
Delete a pipeline.
mypipeline pipeline from a namespace$ tkn pipeline delete mypipeline -n myspace
pipeline describe
Describe a pipeline.
mypipeline pipeline$ tkn pipeline describe mypipeline
pipeline logs
Display the logs for a specific pipeline.
mypipeline pipeline$ tkn pipeline logs -f mypipeline
pipeline start
Start a pipeline.
mypipeline pipeline$ tkn pipeline start mypipeline
Pipeline run commands
pipelinerun cancel
Cancel a pipeline run.
mypipelinerun pipeline run from a namespace$ tkn pipelinerun cancel mypipelinerun -n myspace
pipelinerun delete
Delete a pipeline run.
$ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace
$ tkn pipelinerun delete -n myspace --keep 5
- Replace
5with the number of most recently executed pipeline runs you want to retain.
$ tkn pipelinerun delete --all
Note
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.
mypipelinerun pipeline run in a namespace$ tkn pipelinerun describe mypipelinerun -n myspace
pipelinerun list
List pipeline runs.
$ tkn pipelinerun list -n myspace
pipelinerun logs
Display the logs of a pipeline run.
mypipelinerun pipeline run with all tasks and steps in a namespace$ tkn pipelinerun logs mypipelinerun -a -n myspace
Task management commands
task delete
Delete a task.
mytask1 and mytask2 tasks from a namespace$ tkn task delete mytask1 mytask2 -n myspace
task describe
Describe a task.
mytask task in a namespace$ tkn task describe mytask -n myspace
task logs
Display task logs.
mytaskrun task run of the mytask task$ tkn task logs mytask mytaskrun -n myspace
task start
Start a task.
mytask task in a namespace$ tkn task start mytask -s <ServiceAccountName> -n myspace
Task run commands
taskrun cancel
Cancel a task run.
mytaskrun task run from a namespace$ tkn taskrun cancel mytaskrun -n myspace
taskrun delete
Delete a TaskRun.
mytaskrun1 and mytaskrun2 task runs from a namespace$ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace
$ tkn taskrun delete -n myspace --keep 5
- Replace
5with the number of most recently executed task runs you want to retain.
taskrun describe
Describe a task run.
mytaskrun task run in a namespace$ tkn taskrun describe mytaskrun -n myspace
taskrun list
List task runs.
$ tkn taskrun list -n myspace
taskrun logs
Display task run logs.
mytaskrun task run in a namespace$ tkn taskrun logs -f mytaskrun -n myspace
Condition management commands
condition delete
Delete a Condition.
mycondition1 Condition from a namespace$ tkn condition delete mycondition1 -n myspace
condition describe
Describe a Condition.
mycondition1 Condition in a namespace$ tkn condition describe mycondition1 -n myspace
condition list
List Conditions.
$ tkn condition list -n myspace
Pipeline Resource management commands
resource create
Create a Pipeline Resource.
$ 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.
resource delete
Delete a Pipeline Resource.
myresource Pipeline Resource from a namespace$ tkn resource delete myresource -n myspace
resource describe
Describe a Pipeline Resource.
myresource Pipeline Resource$ tkn resource describe myresource -n myspace
resource list
List Pipeline Resources.
$ tkn resource list -n myspace
ClusterTask management commands
Important
In Red Hat OpenShift Pipelines 1.10, ClusterTask functionality of the tkn command-line utility is deprecated and is planned to be removed in a future release.
clustertask delete
Delete a ClusterTask resource in a cluster.
mytask1 and mytask2 ClusterTasks$ tkn clustertask delete mytask1 mytask2
clustertask describe
Describe a ClusterTask.
mytask ClusterTask$ tkn clustertask describe mytask1
clustertask start
Start ClusterTasks.
mytask ClusterTask$ tkn clustertask start mytask
Trigger management commands
eventlistener delete
Delete an EventListener.
mylistener1 and mylistener2 EventListeners in a namespace$ tkn eventlistener delete mylistener1 mylistener2 -n myspace
eventlistener describe
Describe an EventListener.
mylistener EventListener in a namespace$ tkn eventlistener describe mylistener -n myspace
eventlistener list
List EventListeners.
$ tkn eventlistener list -n myspace
eventlistener logs
Display logs of an EventListener.
mylistener EventListener in a namespace$ tkn eventlistener logs mylistener -n myspace
triggerbinding
Manage TriggerBindings.
$ tkn triggerbinding -h
triggerbinding delete
Delete a TriggerBinding.
mybinding1 and mybinding2 TriggerBindings in a namespace$ tkn triggerbinding delete mybinding1 mybinding2 -n myspace
triggerbinding describe
Describe a TriggerBinding.
mybinding TriggerBinding in a namespace$ tkn triggerbinding describe mybinding -n myspace
triggerbinding list
List TriggerBindings.
$ tkn triggerbinding list -n myspace
triggertemplate
Manage TriggerTemplates.
$ tkn triggertemplate -h
triggertemplate delete
Delete a TriggerTemplate.
mytemplate1 and mytemplate2 TriggerTemplates in a namespace$ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace`
triggertemplate describe
Describe a TriggerTemplate.
mytemplate TriggerTemplate in a namespace$ tkn triggertemplate describe mytemplate -n `myspace`
triggertemplate list
List TriggerTemplates.
$ tkn triggertemplate list -n myspace
clustertriggerbinding
Manage ClusterTriggerBindings.
$ tkn clustertriggerbinding -h
clustertriggerbinding delete
Delete a ClusterTriggerBinding.
myclusterbinding1 and myclusterbinding2 ClusterTriggerBindings$ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2
clustertriggerbinding describe
Describe a ClusterTriggerBinding.
myclusterbinding ClusterTriggerBinding$ tkn clustertriggerbinding describe myclusterbinding
clustertriggerbinding list
List ClusterTriggerBindings.
$ tkn clustertriggerbinding list
Hub interaction commands
Interact with Tekton Hub for resources such as tasks and pipelines.
hub
Interact with hub.
$ tkn hub -h
$ tkn hub --api-server https://api.hub.tekton.dev
Note
For each example, to get the corresponding sub-commands and flags, run tkn hub <command> --help.
hub downgrade
Downgrade an installed resource.
mytask task in the mynamespace namespace to its older version$ tkn hub downgrade task mytask --to version -n mynamespace
hub get
Get a resource manifest by its name, kind, catalog, and version.
myresource pipeline or task from the tekton catalog$ tkn hub get [pipeline | task] myresource --from tekton --version version
hub info
Display information about a resource by its name, kind, catalog, and version.
mytask task from the tekton catalog$ tkn hub info task mytask --from tekton --version version
hub install
Install a resource from a catalog by its kind, name, and version.
mytask task from the tekton catalog in the mynamespace namespace$ tkn hub install task mytask --from tekton --version version -n mynamespace
hub reinstall
Reinstall a resource by its kind and name.
mytask task from the tekton catalog in the mynamespace namespace$ tkn hub reinstall task mytask --from tekton --version version -n mynamespace
hub search
Search a resource by a combination of name, kind, and tags.
cli$ tkn hub search --tags cli
hub upgrade
Upgrade an installed resource.
mytask task in the mynamespace namespace to a new version$ tkn hub upgrade task mytask --to version -n mynamespace