cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 926 forks source link

service key as true JSON #2739

Open ThePlenkov opened 8 months ago

ThePlenkov commented 8 months ago

The problem

Cloud Foundry CLI delivers service-key command capable to print credentials. Unfortunately printing credentials to the terminal is not always secure. Additionally the response of this CLI is not parseable because of the text Getting key ... for service instance ... as ...

Yes, the solution is very simple now - just removing few lines with a script like this cf service-key $SK $SK-key | sed -n '2,$p' but still - since we talk about CLI it would be nice to make it a standard feature with some parameter like --parseable ( like in npm commands )

Desired solution Instead of the script like this cf service-key $SK $SK-key | sed -n '2,$p' | jq .credentials I'd like to run something like cf service-key $SK $SK-key --parseable | jq .credentials

foxracle commented 3 weeks ago

it is not common for a modern cli to output only something text for human-readable, but not easy-parse for automation. Is there anyone know the reasons?