Open tegefaulkes opened 2 months ago
Why not just go straight to Unix commands?
I'm following the spec you wrote out where Imagine (IN ORDER OF PRIORITY):
and read
, write
were top of the list. I can skip theses then since cat
will basically cover that functionality anyway.
The read
and write
commands are not normal unix commands. The historical context for this is https://github.com/MatrixAI/Polykey-CLI/issues/32#issuecomment-1767788230 (which should be added as the specific additional context above).
I would like cat
to be an alias of the read
command though as it's quite a common thing for shell users to use.
Specification
As part of the #32 issue refactoring, we need to implement a
secrets read
andsecrets write
command. Theses are the most basic method of accessing secrets.secrets read
This command needs to read the contents of a secret in a vault. The contents will be outputted to
stdout
. Pretty much just the existingsecrets get
command. I don't think any changes need to be made to it.The command takes the form of
pk secrets read [secretPath]
. The output can be redirected withpk secrets read [secretPath] > some file
and piping into it shouldn't do anything.secrets write
This command needs to update or create the contents of a file. There will be two ways to provide the secret contents here. Coompared to current implementation, this pretty much is just
secrets create
but allows you to update a secret as well.stdin
. so if you callsecrets write secretPath
you can type in you contents to the terminal and sendEOF
(ctrl+d) to finish writing.In both cases the behaviour should match
cat > file
.Additional context
Tasks
secrets read
command.secret write
command.