anchor.diff:  -                   Run a script from standard input
   -h, -?, --help      Print this help message and exit
   ----
  +
  +=== deps.edn
  +
  +The dependency configuration is stored in files named deps.edn. After installation, deps.edn configuration files can be found in (up to) three locations:
  +
  +- installation directory - created and modified only at install time
  +- config directory (often ~/.clojure) - modified by you to change cross-project (or no-project) defaults
  +- the local directory - for per-project settings
    
  -When a classpath is not available, the following process is used to construct the classpath:
  +The deps.edn file is an instance of the `::deps-map` https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/specs.clj[spec]. 
  +
  +Example:
  +
  +[source,clojure]
  +----
  +{
  + ;; Paths in project
  + :paths ["src"]
  +
  + ;; Project dependencies, a map from lib to coordinate
  + :deps {
  +   org.clojure/clojure {:mvn/version "1.8.0"}
  +   ring {:mvn/version "1.5.0"}
  +   hiccup {:mvn/version "1.0.5"}
  + }
  +
  + ;; Aliases that can be used with -R and -C
  + :aliases {
  +   ;; An alias that adds an extra dep to use for benchmarking: -R:bench
  +   :bench {:extra-deps {criterium {:mvn/version "0.4.4"}}}
  +
  +   ;; An alias to override the default Clojure version: -R:1.9
  +   :1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}}}
  +
  +   ;; A classpath override alias to use a local build of Clojure: -C:dev
  +   :dev {:classpath-overrides {org.clojure/clojure "/Users/me/clojure/target/classes"}}
  +
  +   ;; Add extra paths to the classpath: -C:test
  +   :test {:extra-paths ["test"]}
  + }
  +
  + ;; Configure Maven repos - these are typical set in the system deps.edn only
  + :mvn/repos {
  +   "central" {:url "https://repo1.maven.org/maven2/"}
  +   "clojars" {:url "https://clojars.org/repo/"}
  + }
  +}
  +----
  +
  +=== Classpath construction
  +
  +The following process is used to construct the classpath for invoking clojure.main:
   
   * Compute the deps map
  -** Read the deps.edn file in the following locations:
  +** Read the deps.edn configuration file in the following locations:
   *** Install directory (unless -Srepro)
   *** Config directory (if it exists and unless -Srepro)
   *** Current directory (if it exists)
  
positive.code: *** Else use `$HOME/.clojure`
  ** Contents:
  *** `deps.edn` - user deps file, defines default Clojure version and provider defaults
  * cache directory
  ** Lazily created if `clojure` is invoked without a local `deps.edn` file. Locations checked in this order:
  *** If `$CLJ_CACHE` is set, then use `$CLJ_CACHE` (explicit override)
  *** If `$XDG_CACHE_HOME` is set, then use `$XDG_CACHE_HOME/clojure` (follows Freedesktop conventions)
  *** Else use `config_dir/.cpcache`
  ** Contents:
  *** See the section below on classpath caching
  
  == Classpath caching
  
  Classpath files are cached in the current directory under `.cpcache/`. File are of two forms:
  
  * `.cpcache/<hash>.libs` - a `::lib-map` in the https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/specs.clj[specs], the output of running `resolve-deps`
  * `.cpcache/<hash>.cp` - a classpath string, the output of `make-classpath`
  
  where the `<hash>` is based on the config file paths, the resolve-aliases, and the classpath aliases.
  
  The cached classpath file is used when:
  
  * It exists
  * It is newer than all `deps.edn` files
  
  == Examples
  
  === Running a REPL from anywhere
  
  * Invoke: `clj`
  * Given: No deps.edn file in the current directory.
  * Result: Start a repl using the default deps file at <install>/deps.edn.
  
  === Running a REPL using deps.edn in the current directory
  
  * Invoke: `clj`
  * Given: A deps.edn file in the current directory.
  * Result: Start a repl using the deps.edn file at ./deps.edn.
  
  === Including a test source directory into a classpath
  
  * Invoke: `clj -C:test`
  * Given: A deps.edn file like the one below.
  * Result: Start a repl including external deps and a test source directory root.
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}}
   :aliases {
     :test {:extra-paths ["test"]}
   }
  }
  ----
  
  === Refer to a specific jar on disk
  
  * Invoke `clj`
  * Given: A deps.edn file like the one below.
  * Result: Includes a specific jar file in your classpath
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}
          oracle/driver {:local/root "/path/to/oracle/driver.jar"}}}
  ----
  
  === Refer to another project on disk that has a deps.edn file
  
  * Invoke `clj`
  * Given: A deps.edn file like the one below
  * Result: Includes another project defined on disk, using /path/to/project/deps.edn will be used as the source of paths and deps for the dependency project. Support for other project types (pom.xml, project.clj) will be possible, but is not yet implemented.
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}
          my.company/sibling-project {:local/root "/path/to/project"}}}
  ----
  
  === Running a Clojure namespace in the current directory
  
  * Invoke: `clojure -m my.app 1 2 3`
  * Result: Load the my.app namespace and invoke my.app/-main with the arguments `1 2 3`. If a deps.edn file exists, use it, otherwise use the default deps file.
  
  === Add an optional dependency to your classpath
  
  * Invoke: `clj -R:bench`
  * Given: A deps.edn file like the one below.
  * Result: Start a repl using the deps and add the extra deps defined by the `:bench` alias.
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.8.0"}}
   :aliases {:bench {:extra-deps {criterium {:mvn/version "0.4.4"}}}}}
  ----
  
  === Add an optional dependency and override a dependency
  
  * Invoke: `clj -R:bench:1.9`
  * Given: A deps.edn file like the one below.
  * Result: Start a repl using the deps and add the extra deps defined by the `:bench` alias and the override deps defined by the `:1.9` alias.
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.8.0"}}
   :aliases {:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}}}
             :bench {:extra-deps {criterium {:mvn/version "0.4.4"}}}}}
  ----
  
  === Override a classpath source
  
  * Invoke: `clj -R1.9 -Cdev`
  * Given: A deps.edn file like the one below.
  * Result: Start a repl using the deps, the override deps defined by the `:1.9` alias, and the classpath override for the dev path.
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {org.clojure/clojure {:mvn/version "1.8.0"}}
   :aliases {:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0-beta2"}}}
             :dev {:classpath-overrides {org.clojure/clojure "/Users/me/code/clojure/target/classes"}}}}
  ----
  
  === Show classpath
  
  * Invoke `clj -Spath`
  * Given: A deps.edn like the one below.
  * Result: Computes the classpath and prints it to stdout
  
  [source,clojure]
  ----
  ;; deps.edn
  {:deps {:org.clojure/clojure {:mvn/version "1.8.0"}}}
  ----
  
  Note that `-S` can be combined with other `clj` options as well.
  
  == Connecting to S3 Maven repositories
  
  
negative.code: 
  toc::[]
  
  Clojure 1.9 introduces a new command-line script (`clojure`) and a wrapper script (`clj`) designed for use at the terminal. These scripts use configuration files to construct (and cache) a classpath and then invoke <<repl_and_main#,clojure.main>> which can be used as a REPL, expression evaluator, or program runner. For more background on how classpaths are built, see the <<xref/../../guides/deps_and_cli#,Deps and CLI guide>>.
  
  == Installation
  
  === Installation on Mac via `brew`
  