clojure.tools.tools.api

This api provides functions that can be executed from the Clojure tools using -Ttools.

install

(install {:keys [as], :as args})
Install a tool under a local tool name for later use. On install, the tool is procured, and
persisted with the tool name for later use.

Options:
  lib-name (required) - value is coord map (git coords may omit sha)
  :as (required) - tool name

Example:
  clj -Ttools install io.github.clojure/tools.deps.graph '{:git/tag "v1.0.63"}' :as deps-graph

Also see:
  clj -X:deps find-versions :lib <lib>

install-latest

(install-latest args)
Install the latest version of a tool under a local tool name for later use.
On install, the tool is procured, and persisted with the tool name for later use.

If :tool is provided, the latest version of that existing tool is updated.
If :lib and :as are provided, the latest version of that lib will be installed
with that tool name, replacing any existing tool by that name.
If no args are provided, install the newest version of all tools.
Optionally :coord may be provided for information not inferrable from the
lib name, such as a custom git url.

The latest version is determined by listing the versions in semver order,
filtering out versions with special strings, and choosing the last one.
Special strings that cause a version to be ignored are:
    alpha a beta b miletone m rc cr snapshot
Note that for git deps, the newest tagged version will be installed.

It is recommended that Maven tool releases use Maven release version
conventions, and that git tool releases use tags in the format "vA.B.C".

Options:
  :tool tool-name - currently installed tool
  :lib lib-name - mvn lib or git lib with inferrable url
  :coord - coord map if needed (note: git coords may omit sha)
  :as - tool name

Example:
  clj -Ttools install-latest :lib io.github.clojure/tools.deps.graph :as deps-graph
  clj -Ttools install-latest :tool tools

Also see:
  clj -X:deps find-versions :lib <lib>
  clj -Ttools install <lib> <coord> :as tool-name

list

(list _)
List available tools.

Options:
  none

Example:
  clj -Ttools list

remove

(remove {:keys [tool], :as args})
Remove :tool, if it exists.

Options:
  :tool (required) - tool name to remove

show

(show {:keys [tool], :as args})
Print info and usage for this :tool.

Options:
  :tool (required) - tool name to show

Example:
  clj -Ttools show :tool deps-graph