layer0
layer0 copied to clipboard
CLI: Allow users to easily switch between Layer0 instances with a `-i/--instance` flag
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!
Related issues: #628 #627