Skip to content

v2.7.1

Latest

Choose a tag to compare

@licht1stein licht1stein released this 17 Feb 17:36
· 1 commit to master since this release

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

  1. -p <port> CLI argument
  2. .nrepl-port file
  3. BREPL_PORT environment variable
  4. 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.

Full changelog

  • feat: stateless nREPL port auto-discovery via process scanning (#21, closes #20)
  • perf: parallel port scanning with single-connection validation
  • docs: updated README with auto-discovery documentation
  • fix: test assertion for updated error message