Generate Python Click CLIs from CWL CommandLineTools

Dear CWL community,
at Terradue, an Earth Science company, we strongly rely on CWL as part of the foundation of our Earth Observation data processing platform and, aside the well known and estabilished cwltool, we had the need to develop some side-tools to assist our staff and partners during the development lifecycle.We also identified the Workflows design as a strategic part of our daily job to make the CWL adoption clear to Python developers who are not familiar with CWL, this is why I’d like to share a small tool we’ve been working on: cwl2click.

It helps you turn CWL CommandLineTool descriptions into a ready-to-use Python CLI built with click, so you can quickly expose a CWL tool as a friendly command-line interface (with help text, options/arguments, and sensible defaults derived from the CWL definition).You can easily find references on GitHub:

Why you might care

  • Fast prototyping: get a working CLI without hand-writing argument parsing.

  • Consistency: keep parameters, defaults, and documentation anchored in the CWL spec.

  • Lower friction for users: a familiar --help-driven interface for colleagues who aren’t editing CWL day-to-day.

If you have a CWL CommandLineTool lying around, I’d love if you could try cwl2click, see how it behaves with your inputs/requirements, and share feedback:

  • Does the generated CLI match your expectations?

  • Any CWL features you’d like to see supported next?

  • Any rough edges in UX, naming, types, defaults, or documentation output?

Thanks in advance to anyone willing to test-drive it and help improve it.
Best regards,

Simone Tripodi, SW Eng @ Terradue

5 Likes

Thank you @sim13pods, this looks cool! You can add cwl2click to the CWL tool gallery on the website by sending a PR to edit https://github.com/common-workflow-language/cwl-website/blob/29591e77650ade90ff3132ea433dca0c03ad9fef/content/tools.md

1 Like

Hi @mrc!

thanks a lot for your feedback and sure of course, PR is coming soon!

1 Like

Hi again @mrc ,

here we are: feat: added cwl2ckick reference by sim13pods · Pull Request #232 · common-workflow-language/cwl-website · GitHub

1 Like

I might have some time in January / February as I am writing some docs for a project with CWL. In my case I’m interested about CWL + MPI producing some provenance files. I can probably find some CWL command line tool and give it a try with cwl2click over next days.

By the way, Simone, is that you (from Apache)? If so, good to see you around here and working with workflows + CWL + Earth Sciences!

1 Like

Hi there @brunokinoshita yes it is me! I am so glad too to have met you here! :smiling_face_with_three_hearts:

Looking forward to read feedback from you, chat soon!

1 Like