babashka

ag 2025-07-27T19:48:43.312579Z

If I have a script that starts nrepl server. How can I run another process with bb -e that runs a function in the context of that nrepl instance?

✅ 1
ag 2025-07-27T19:54:19.750999Z

I guess https://github.com/babashka/nrepl-client is the answer?

ag 2025-07-27T20:03:17.443979Z

yup, that seems to be working.

borkdude 2025-07-27T20:09:40.593629Z

👍

borkdude 2025-07-27T20:10:05.263849Z

do you only need this to execute a function to initialize the repl?

borkdude 2025-07-27T20:10:15.430219Z

if so, there's an option for that in the nrepl server

ag 2025-07-27T20:20:21.615479Z

No, no, I really need to run a function while connecting to the existing nrepl instance. I wrote my wayland compositor config in babashka. It initially does: (nrepl/start-server! {:port 7888}) Later, I need to run shit through my compositor's IPC, basically issuing bash commands. But what I want is to be able to execute my Clojure code. Of course I could just use bb -e bla-bla where "bla-bla" would require things and run them - no problem. However, what If later I'll have to deal with some stateful things, so I thought, why not run thy shit while connecting to the existing REPL.

👍 1