balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
457 stars 143 forks source link

Simpler way of getting logged in username #722

Open imrehg opened 7 years ago

imrehg commented 7 years ago

Currently the resin whoami command gives plenty to of info

$ resin whoami
== ACCOUNT INFORMATION
USERNAME: username
EMAIL:    user@email.com
URL:      resin.io

It would be great to have a "quiet" mode, that would just output the username:

$ resin whoami -q
username

(I'm guessing -q, --quiet option, just like many of the docker commands are)

pimterry commented 7 years ago

Looks like this is a nice to have, based on the linked thread, but not super important. Is that right? If so, I'm going to pull it into the redesign pile - I'd like to think about it there and come up with a consistent way of doing a 'quiet mode' in general, and think about where else it might be useful, rather than just adhoc adding it straight away. Is that ok?

pdcastro commented 5 years ago

Related to #1089. If the CLI commands in general had a "scriptable" mode that produced machine-readable output like JSON, a username could be filtered with something like:

balena whoami -S | jq .username