skybet / cali

Cali Automation Layout Initialiser
MIT License
32 stars 7 forks source link

Allow piping via stdin #51

Open lucymhdavies opened 6 years ago

lucymhdavies commented 6 years ago

Currently not possible in Cali, but recently fixed in the closed-source pscli:

For example, this would allow things like this:

$ cat foo.json | jq .
{
  "foo": "bar",
  "baz": [
    "a",
    "b",
    "c"
  ]
}

$ cat foo.json | pscli vault write secret/lucytest -
Success! Data written to: secret/lucytest

$ pscli vault read secret/lucytest
Key                 Value
---                 -----
refresh_interval    768h
baz                 [a b c]
foo                 bar

(the example above is using a modified version of the hashicorp/vault image)

lucymhdavies commented 6 years ago

In fact, the example above already has a test Cali app that can be used to test this specific use case:

https://github.com/LMHD/lucli/blob/master/cmd/vault.go

Which can be run as

cat foo.json | lucli --vault-address=https://vault.fancycorp.io vault -- write secret/lucytest