-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand secrets env
command formatting options
#144
Comments
Related commentary: #129 (comment) |
Going over the formats we may want to support. For linuxLinux has a few ways to set envs. Right now we support The
Note that for this format doing
If you want these to be added to the current environment and children processes then you'd need to use To be continued. |
For windows we have to 'terminals' we need to support, For
|
I'll write up the powershell formats once I've looked into it more. In the mean time, removing So it means that we may just need a 2nd format option for the |
For powershell In the simplest form, the env is set in Powershell with For multiple lines It will be formatted much the same way. # vault1:SECRET1
$env:SECRET1 = 'this is the secret1'
# vault1:dir1/SECRET3
$env:SECRET3 = 'this is the secret3'
# vault2:SECRET2
$env:SECRET2 = 'this is the secret2'
# vault2:dir1/SECRET4
$env:SECRET4 = 'this is the secret4' I don't think there's an equivalent to the |
By default so not export unless the export flag is set. |
Do not export* - default behaviour should be to set shell session variables only! |
Here are all of the
|
That is currently the case, Right now there is no functionality to export envs unless you take one of the formatted outputs and do that manually. |
Oh cool - but I think it would be better to use |
I had named them for the files you're put them in by standard. For unix it's the For the |
I mean the "dotfiles" is not a standard... at least for CMD and powershell. The I still think And as long as the variables are locally defined by default, all 3 should be perfectly readable (maybe not CMD, but that's their fault for using CMD). |
I'm defaulting to |
Can we use |
Specification
There are a few parts to this.
First, we need to expand the range of formats available. While the basic linux ones are are supported we're missing formats useful for windows
CMD
andPowershell
.Second, while I appended the
dotenv
andprepend
format to the--format
choices. It seems this added the choices to all of the commands. This was unintended and needs to be fixed. This means the hacky implementation needs to be replaced by removing theformat
option from theCommandPolykey
constructor and making each command add theformat
option themselves. This means all commands need to be updated. Then select commands can add their own custom--format
if needed.Thirdly, all of the format options need to be clearly explained as part of the
secrets env --help
help output.Lastly, the
--format
option should default in such a way that the most appropriate platform specific format is used. This means we need to auto switch based on the platform.Additional context
pk secrets env
command for meeting Development Environment Usecase #31secrets env
command #129Tasks
--format
option is modified. It's currently changed globally but that is unintended.--format
option should default to the most appropriate env format for the platform/terminal it is run in. We can switch based on platform but it would be advantageous to detect CMD or Powershell on windows.The text was updated successfully, but these errors were encountered: