Switching Between Environments

I currently use two zrok environments - one at api.zrok.io and one on my self-hosted zrok service. To "switch" from a self-hosted environment to a one at api.zrok.io, I need to do something like,

zrok disable
zrok config set apiEndpoint https://api.zrok.io
zrok enable <token>

Is there a better way to interact with multiple environments?

If you're on Linux, you can use a HOME environment variable...

# main environment
$ zrok enable <token> 

# another environment
$ HOME=/tmp/another zrok enable <token>

and then you can do things like:

$ HOME=/tmp/another zrok share public ...

I am on Linux, so was able to do the following,

alias zrok-private 'HOME=~/.config/zrok/private zrok'
alias zrok-public 'HOME=~/.config/zrok/public zrok'

and then

> zrok-public enable <token>
> zrok-public overview # βœ”οΈ

> zrok-private config set apiEndpoint <endpoint>
> zrok-private enable <token>
> zrok-private overview # βœ”οΈ

which resulted in

❯ tree -a ~/.config/zrok
.config/zrok
β”œβ”€β”€ private
β”‚   └── .zrok
β”‚       β”œβ”€β”€ config.json
β”‚       β”œβ”€β”€ environment.json
β”‚       β”œβ”€β”€ identities
β”‚       β”‚   └── environment.json
β”‚       └── metadata.json
└── public
    └── .zrok
        β”œβ”€β”€ environment.json
        β”œβ”€β”€ identities
        β”‚   └── environment.json
        └── metadata.json

:clap:

I like your use of aliases better than the symlink method I've been using. Will adopt!