Get started
BETA
Browse docs
CLI Reference

justtunnel context

Manage which context the CLI uses for tunnel operations — personal or team.

A context is the identity the CLI uses for the current invocation. Every context is either personal (your individual account) or team:<slug> (a team you belong to). Tunnels you open and workers you create are scoped to whichever context is active.

context is a parent command — running it with no subcommand prints help. The three actions you can take are listed below.

On this page

  • list — list available contexts
  • use — set the active context
  • show — show the active context

Synopsis

justtunnel context <subcommand> [args] [flags]

You can also override the context for a single invocation without switching state:

justtunnel <port> --context team:acme

The --context flag is persistent — it works on every subcommand.


list

List the contexts you can switch to. Your personal context is always available; team contexts come from the server, fetched live with your auth token.

Synopsis

justtunnel context list [flags]

Examples

List contexts as a signed-in user

justtunnel context list
Available contexts:
* personal
  team:acme  (Acme, Inc.)
  team:beta-co  (Beta Co)

The asterisk marks the active context.

List contexts when you're not signed in

justtunnel context list
Available contexts:
* personal

(sign in with `justtunnel auth` to list team memberships)

Personal is always available; team listings need an auth token.

Flags

No flags.

Exit codes

CodeMeaning
0Listed successfully (including the offline / not-signed-in case).
1Failure — config could not be loaded or the server returned an unexpected error.

Network errors degrade gracefully: the CLI prints a warning to stderr and still shows your personal context.


use

Set the active context. Stored in the local config and synced to the server so worker connections can resolve the team without a flag.

Synopsis

justtunnel context use <name>

Valid <name> values are personal or team:<slug>.

Examples

Switch to a team

justtunnel context use team:acme
Active context set to team:acme.

The CLI verifies your membership against the server before writing the local config. A bogus team slug fails fast with a clear error rather than silently succeeding.

Switch back to personal

justtunnel context use personal
Active context set to personal.

Flags

No flags.

Exit codes

CodeMeaning
0Context updated. The new context is now the default for future invocations.
1Failure — invalid context name, you are not a member of the team, or the config could not be written.

If the server is unreachable, the CLI prints a stderr warning and still updates the local config so you can keep working offline.


show

Print the currently active context. Honors --context if passed.

Synopsis

justtunnel context show [flags]

Examples

justtunnel context show
team:acme

The output is a single line — easy to consume in a shell prompt or a script:

ctx=$(justtunnel context show)
echo "running as: $ctx"

Inspect what --context would resolve to

justtunnel context show --context team:beta-co
team:beta-co

Useful for validating the flag without actually running an operation.

Flags

No flags.

Exit codes

CodeMeaning
0Active context printed.
1Failure — config could not be loaded.

See also