Contexts
Manage connections to multiple funnel servers
Contexts let you configure and switch between multiple funnel servers. Each context stores a server URL and authentication token.
Config file
Contexts are stored in ~/.config/funnel/config.toml:
current_context = "production"
[contexts.production]
server = "https://tunnel.example.com"
token = "fnl_abc123..."
[contexts.staging]
server = "https://staging.tunnel.example.com"
token = "fnl_def456..."The file is created with 0600 permissions to protect tokens.
Create a context
funnel context create production --server https://tunnel.example.comThe first context you create automatically becomes the active one.
Switch contexts
funnel context use stagingAll subsequent commands use the staging server and token.
List contexts
funnel context listDelete a context
funnel context delete stagingIf you delete the active context, funnel switches to the next available one.
Environment overrides
Environment variables take precedence over the config file:
| Variable | Overrides |
|---|---|
FUNNEL_CONTEXT | Active context name |
FUNNEL_SERVER | Server URL for the resolved context |
FUNNEL_TOKEN | Token for the resolved context |
This is useful in CI or scripts where you don't want to modify the config file:
FUNNEL_SERVER=https://ci.tunnel.example.com FUNNEL_TOKEN=fnl_ci_key funnel http 3000Per-command override
You can also override the context for a single command with --context:
funnel --context staging status