polylith

J 2025-07-31T09:47:14.463689Z

Hi! It's possible to make a tree of the whole deps used by the development project?

jaihindhreddy 2025-07-31T09:52:02.335989Z

I believe the tools.deps.graph tool should work. (https://github.com/clojure/tools.deps.graph)

seancorfield 2025-07-31T15:07:29.963629Z

A tree, like clojure -X:deps (formerly clojure -Stree) you mean?

(!1996)-> clojure -X:deps tree :aliases '[:dev]'
org.clojure/clojure 1.11.2
  . org.clojure/spec.alpha 0.3.218
  . org.clojure/core.specs.alpha 0.2.62
poly-usermanager/user /home/sean/oss/usermanager-example/components/user
  . com.github.seancorfield/next.jdbc 1.3.925
    . org.clojure/java.data 1.2.107
    . camel-snake-kebab/camel-snake-kebab 0.4.3
poly-usermanager/web /home/sean/oss/usermanager-example/bases/web
  . com.stuartsierra/component 1.1.0
    . com.stuartsierra/dependency 1.0.0
  . compojure/compojure 1.7.1
    . org.clojure/tools.macro 0.1.5
    . clout/clout 2.2.1
      . instaparse/instaparse 1.4.8
    . medley/medley 1.4.0
    X ring/ring-core 1.11.0 :superseded
      X org.ring-clojure/ring-websocket-protocols 1.11.0 :parent-omitted
      X ring/ring-codec 1.2.0 :parent-omitted
      X commons-io/commons-io 2.15.0 :parent-omitted
      X org.apache.commons/commons-fileupload2-core 2.0.0-M1 :parent-omitted
      X crypto-random/crypto-random 1.2.1 :parent-omitted
      X crypto-equality/crypto-equality 1.0.1 :parent-omitted
...

💯 2
J 2025-07-31T15:08:45.285969Z

Yes exactly! I use clojure -X:deps tree inside projects but I didn't know the aliases param!

J 2025-07-31T15:08:51.695289Z

Thanks again!

seancorfield 2025-07-31T15:11:44.160379Z

You may find this helpful for the future:

(!1996)-> clojure -X:deps help/doc :fn tree
-------------------------
clojure.tools.deps.cli.api/tree
([opts])
  Print deps tree for the current project's deps.edn built from either the
  a basis, or if provided, the trace file.

  This program accepts the same basis-modifying arguments from the `basis` program.
  Each dep source value can be :standard, a string path, a deps edn map, or nil.
  Sources are merged in the order - :root, :user, :project, :extra.

  By default, :format will :print to the console in a human friendly tree. Use
  :edn mode to print the tree to edn.

  In print mode, deps are printed with prefix of either . (included) or X (excluded).
  A reason code for inclusion/exclusion may be added at the end of the line.

  Basis options:
    :dir     - directory root path, defaults to current directory
    :root    - dep source, default = :standard
    :user    - dep source, default = :standard
    :project - dep source, default = :standard ("./deps.edn")
    :extra   - dep source, default = nil
    :aliases - coll of kw aliases of argmaps to apply to subprocesses

  Input options (if provided, basis options ignored):
    :file      Path to trace.edn file (from clj -Strace) to use in computing the tree

  Output mode:
    :format    :print (default) or :edn

  Print output mode modifiers:
    :indent    Indent spacing (default = 2)
    :hide-libs Set of libs to hide as deps (if not top dep), default = #{org.clojure/clojure}

👍 1