Forrest logo
tool overview
On this page you find all important commands for the CLI tool clj. If the command you are looking for is missing please ask our AI.

clj

The clj command line tool is used to interact with Clojure projects from the command line. It is part of the Clojure language and provides a variety of useful features for working with Clojure code.

Here are some key features and functionalities of clj:

  1. REPL (Read-Eval-Print-Loop): The clj tool allows you to start a Clojure REPL directly from the command line. REPL is an interactive environment where you can evaluate and experiment with snippets of Clojure code.

  2. Running scripts: You can use clj to run Clojure scripts (.clj files) directly from the command line. This allows you to execute standalone Clojure programs without needing to compile them into Java bytecode.

  3. Project management: clj provides project management capabilities through the use of deps.edn files. You can use clj to manage project dependencies, run tests, build artifacts, and more.

  4. Dependency management: With clj, you can specify dependencies for your Clojure projects. clj will automatically download and manage the required libraries, making it easy to include external libraries in your projects.

  5. Integration with build tools: clj integrates well with popular build tools like Leiningen and Boot. It can be used in conjunction with these tools to build, test, and package Clojure projects.

  6. Code formatting and linting: clj provides tools for formatting and linting Clojure code. It helps enforce consistent coding styles and identifies potential issues or mistakes in your code.

Overall, the clj command line tool is a powerful and versatile tool for working with Clojure projects, providing a range of features for development, testing, and project management.

List of commands for clj:

  • clj:tldr:2198b clj: Start a REPL (interactive shell).
    $ clj
    try on your machine
    explain this command
  • clj:tldr:4907b clj: Run the main function of a specified namespace.
    $ clj -M -m ${namespace} ${args}
    try on your machine
    explain this command
  • 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
    explain this command
  • clj:tldr:5afe1 clj: Execute a function.
    $ clj -X ${namespace-function_name}
    try on your machine
    explain this command
  • clj:tldr:a1b44 clj: Prepare a project by resolving dependencies, downloading libraries, and making / caching classpaths.
    $ clj -P
    try on your machine
    explain this command
  • clj:tldr:e6b2a clj: Start a REPL for ClojureScript and open a web browser.
    $ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.758"}}}' --main cljs.main --repl
    try on your machine
    explain this command
tool overview