Soluto / kamus

An open source, git-ops, zero-trust secret encryption and decryption solution for Kubernetes applications
https://kamus.soluto.io
Apache License 2.0
930 stars 68 forks source link

Make CLI arguments order invariant #77

Closed AleF83 closed 5 years ago

AleF83 commented 5 years ago

I suggest to use options instead of arguments in CLI encrypt command. The encrypt command will be as following:

kamus-cli encrypt  \
   --secret super-secret \
   --service-account kamus-example-sa \
   --namespace default \
   --kamus-url <Kamus URL>

This approach will make the command line arguments order invariant and also we will be able to implement support for secret stored in file fixing #35. For example for secret stored in file the command will be as following:

kamus-cli encrypt  \
   --secret-file /path/to/secret-file \
   --service-account kamus-example-sa \
   --namespace default \
   --kamus-url <Kamus URL>

I think it's more intuitive and self-describing command format.

omerlh commented 5 years ago

I think that the --secret is not required, the rest looks like a good proposal. Feel free to open a PR, we will appreciate the contribution :)

shaikatz commented 5 years ago

I actually like the --secret approach because as Alex said, it'll open a comfortable option to add the files support.

omerlh commented 5 years ago

I just think it is the only parameter that you expect to exist, but it's not critical. Both are good IMO

AleF83 commented 5 years ago

I'll PR this issue