2.2. Command Line Tool#
A command-line tool is a type of Process object that can be run by
itself or as a Workflow step. It is a wrapper for a command like
ls
, echo
, tar
, etc. The command-line tool is defined in the
baseCommand
attribute of the command-line tool CWL document.
A CWL command-line tool must also have inputs
and outputs
.
The following example contains a minimal example of a CWL
command-line tool for the echo
Linux command, using inputs and
outputs.
CWL command-line tool.#
echo.cwl
#cwlVersion: v1.2
class: CommandLineTool
baseCommand: echo
stdout: output.txt
inputs:
message:
type: string
inputBinding: {}
outputs:
out:
type: string
outputBinding:
glob: output.txt
loadContents: true
outputEval: $(self[0].contents)
Note
The example above uses a simplified form to define inputs and outputs. You will learn more about in the Inputs and in the Outputs sections.
2.2.1. Network Access#
This indicates whether a process requires outgoing IPv4/IPv6 network access. If a command-line tool is written manually in CWL v1.1+, there is a need to specify when network access is required.
cwlVersion: v1.2
class: CommandLineTool
requirements:
NetworkAccess:
networkAccess: true
Note
CWL v1.0 command-line tools that are upgraded to v1.1 or v1.2 get Network Access automatically.