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
tkn
Parent command for tkn CLI.
$ tkncompletion [shell]
Print shell completion code which must be evaluated to provide interactive completion. Supported shells are bash and zsh.
$ tkn completion bashversion
Print version information of the tkn CLI.
$ tkn versionPipelines management commands
pipeline
Manage pipelines.
$ tkn pipeline --helppipeline delete
Delete a pipeline.
$ tkn pipeline delete mypipeline -n myspacepipeline describe
Describe a pipeline.
$ tkn pipeline describe mypipelinepipeline list
Display a list of pipelines.
$ tkn pipeline listpipeline logs
Display the logs for a specific pipeline.
$ tkn pipeline logs -f mypipelinepipeline start
Start a pipeline.
$ tkn pipeline start mypipelinePipeline run commands
pipelinerun
Manage pipeline runs.
$ tkn pipelinerun -hpipelinerun cancel
Cancel a pipeline run.
$ tkn pipelinerun cancel mypipelinerun -n myspacepipelinerun delete
Delete a pipeline run.
$ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace$ tkn pipelinerun delete -n myspace --keep 5 (1)- Replace
5with the number of most recently executed pipeline runs you want to retain.
$ tkn pipelinerun delete --allStarting 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.
$ tkn pipelinerun describe mypipelinerun -n myspacepipelinerun list
List pipeline runs.
$ tkn pipelinerun list -n myspacepipelinerun logs
Display the logs of a pipeline run.
$ tkn pipelinerun logs mypipelinerun -a -n myspaceTask management commands
task
Manage tasks.
$ tkn task -htask delete
Delete a task.
$ tkn task delete mytask1 mytask2 -n myspacetask describe
Describe a task.
$ tkn task describe mytask -n myspacetask list
List tasks.
$ tkn task list -n myspacetask logs
Display task logs.
$ tkn task logs mytask mytaskrun -n myspacetask start
Start a task.
$ tkn task start mytask -s <ServiceAccountName> -n myspaceTask run commands
taskrun
Manage task runs.
$ tkn taskrun -htaskrun cancel
Cancel a task run.
$ tkn taskrun cancel mytaskrun -n myspacetaskrun delete
Delete a TaskRun.
$ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace$ tkn taskrun delete -n myspace --keep 5 (1)- Replace
5with the number of most recently executed task runs you want to retain.
taskrun describe
Describe a task run.
$ tkn taskrun describe mytaskrun -n myspacetaskrun list
List task runs.
$ tkn taskrun list -n myspacetaskrun logs
Display task run logs.
$ tkn taskrun logs -f mytaskrun -n myspaceCondition management commands
condition
Manage Conditions.
$ tkn condition --helpcondition delete
Delete a Condition.
$ tkn condition delete mycondition1 -n myspacecondition describe
Describe a Condition.
$ tkn condition describe mycondition1 -n myspacecondition list
List Conditions.
$ tkn condition list -n myspacePipeline Resource management commands
resource
Manage Pipeline Resources.
$ tkn resource -hresource create
Create a Pipeline Resource.
$ tkn resource create -n myspaceThis 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.
$ tkn resource delete myresource -n myspaceresource describe
Describe a Pipeline Resource.
$ tkn resource describe myresource -n myspaceresource list
List Pipeline Resources.
$ tkn resource list -n myspaceClusterTask management commands
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
Manage ClusterTasks.
$ tkn clustertask --helpclustertask delete
Delete a ClusterTask resource in a cluster.
$ tkn clustertask delete mytask1 mytask2clustertask describe
Describe a ClusterTask.
$ tkn clustertask describe mytask1clustertask list
List ClusterTasks.
$ tkn clustertask listclustertask start
Start ClusterTasks.
$ tkn clustertask start mytaskTrigger management commands
eventlistener
Manage EventListeners.
$ tkn eventlistener -heventlistener delete
Delete an EventListener.
$ tkn eventlistener delete mylistener1 mylistener2 -n myspaceeventlistener describe
Describe an EventListener.
$ tkn eventlistener describe mylistener -n myspaceeventlistener list
List EventListeners.
$ tkn eventlistener list -n myspaceeventlistener logs
Display logs of an EventListener.
$ tkn eventlistener logs mylistener -n myspacetriggerbinding
Manage TriggerBindings.
$ tkn triggerbinding -htriggerbinding delete
Delete a TriggerBinding.
$ tkn triggerbinding delete mybinding1 mybinding2 -n myspacetriggerbinding describe
Describe a TriggerBinding.
$ tkn triggerbinding describe mybinding -n myspacetriggerbinding list
List TriggerBindings.
$ tkn triggerbinding list -n myspacetriggertemplate
Manage TriggerTemplates.
$ tkn triggertemplate -htriggertemplate delete
Delete a TriggerTemplate.
$ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace`triggertemplate describe
Describe a TriggerTemplate.
$ tkn triggertemplate describe mytemplate -n `myspace`triggertemplate list
List TriggerTemplates.
$ tkn triggertemplate list -n myspaceclustertriggerbinding
Manage ClusterTriggerBindings.
$ tkn clustertriggerbinding -hclustertriggerbinding delete
Delete a ClusterTriggerBinding.
$ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2clustertriggerbinding describe
Describe a ClusterTriggerBinding.
$ tkn clustertriggerbinding describe myclusterbindingclustertriggerbinding list
List ClusterTriggerBindings.
$ tkn clustertriggerbinding listHub 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.devFor each example, to get the corresponding sub-commands and flags, run tkn hub <command> --help.
hub downgrade
Downgrade an installed resource.
$ tkn hub downgrade task mytask --to version -n mynamespacehub get
Get a resource manifest by its name, kind, catalog, and version.
$ tkn hub get [pipeline | task] myresource --from tekton --version versionhub info
Display information about a resource by its name, kind, catalog, and version.
$ tkn hub info task mytask --from tekton --version versionhub install
Install a resource from a catalog by its kind, name, and version.
$ tkn hub install task mytask --from tekton --version version -n mynamespacehub reinstall
Reinstall a resource by its kind and name.
$ tkn hub reinstall task mytask --from tekton --version version -n mynamespacehub search
Search a resource by a combination of name, kind, and tags.
$ tkn hub search --tags clihub upgrade
Upgrade an installed resource.
$ tkn hub upgrade task mytask --to version -n mynamespace