-A
takes one or more concatenated aliases, which are always simple or qualified keywords, e.g. -A:test
or -A:test:perf/benchmark
.
While -A
can be used with all execution commands, it is the only exec opt that can be used for REPL execution, and that is the most common reason to use it.
-X
takes one or more concatenated aliases, which are always simple or qualified keywords, e.g. -X:test
or -X:test:perf/benchmark
.
The -X
exec-opt indicates function execution, and all arguments after -X
are defined by that execution context. All clj-opts (-S
, -P
, etc) should be placed before the -X
.
-T
takes either a tool name (always symbols, not keywords) or one or more concatenated aliases, which are always simple or qualified keywords, e.g. -T:test
or -T:test:perf/benchmark
.
The -T
exec-opt indicates tool execution, and all arguments after -T
are defined by that execution context. All clj-opts (-S
, -P
, etc) should be placed before the -T
.
-M
takes one or more concatenated aliases, which are always simple or qualified keywords, e.g. -M:test
or -M:test:perf/benchmark
.
The -M
exec-opt indicates clojure.main execution, and all arguments after -M
are defined by that execution context. All clj-opts (-S
, -P
, etc) should be placed before the -M
.
Use -P
before any of the other exec-opts (-A
, -X
, -M
, -T
) to do a full deps expansion, download deps, and cache the classpath, but not actually execute the function, tool, main, etc.
Use -J
to prefix any JVM option that should be provided to your program (the -J
will be stripped). For example, -J-Xmx1g
or -J-XX:+HeapDumpOnOutOfMemoryError
. -J
can be used with all execution modes that run a program (repl, -X
, -T
, -M
).
Also see JVM opts for more information on other ways to supply JVM opts.
Use -Sdeps
to supply an additional deps.edn source on the command line. This is used as the last deps source in the merge. The deps data will need to be appropriately quoted for the command line.
Use -Srepro
to omit the user deps.edn from the deps sources. This omits any user-specific configuration to ensure the command is repeatable for others.
Use -Spath
to compute and print the classpath.
Use -Stree
to compute and print the dependency tree. See the dependency expansion page for more information on the tree printing output.
When this option is used, the classpath is not computed and the provided classpath is used instead. This is mostly useful in testing or debugging. In general, you should let the Clojure CLI compute (and cache) your classpath based on the deps.edn settings.
This flag marks the existing cached classpath (if any) to be marked as stale. The classpath will be recomputed and cache.
Print environment and path information found and used by the Clojure CLI, mostly useful for debugging the location of various config and cache directories.
This flag does not alter any other execution that may be specified on the command line, so it can be used to debug the location of the cache files for a particular command.
Print configuration settings as edn data and exit. This overlaps in functionality with -Sverbose
but may be useful for programmatic use.
By default, dep expansion will happen using a thread pool sized based on the processor count. Use this setting to change the number of threads used during expansion. Setting to 1 will do expansion serially with a single thread.
The dependency tree printed by -Stree
or -X:deps tree
often contains sufficient information to debug why a particular lib or lib version was selected. However, if you need more information, this flag prints significantly larger information to a trace.edn file that can be used when filing an issue on tools.deps at Ask Clojure.
Prints the Clojure CLI version to either stdout (--version
) or stderr (-version
). Note that while the Clojure CLI version determines the default Clojure version used in execution, any version of the CLI can use any version of Clojure, and the Clojure version can be set in deps.edn files to change that version.
See the tools release page for more version and changelog information.
Print help to console. Also see man clojure
.