Forrest logo
back to the clj tool

clj:tldr:5915f

clj: Start an nREPL server with the CIDER middleware.
$ clj -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.2"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' --interactive
try on your machine

This command is used to start a Clojure REPL (Read-Eval-Print Loop) with specific dependencies and middleware.

  • clj: This is the command to invoke the Clojure CLI (Command Line Interface), which is used to run Clojure programs.

  • -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.2"}}}': This option sets the project dependencies for the REPL. It specifies two dependencies: nrepl with version 0.7.0 and cider/cider-nrepl with version 0.25.2. Dependencies are downloaded from Maven repositories.

  • -m nrepl.cmdline: This option specifies the main namespace to invoke, in this case, nrepl.cmdline, which is responsible for starting the REPL.

  • --middleware '["cider.nrepl/cider-middleware"]': This option sets the middleware to be used by the REPL. Here, it specifies cider.nrepl/cider-middleware as the middleware to be loaded. Middleware provides additional functionality to the REPL, in this case, specifically for CIDER (Clojure Interactive Development Environment).

  • --interactive: This option indicates that the REPL should be started in an interactive mode, where it waits for user input and provides a prompt for Clojure expressions to be evaluated. This allows you to interactively experiment with Clojure code.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the clj tool