# In a plugin, access to the parsed arguments from the command line

**URL:** <https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [August 28, 2025, 2:48pm UTC](https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349 "2025-08-28T14:48:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Welch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bill_welch/32/995_2.png) [@Bill\_Welch](https://community.seqera.io/u/Bill_Welch)\
**Post date:** [August 28, 2025, 2:48pm UTC](https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349/1 "2025-08-28T14:48:55Z")

</div>

This is more of a JVM question.

From a plugin, in what way can I drill back to Launcher.normalizedArgs?

Sure, I can parse session.commandLine, but I’m interested in a more ‘elegant’ solution.

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [August 29, 2025, 12:27pm UTC](https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349/2 "2025-08-29T12:27:59Z")

</div>

You can use `session.params` if you just want the pipeline params, otherwise you’ll have to re-parse `session.commandLine`.

What exactly are you looking for?

---

<div class="post-metadata">

**Author:** ![Bill\_Welch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bill_welch/32/995_2.png) [@Bill\_Welch](https://community.seqera.io/u/Bill_Welch)\
**Post date:** [August 29, 2025, 1:41pm UTC](https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349/3 "2025-08-29T13:41:05Z")

</div>

Specifically, the value of -params-file, if set.  
From an audit point of view, the whole of params is, of course, very important. In this case, our users control the pipeline only through a large params file, not config files or individual params on the command line. So, they want to have just what they see as the difference between runs published. I’m extending your example from Episode 35 to copy any random file to publishdir.

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [August 29, 2025, 3:09pm UTC](https://community.seqera.io/t/in-a-plugin-access-to-the-parsed-arguments-from-the-command-line/2349/4 "2025-08-29T15:09:42Z")

</div>

You could take `session.params` and write it to a JSON or YAML file in the output directory. In fact, I think the nf-core pipeline template does this. There is a function called `dumpParametersToJSON`

> <https://github.com/nf-core/fetchngs/blob/8ec2d934f9301c818d961b1e4fdf7fc79610bdc5/subworkflows/nf-core/utils_nextflow_pipeline/main.nf#L78-L87>
