{"id":15010646,"url":"https://github.com/vlaaad/remote-repl","last_synced_at":"2025-04-09T18:34:29.727Z","repository":{"id":62435135,"uuid":"284470953","full_name":"vlaaad/remote-repl","owner":"vlaaad","description":"Remote repl for Clojure","archived":false,"fork":false,"pushed_at":"2021-11-18T19:11:18.000Z","size":14,"stargazers_count":34,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T21:38:03.377Z","etag":null,"topics":["clojure","repl"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlaaad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"vlaaad"}},"created_at":"2020-08-02T13:51:01.000Z","updated_at":"2024-05-31T07:57:24.000Z","dependencies_parsed_at":"2022-11-01T21:02:32.758Z","dependency_job_id":null,"html_url":"https://github.com/vlaaad/remote-repl","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlaaad%2Fremote-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlaaad%2Fremote-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlaaad%2Fremote-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlaaad%2Fremote-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlaaad","download_url":"https://codeload.github.com/vlaaad/remote-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088260,"owners_count":21045671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","repl"],"created_at":"2024-09-24T19:35:12.235Z","updated_at":"2025-04-09T18:34:29.710Z","avatar_url":"https://github.com/vlaaad.png","language":"Clojure","funding_links":["https://github.com/sponsors/vlaaad"],"categories":[],"sub_categories":[],"readme":"# Remote repl\n[![Clojars Project](https://img.shields.io/clojars/v/vlaaad/remote-repl.svg)](https://clojars.org/vlaaad/remote-repl)\n\n## Rationale\n\nSometimes I want to open a remote socket repl from my repl, but Clojure does not \nprovide a way to do this out of the box. \n\n## Usage\n\nTo give it a try, you need a socket repl available on the network. You can start\nit with this shell command:\n```sh\n$ clj \"-J-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}\" \n```\n\nNow you can connect to that process from another process\n```\n$ clj -Sdeps '{:deps {vlaaad/remote-repl {:mvn/version \"1.2.12\"}}}'\nClojure 1.10.1\nuser=\u003e (require '[vlaaad.remote-repl :as rr])\nnil\nuser=\u003e (rr/repl :port 5555)\n;; at this point, forms sent to the repl are evaluated on the remote process \nuser=\u003e (System/getProperty \"clojure.server.repl\")\n\"{:port 5555 :accept clojure.core.server/repl}\"\nuser=\u003e :repl/quit\n;; now we are back to evaluating in our local process.\nnil\nuser=\u003e \n```\n\nYou can use `-main` to immediately drop into a remote repl:\n```\n$ clj -Sdeps '{:deps {vlaaad/remote-repl {:mvn/version \"1.2.12\"}}}' -m vlaaad.remote-repl :port 5555\nuser=\u003e (System/getProperty \"clojure.server.repl\")\n\"{:port 5555 :accept clojure.core.server/repl}\"\nuser=\u003e :repl/quit\n```\n\nYou can use `-X` style invocation:\n```\n$ clj -Sdeps '{:deps {vlaaad/remote-repl {:mvn/version \"1.2.12\"}}}' -X vlaaad.remote-repl/repl :port 5555\n```\n\nYou can install remote repl as a tool:\n```\nclj -Ttools install \\\n  vlaaad/remote-repl '{:git/url \"https://github.com/vlaaad/remote-repl.git\" :git/tag \"v1.2.12\"}' \\\n  :as remote-repl\nclj -Tremote-repl repl :port 5555\n```\n\n## Reconnecting\n\nIt might be useful to automatically reconnect to the remote REPL. For \nexample, you might want to restart your REPL server during development to update\ndependencies. You can use `:reconnect true` option to keep the REPL client \nreconnecting, that way it will keep connecting to the remote REPL while the JVM is alive.\n\nExample:\n\n```shell\n$ clj -Sdeps '{:deps {vlaaad/remote-repl {:mvn/version \"1.2.12\"}}}' \\\n  -X vlaaad.remote-repl/repl \\\n  :port 5757 :reconnect true\nReconnecting to localhost:5757\nReconnecting to localhost:5757\n...\n```\n\nThen, start a REPL server on port 5757 in a different terminal:\n\n```shell\n$ clj -J-Dclojure.server.repl='{:port 5555 :accept clojure.core.server/repl}'\n```\n\nOnce it starts, first terminal will establish the connection:\n```shell\n...\nReconnecting to localhost:5757\nReconnecting to localhost:5757\nuser=\u003e \n```\n\n## Acknowledgements\n\nThis project is similar to [tubular](https://github.com/mfikes/tubular), but \nsmaller (only 70 lines of code and no dependencies). It is inspired by \n[clojure.core.server/remote-prepl](https://github.com/clojure/clojure/blob/0035cd8d73517e7475cb8b96c7911eb0c43a1a9d/src/clj/clojure/core/server.clj#L295-L338),\nbut does not require its target to be a prepl.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlaaad%2Fremote-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlaaad%2Fremote-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlaaad%2Fremote-repl/lists"}