Switch between accounts (contexts)
Run tunnels and workers under either your personal account or a team you belong to.
You want to switch the CLI between your personal account and a team — for example, opening tunnels under team:acme while you're on a customer call, then back to personal for your own side projects.
JustTunnel calls each identity a context. Every context is either personal (your individual account) or team:<slug> (a team you belong to). The active context determines which account a tunnel is opened under and which team owns any worker tunnels you create.
You'll need an authenticated CLI (justtunnel auth) and at least one team membership if you want anything beyond personal.
Steps
1. List the contexts you can use
justtunnel context list
Available contexts:
* personal
team:acme (Acme, Inc.)
team:beta-co (Beta Co)
The asterisk marks the active context. Personal is always available; team contexts come from the server, looked up live with your auth token. If you're not signed in, only personal is shown along with a hint to run justtunnel auth.
2. Switch the active context
justtunnel context use team:acme
Active context set to team:acme.
The CLI verifies you're actually a member of team:acme against the server before writing the local config. A bogus slug fails fast with you are not a member of team:bogus -- run \justtunnel context list` to see available teams`.
The active context persists across CLI invocations — every subsequent justtunnel <port>, justtunnel worker ..., etc. runs under it until you switch back.
3. Confirm what's active
justtunnel context show
team:acme
show prints a single line — easy to consume in a shell prompt or a script.
4. Override for one invocation only
If you only need a different context for a single command, pass --context instead of switching globally. The flag is persistent — it works on every subcommand:
justtunnel 3000 --context team:beta-co
justtunnel worker list --context team:beta-co
The local active context stays untouched; only this one invocation runs under team:beta-co.
5. Switch back to personal
justtunnel context use personal
Active context set to personal.
Verify
After switching, open a tunnel and confirm it lands under the right account:
justtunnel context use team:acme
justtunnel 3000
justtunnel status
The status output shows the active plan and tunnel count — both should reflect the team you switched into, not your personal account.
If a worker command refuses to run with worker commands require a team context, you're on personal — switch with justtunnel context use team:<slug> first.
Common issues
you are not a member of team:<slug>. The server doesn't list you on that team. Runjusttunnel context listto see what you actually have access to. If a team is missing, ask whoever owns it to invite you.- Offline / unreachable server. If the server can't be reached,
context useprints a stderr warning and still updates the local config so you can keep working offline. Membership is re-verified next time the network is available. - Worker commands rejected on
personal. Worker tunnels are team-only. Switch into a team context before running anyjusttunnel worker ...command — see Run a worker tunnel.
Related
justtunnel context— full CLI reference forlist,use, andshow.justtunnel worker— worker commands run inside a team context.- Run a worker tunnel — set up a long-lived team-owned tunnel.
- Contexts — how the active context resolves on every CLI invocation.
- Plans and limits — what each tier includes.