Answering my own question. Curious to see if this is indeed the neatest option:
class: CommandLineTool cwlVersion: v1.0
baseCommand:
- python
inputs:
- id: inpfiles
inputBinding:
position: 0
type: 'Directory[]'
outputs: []
label: _do_magic
arguments:
- position: 0
prefix: '-c'
valueFrom: |
import sys
import magic
magic.main(sys.argv[1:])