tools-deps

jumar 2025-11-11T11:41:13.146109Z

How do you print the dependency tree including all the extra-deps added by a list of aliases? That is, not just clj -X:deps tree but more like clj -X:dev:test:tree (which doesn't seem to work)

jumar 2025-11-11T11:45:39.558469Z

The aliases I'm interested in don't add that much - only reference one other local/root module. SO I tried this, but it fails

$ clj -X:deps tree :extra '"../build/deps.edn"'
Error generating tree: class java.lang.String cannot be cast to class clojure.lang.Associative (java.lang.String is in module java.base of loader 'bootstrap'; clojure.lang.Associative is in unnamed module of loader 'app')

2025-11-11T11:58:14.681169Z

i think you say clj -A:foo:bar -X:deps etc

Alex Miller (Clojure team) 2025-11-11T12:48:46.793419Z

No, that adds the aliases to the call to the deps program, you want it as an arg

👍 1
Alex Miller (Clojure team) 2025-11-11T12:49:04.301839Z

Use the :aliases arg

Alex Miller (Clojure team) 2025-11-11T12:50:44.378589Z

clj -X:deps tree :aliases ‘[:dev :test]’

jumar 2025-11-11T13:19:56.135989Z

Ah, of course! I don't know how I missed it (I actually looked at the docstring) Thanks!

2025-11-11T15:16:18.936969Z

I missed it as well once, and it took me while to google for it. Similar question for ":prep". Not sure we might check to document it better.

2025-11-11T15:18:54.560499Z

I think I tried to ask the cli for help which was not successful:

[carsten@nixos:~]$ clj -X:deps --help
Namespace clojure.tools.deps.cli.api loaded but function not found: --help

[carsten@nixos:~]$ clj -X:deps :help
Problem parsing arguments:  Insufficient input [:help]

[carsten@nixos:~]$ clj -X:deps tree --help
Key is missing value: --help

[carsten@nixos:~]$ clj -X:deps tree :help
Key is missing value: :help

➕ 1
2025-11-11T15:19:51.403209Z

Then I gave up....

seancorfield 2025-11-11T15:37:49.417099Z

@jumar @carsten.behring You may find this blog post helpful https://corfield.org/blog/2025/08/08/deps/

seancorfield 2025-11-11T15:39:19.923269Z

clj -X:deps help/dir and clj -X:deps help/doc :fn tree get you the help / documentation for :deps functions.

1
Alex Miller (Clojure team) 2025-11-11T17:17:58.865169Z

The basis options for all of the :deps functions are the same, and are documented in the https://clojure.github.io/tools.deps.cli/clojure.tools.deps.cli.api-api.html#clojure.tools.deps.cli.api/prep. Help is documented in the https://clojure.org/reference/clojure_cli#fn_help page.

Alex Miller (Clojure team) 2025-11-11T17:17:59.979909Z

I'm happy to add more docs/examples in the places people must naturally look. Some options would be clj -h , man clj, CLI reference page, and API docs. Where would be the best place?