miniwdl
miniwdl copied to clipboard
Turning WDL files into executables using shebang
By using a #!/usr/bin/env miniwdl
shebang line in our WDL file, we could call simply:
hello.wdl who=Alyssa "who=Ben Bitdiddle" x=41
This gets translated into the following command:
miniwdl hello.wdl who=Alyssa "who=Ben Bitdiddle" x=41
However, miniWDL requires the "cromwell" argument first (miniwdl cromwell hello.wdl
). Unfortunately, shebang does not universally support adding another argument, so we cannot do #!/usr/bin/env miniwdl cromwell
, we will have to solve it some other way. Personally I think we could create another entrypoint in your setup config, that would create a separate executable (e.g. minicromwell
) that would be installed as part of the miniwdl package. The user would use #!/usr/bin/env minicromwell
, then the minicromwell executable would only forward all its inputs to miniwdl cromwell
.
What do you think? I can create a fork and take a shot at it.
This is a super neat idea!
| What do you think? I can create a fork and take a shot at it.
Absolutely- I've got a pretty full queue of other development work and community contributions to this project are most welcome. Here are two comments:
-
miniwdl's own local runner capability will start to come online over the next couple of months, which will have a similar command-line interface under a different subcommand, perhaps
miniwdl run
. So we should design the new entry point forminiwdl cromwell
with an eye to eventually making that available too in some isomorphic way. -
I'm also currently hacking on adding tab-completion to
miniwdl cromwell
using argcomplete, so that the user can get auto-completion both of the available input names and local filesystem paths (for File inputs). I hope we can extend that functionality through this shebang approach too. cc @kislyuk
Working draft: https://github.com/chanzuckerberg/miniwdl/pull/164
Not sure if tab completion will work through the shebang approach as well, we can check.