poly
Search
K

Install as Clojure CLI Tool

If we are using a recent version of the Clojure CLI -- 1.10.3.933 or later -- we can install poly as a "tool":
clojure -Ttools install io.github.polyfy/polylith '{:git/tag "v0.2.17-alpha" :deps/root "projects/poly"}' :as poly
An alternative is to give a sha, which allows us to use versions that hasn't been released yet, e.g.:
clojure -Ttools install io.github.polyfy/polylith '{:git/sha "5f74c8b8675dbb091258165d327af3958716a247" :deps/root "projects/poly"}' :as poly
Note: do not use the install-latest option to clojure -Ttools as it does not support :deps/root.
Then we can invoke the poly tool using the CLI directly:
clojure -Tpoly info loc true
Or start a poly shell, which uses the standard Polylith way of passing in arguments to commands:
clojure -Tpoly shell
Installed versions can be listed with:
clojure -Ttools list
...or the shorter (clojure can often be replaced with clj):
clj -Ttools list
We can get basic built-in help via the CLI's help machinery:
clojure -A:deps -Tpoly help/doc
Note: the command-line argument syntax for "tool" usage follows the CLI "exec args" format which is essentially Clojure's own keyword/value syntax (it's actually read as EDN).
How to use the poly command as a tool is described in the Clojure CLI Tool section. The official documentation can be found here.