Snapcraft `whoami`


#1

With the introduction of UX for snap collaboration and transfer it makes sense now to introduce

snapcraft whoami

The output of the command should have the following to the minimum:

  • email used to login to the store
  • developer id

Optionally:

  • permissions of the login (macaroon scopes)

I am not stuck on a specific output format, but replicating that of snap info seems logical to keep output mechanisms in check for informational queries that are not as complicated as a channel map (as used in e.g.; snapcraft status).

If following snap info formatting fully, the output would look like:

$ snapcraft whoami
Email:        email@email.com
Developer-id: ID

Done: snapcraft 2.31
Week 21 of 2017 in snapcraft
In progress: snapcraft 2.30
#2

The latter format looks good. I’d just suggest using lowercase fields as typical in our content elsewhere:

$ snapcraft whoami
email:         someone@example.com
developer-id:  ...

#3

thanks, will update with your comments


#4

Yeah this is great. Not only is it useful for snap collaboration/transfer, but for model assertions. Saying "run snapcraft whoami" is way easier than saying “go to the store and find your account ID.”


#5

Can we have the same thing for snap please? This is useful when you have several accounts and you want to know which one you are logged in to.


#6

#7

:sunglasses:

Thanks!


#8

shouldn’t it have a similar syntax?


#10

Here’s the initial PR for those tracking https://github.com/snapcore/snapcraft/pull/1332