feat(cli): add `pixi config` command
Implement #1022
Awesome!
ready for review
I just played around with this a little. One thing I found is that a broken value just shows "no config found" instead of showing an error when I run pixi config list. This may be something to improve in the config loading :)
I also just ran cargo r -- config set change-ps1 false and it would be nice if pixi would print what file it actually changed (e.g. "✅ Added "change-ps1 = true" to your local config at ./.pixi/config.toml".
I also couldn't figure out if lists work (e.g. cargo r -- config set default-channels 'bioconda,conda-forge,robostack'). Did you try that? Just curious. I know that conda config had some options for append and prepend, but I am not sure if it's used often enough to warrant more complexity. We could also do something like take a comma delimited list or so ...
Hey @chawyehsu awesome job! I just briefly did some tests on my end for functionality (without looking much at the code). Let me know what you think about the comments :) Looking forward to shipping this! 🚢
I found is that a broken value just shows "no config found" instead of showing an error when I run pixi config list. This may be something to improve in the config loading :)
If you mean "No configuration values found" then that's when all the options are default and no user defined ones. A different message could be used here but I'm not sure what's better.
it would be nice if pixi would print what file it actually changed
Sounds good, will add.
I also couldn't figure out if lists work (e.g. cargo r -- config set default-channels 'bioconda,conda-forge,robostack'). Did you try that? Just curious.
For default-channels, the only valid input format would be something like '["bioconda","conda-forge","robostack"]' which looks tedious but it's a strictly serialized list.
I am not sure if it's used often enough.
Me neither. For me I would prefer pixi config edit rather than pixi config set for editing complex options. And I can't find a friendly way to support editing object type of options like [mirrors], imagine pixi config set mirrors '<input>', what should <input> look like?
had some options for
appendandprepend
Do they support list type of options only?
He @chawyehsu,
I've been using it now for some time and it feels great.
Could you add documentation? And possible some examples to the --help. E.g.:
> pixi config set -h
Set a configuration value
Example:
$ pixi config set --global default-channels '["conda-forge", "nvidia"]'
If that's in I would be happy to merge it!
Doc and test have been added. Also, two new subcommands mentioned above prepend and append are added for easier altering list keys.
Thanks a lot @chawyehsu, this looks good to me!