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 works

When you connect, your workspace's DNS is configured to resolve environment service names. No port forwarding or IP addresses needed.

Connecting

kl env connect

Connect to an environment interactively or by name.

kl env connect               # Interactive selection
kl env connect my-env        # Connect to specific environment
Disconnect

Removes active intercepts and clears DNS config.

kl env disconnect
Check status

Shows connected environment and available services.

kl env status

Accessing Services

After connecting, use service names as hostnames. Always include the port number.

Examples

Use 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.