Environment Connection
Connect your workspace to an environment to access services by name. Once connected, services like postgres or redis become directly reachable from your workspace.
How it worksWhen you connect, your workspace's DNS is configured to resolve environment service names. No port forwarding or IP addresses needed.
Connecting
kl env connectConnect to an environment interactively or by name.
kl env connect # Interactive selection
kl env connect my-env # Connect to specific environment
DisconnectRemoves active intercepts and clears DNS config.
kl env disconnect
Check statusShows connected environment and available services.
kl env status
Accessing Services
After connecting, use service names as hostnames. Always include the port number.
ExamplesUse service names in your application configuration.
From terminal
psql -h postgres -p 5432 -U myuser
redis-cli -h redis -p 6379
curl http://api:8080/health
In application config
DATABASE_URL=postgresql://user:pass@postgres:5432/myapp
REDIS_URL=redis://redis:6379
API_ENDPOINT=http://api:8080
Available service names
Run kl env status to see all services and their ports in the connected environment.