Stateless nREPL Port Auto-Discovery
brepl now automatically discovers running nREPL servers when no .nrepl-port file, -p flag, or BREPL_PORT env var is found. Zero configuration required.
How it works
- Scans for Java/Clojure/Babashka processes listening on TCP ports via
lsof - Checks all candidate ports in parallel using
pmap - Validates each port with a single TCP connection (describe + CWD eval)
- Returns the first port whose working directory matches yours
Port resolution order
-p <port>CLI argument.nrepl-portfileBREPL_PORTenvironment variable- Process scanning ← new
Performance
Discovery completes in ~100-200ms even with many Java processes running. Real nREPL servers respond in <5ms on localhost; non-nREPL ports are rejected within 100ms.