Fork me on GitHub
#nrepl
<
2019-04-26
>
flowthing11:04:25

I'd like to do the equivalent of lein repl :connect with clj. That is, something along the lines of clj -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} nrepl/drawbridge {:mvn/version "0.2.0"}}}' -m nrepl.cmdline --interactive --connect --url . I think that's currently not possible, since the --url flag doesn't exist. Would it make sense to add something like that?

flowthing12:04:43

...although it's pretty easy to just do something like that yourself. I pieced together a small app that connects to a Drawbridge nREPL endpoint and uses rebel-readline for the REPL stuff.

pez13:04:20

Tried --host and --port?

flowthing06:04:51

Yes, but if the Drawbridge endpoint is e.g. at http://localhost:3001/repl, host and port isn't enough, need to pass the /repl bit as well. And anyway, connecting to a Drawbridge endpoint is done via nrepl/url-connect, whereas nrepl.cmdline currently uses nrepl/connect.

pez07:04:55

Gotcha. Completly missed the /repl part.

bozhidar14:04:43

The problem is that for connect to know how to handle http, drawbridge has to have been required already. There’s no real need for a separate param. We just need to add some check in the cmd client to require the drawbridge client ns (if present).

bozhidar14:04:23

That’s a common problem for all third-party transports url-connect should be made aware of them somehow, so it’d work with them.