davidchalifoux / kaput-cli

The unofficial CLI client for Put.io - Kaput lets you manage your Put.io account from the comfort of your terminal!
https://kaput.sh/
MIT License
68 stars 7 forks source link

Support multiple users #4

Closed plambert closed 4 years ago

plambert commented 4 years ago

When there are several accounts to be used, it'd be nice to pass an account name, like --profile main or --profile friend1, and have that used as a key in the configuration file.

So the config file would change from:

{ 
  "authCode": "aaaaaa",
  "accessToken": "bbbbbbbbb"
}

To:

{
  "default": { 
    "authCode": "aaaaaa",
    "accessToken": "bbbbbbbbb"
  }
}

And additional profiles can be logged into and used via the --profile option to all the commands.

(It'd also be nice to take the profile from the environment variable PUTIO_PROFILE if one isn't passed on the command line, and then default to default if the env var is empty too...)

Sorry for all the requests, I appreciate your time!

davidchalifoux commented 4 years ago

No worries about the requests! Thank you for adding appropriate details to them.

This is a great idea. I haven't considered that some people would use multiple profiles at once.

davidchalifoux commented 4 years ago

Added in https://github.com/davidchalifoux/kaput-cli/commit/c56942ae7c006d6720fbbda6a110084287b63956 Releasing v1.0.0 to NPM soon.