tools icon indicating copy to clipboard operation
tools copied to clipboard

Lean down CLI for remote component repositories

Open AlexVCaron opened this issue 1 year ago • 4 comments

Description of feature

When using a remote component repository, most modules and subworkflows commands need to be augmented with --git-remote or -g and if needed the --branch. It ok when installing multiple modules or subworkflows back-to-back, the command line still in history.

In my lab, however it has become increasingly heavy, since most of our modules and subworkflows live outside of nf-core repositories for now and the creation of a new component requires to call create, test and lint commands a lot. It would be nice to have a programmatic way to configure those remotes, may it be in nf-core configuration directly, or through the CLI environment.

I'm not sure the best way to do this, environment variables seems easy to do, but XDG_CONFIG_HOME is maybe a more standard way to do it. In any case, let's talk about it !

AlexVCaron avatar May 21 '24 19:05 AlexVCaron

You can already set any cli parameter as a environmental variable with a NFCORE_ prefix (using click's auto_envvar_prefix)

mashehu avatar May 21 '24 19:05 mashehu

That's true, I forgot about that feature !

AlexVCaron avatar May 21 '24 19:05 AlexVCaron

We are also already using XDG_CONFIG_HOME for some stuff, but it's mostly for storing cache objects in and stuff if I remember correctly.

ewels avatar May 22 '24 13:05 ewels

I've thought about this myself for the same reason as the OP. I would like to implement a "config" that would allow the user to define remotes and then just choose the remote via --remote <defined_name> as well as setting a non-nf-core default remote. However when I started scoping it out the way config is loaded across tools was too complicated to implement this easily/quickly.

Maybe at the next hackathon I will try again 😉

awgymer avatar Jun 12 '24 15:06 awgymer