lab icon indicating copy to clipboard operation
lab copied to clipboard

Allow generating the config file through CLI params

Open ghost opened this issue 2 years ago • 2 comments

Hi, thanks for this awesome tool.

I have a recommendation that I would also be willing to take a stab at. Before that, I just want to pass this idea by for opinions:

In the fresh start section, it mentions a prompt based generation of lab.toml file. Do you think it is worth it to have something like:

lab config --host ... --token ... --user ...

Currently I have a template that I plug the values in for headless installation, but including the config command would make such configurations easier.

ghost avatar Aug 23 '23 13:08 ghost

That's an interesting idea. My concern is however, that I don't like passing passwords in clear text (whether it be via command line, webUI, or an app). But I'm not everyone ;) and I can see how others would find that functionality useful.

Perhaps using the LAB_CORE_HOST, LAB_CORE_TOKEN, adding a LAB_CORE_USER variable, and then adding a --save-config option would be better than adding 3 separate parameters? What do you think?

That way a user could do

LAB_CORE_HOST=http://gitlab.com LAB_CORE_TOKEN=1234abcd LAB_CORE_USER=prarit lab --save-config

and just have the information saved?

prarit avatar Aug 23 '23 14:08 prarit

Oh, in my case too I have the token in a shell variable, but we can't control how people use it, because there is not way to tell shell replacements and direct strings apart AFAIK.

For 3 params (config with options) vs single --save-config, I think the usage for --save-config is difficult to explain, and it feels like a all-or-nothing case.

Also, if there's a need to only change the ~host~ token, maybe we can extend the proposed feature to change the token through:

lab config --token $LAB_CORE_TOKEN

And it goes and updates only the token value, and retains the other values.

ghost avatar Aug 23 '23 14:08 ghost