How to embed REPL to clojure application?



I have an application which runs different tasks. It would make debugging much simpler, if I could open a repl inside of the running application. I like to be able to inspect, start/stop tasks, add items to core.async channels… simply control the running application “from inside” using a repl.

How is it possible to reach? I tried to follow, but I could not reach vars defined in the application.

Can you point me to a working example, where in app repl is used?

Thank you,



Hi, George,

I don’t know why you were not able to reach your application vars, are you sure you were in the right namespace? You might need to call in-ns after connecting to your nrepl in order to get there.

Here is the way I have embedded a repl in my own application, and it works the way I expect:

I hope you can get this working because it definitely is helpful!




Hi George,

Sorry I didn’t answer sooner. I was on vacation.

If you’ve managed to connect over nrepl, you’ve accomplished the hardest part. Once you’ve connected, you can navigate around using functions like in-ns

Oh, and now I see that James mentioned the same solution. I often connect CIDER to an nrepl server using M-x cider-connect. It will ask for the host and the port. Then I can use my normal CIDER workflow within (recompiling, inspecting, etc).

Rock on!