layer0 icon indicating copy to clipboard operation
layer0 copied to clipboard

CLI: Allow users to easily switch between Layer0 instances with a `-i/--instance` flag

Open zpatrick opened this issue 8 years ago • 1 comments

We should store the endpoint and token variables for each user's Layer0 instance in a flat file (perhaps ~/.layer0/config.ini?) that can be referenced - ala the aws cli.

We would also introduce a -i/--instance flag that would allow users to easily run commands to different Layer0 instances without needing to update environment variables all the time, e.g.:

$ l0 -i team1 service list
SERVICE ID  SERVICE NAME  ENVIRONMENT
api         api           api
guestbo123  guestbook     dev

$ l0 -i team2 service list
SERVICE ID  SERVICE NAME  ENVIRONMENT
api         api           api
consul123   consul        test

We could store this info into a config.ini file:

[team1]
endpoint = "..."
token = "..."

[team2]
endpoint = "..."
token = "..."

...and introduce a configure command:

$ l0 configure team1
Endpoint [<current endpoint or empty>]: <user inputs endpoint>
Token  [<current token or empty>]: <user inputs token>

Instance "team1" has successfully been configured!

zpatrick avatar Apr 19 '17 01:04 zpatrick

Related issues: #628 #627

tlake avatar Jun 25 '18 20:06 tlake