CLOJURE(1) General Commands Manual CLOJURE(1)

# [NAME](#NAME)

clj, clojure - runners to launch Clojure programs

# [SYNOPSIS](#SYNOPSIS)

**clj** \[**clj-opts**] \[**-Aaliases**]  
**clojure** \[**clj-opts**] **-X**\[**aliases**] **my/fn?** \[**kpath v** ...] **kv-map?**  
**clojure** \[**clj-opts**] **-T**\[**name|aliases**] **my/fn** \[**kpath v** ...] **kv-map?**  
**clojure** \[**clj-opts**] **-M**\[**aliases**] \[**init-opts**] \[**main-opts**] \[**args**]

# [DESCRIPTION](#DESCRIPTION)

The **clojure** tool is a runner for Clojure programs. **clj** is a wrapper for **clojure** that uses rlwrap to provide a better interactive experience. Users will typically run **clj**.

# [EXAMPLES](#EXAMPLES)

You can launch a Clojure REPL by running **clj**.

See the Deps and CLI Guide below for more complex usage.

# [OPTIONS](#OPTIONS)

The **clj** and **clojure** scripts can take three types of options, as shown in the synopsis. **clj-opts** are used to build the java-opts and classpath. **init-opts** refer to Clojure code to execute. **main-opts** are options to clojure.main.

## [clj-opts](#clj-opts)

[**-Jopt**](#J)

Pass opt through in java\_opts, ex: -J-Xmx512m

[**-Aaliases**](#A)

Concatenated aliases for REPL execution, ex: -A:dev:mem

[**-Xaliases fn KPATH V**](#X)

Exec alias to invoke one or more functions that take a map, with keypath/value overrides. Function must either be supplied or be in :exec-fn argmap for alias

[**-Maliases**](#M)

Exec clojure.main, either from opts in alias or command line

[**-P**](#P)

Prepare - download libs, cache classpath without executing

[**-Sdeps EDN**](#Sdeps)

Deps data or file to use as the last deps file to be merged

[**-Spath**](#Spath)

Compute classpath and echo to stdout only

[**-Stree**](#Stree)

Print dependency tree

[**-Scp CP**](#Scp)

Do NOT compute or cache classpath, use this one instead

[**-Srepro**](#Srepro)

Ignore the ~/.clojure/deps.edn config file

[**-Sforce**](#Sforce)

Force recomputation of the classpath (don't use the cache)

[**-Sverbose**](#Sverbose)

Print important path info to console

[**-Sthreads N**](#Sthreads)

Set specific number of download threads

[**-Strace**](#Strace)

Write a trace.edn file that traces deps expansion

**--**

Stop parsing dep options and pass remaining arguments to clojure.main

[**--version**](#version)

Write version to stdout and exit

[**-version**](#version~2)

Write version to stderr and exit

## [init-opts](#init-opts)

[**-i**, **--init path**](#i)

Load a file or resource located at *path*

[**-e**, **--eval string**](#e)

Eval exprs in *string*; print non-nil values

[**--report target**](#report)

Report uncaught exception to *target*: "file" (default), "stderr", or "none", overrides System property clojure.main.report

## [main-opts](#main-opts)

[**-m**, **--main ns-name**](#m)

Call the -main function from namespace w/args

[**-r**, **--repl**](#r)

Run a repl

[*path*](#path)

Run a script from a file or resource located at *path*

**-**

Run a script from standard input

[**-h**, **-?**, **--help**](#h)

Print this help message and exit

# [CONFIGURATION](#CONFIGURATION)

This script reads configuration from **deps.edn** files. It will check against **deps.edn** files in the system root location, the user configuration directory (usually **~/.clojure**), and the local directory. Files in each of these locations, if they exist, are merged to form one combined configuration file. The last specified configuration file's options overwrites any earlier files (e.g. local configs take priority).

# [SEE ALSO](#SEE_ALSO)

[https://clojure.org/guides/deps\_and\_cli](https://clojure.org/guides/deps_and_cli)

Deps and CLI Guide

[https://clojure.org/reference/deps\_edn](https://clojure.org/reference/deps_edn)

deps.edn Reference

[https://clojure.org/reference/clojure\_cli](https://clojure.org/reference/clojure_cli)

Clojure CLI Reference

[https://clojure.org/reference/repl\_and\_main](https://clojure.org/reference/repl_and_main)

REPL and Main Entrypoints

[https://clojure.org/releases/tools](https://clojure.org/releases/tools)

Release history and changelog

# [BUGS](#BUGS)

File issues at https://ask.clojure.org under category Libs / tools.deps.

# [AUTHORS](#AUTHORS)

clojure and clj are maintained by Alex Miller &lt;alex.miller@cognitect.com&gt;. This man page was written by Elana Hashman &lt;ehashman@debian.org&gt;.

# [COPYRIGHT](#COPYRIGHT)

Copyright © Rich Hickey, Alex Miller and contributors.

Distributed under the Eclipse Public License 1.0, the same as Clojure.

2019 June 6

---

Document: clojure(1) from clojure-tools 1.12.6.1673-r2 (Chainguard OS)
Source: https://github.com/clojure/brew-install
