dropbox / dbxcli

A command line client for Dropbox built using the Go SDK
Other
1.06k stars 99 forks source link

Add `account` command #15

Closed waits closed 7 years ago

waits commented 8 years ago

The account command displays information about the current user's account. Currently it displays the user's name, email, ID, account type, locale, referral link, paired status, and team info (if applicable).

It also takes an optional account ID to look up instead of the current user. In this case it displays slightly less info than when displaying the current account (due to API restrictions).

It also displays the team name and member ID if applicable. I don't have a business account to test with, though, so please double-check that it works.

Examples:

$ dbxcli account
Logged in as Dylan Waits <dylan@waits.io>

Account Id:        [redacted]
Account Type:      pro
Locale:            en
Referral Link:     [redacted]
Profile Photo Url: [redacted]
Paired Account:    true
$ dbxcli account dbid:xxxx
Name:              Dylan Waits
Email:             dylan@waits.io
Is Teammate:       true
Profile Photo URL: [redacted]
diwakergupta commented 8 years ago

@waits what was your primary motivation for this command? As in, how are you using it in practice?

waits commented 8 years ago

@diwakergupta In order of potential usefulness (for myself, anyways, but hopefully for others as well):

  1. A method of determining who you're logged in as. Most tools that log in to an account show you your name / account identifier in some way. For CLI tools, it's usually an account/info/whoami command. This is crucial because people (including myself) may have multiple accounts (or a shared computer) and thus need to know which account they're about to upload files to. A natural extension of this would be a logout command, but I made an issue to discuss that.
  2. A method of getting your account details without having to open a web browser. For people that primarily use the command line this would be very convenient. Of these details referral_link is the one I'm most interested in, although the profile photo is also handy, and account type is nice to know. I'll admit the locale doesn't seem all that useful; I was just trying to be complete.
  3. (this is not a real justification) The second part of this command, looking up another user by their ID, was driven more by API completeness than a real use case. My thinking was "Dropbox included this in their API, so someone must find it useful". I wasn't sure from the readme if you were aiming for full API functionality or not. If you can't fathom any realistic use case I'm totally OK with dropping this part.
diwakergupta commented 7 years ago

Thanks @waits !