tools-deps

2025-07-17T18:14:00.655669Z

I have installed a tool (https://github.com/seancorfield/deps-new) as new and I want to check the help docs. I try writing clojure -Tnew help, and it says Namespace org.corfield.new loaded but function not found: help. I remember that it's gotta be help/doc, so I write clojure -Tnew help/doc and it says Namespace could not be found on classpath: help which is even less help. I go back to the deps-new readme and it says clojure -A:deps -Tnew help/doc . I try that, and it correctly prints. This feels confusing and goes against what I'd expect from having used -Tbuild to write build.clj files. Are there any tickets for working on this?

2025-07-17T18:29:59.792709Z

compare with clojure -Tnew app which uses the deps-new library to run the app function without namespace or deps declaration

seancorfield 2025-07-17T18:52:01.831599Z

The README says: You can get help on the available functions like this:

clojure -A:deps -Tnew help/doc
Note -Tnew there.

2025-07-17T18:52:41.239609Z

my apologies, that's my fault for incorrectly writing it. i intended to write it correctly

2025-07-17T18:52:57.904319Z

the confusion stems from the addition of -A:deps

seancorfield 2025-07-17T18:53:08.024849Z

That matches how you do it with build.clj (from next-jdbc's build.clj ns docstring):

For more information, run:

  clojure -A:deps -T:build help/doc

seancorfield 2025-07-17T18:53:51.659899Z

help/doc is part of tools.deps essentially so you need the :deps alias for it.

2025-07-17T18:54:12.175239Z

Where does the alias come from?

seancorfield 2025-07-17T18:54:21.032769Z

The root deps.edn stuff.

seancorfield 2025-07-17T18:54:30.663119Z

As in clojure -X:deps ...

seancorfield 2025-07-17T18:55:01.286119Z

:aliases {
    :deps {:replace-paths []
           :replace-deps {org.clojure/tools.deps.cli {:mvn/version "0.11.78"}}
           :ns-default clojure.tools.deps.cli.api
           :ns-aliases {help }}
    :test {:extra-paths ["test"]}
  }

seancorfield 2025-07-17T18:55:36.287199Z

Note that it replaces paths and deps, so you can use it with tooling but not for nses within your local project.

2025-07-17T18:55:58.745529Z

right, that's very inside baseball

2025-07-17T18:58:09.767459Z

oh fantastic, thanks. i searched but didn't see that one

seancorfield 2025-07-17T18:59:01.807439Z

And my user deps.edn alias to allow this to work within projects: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L7-L12

seancorfield 2025-07-17T19:00:55.296679Z

Official docs on help/* functions https://clojure.org/reference/clojure_cli#fn_help

seancorfield 2025-07-17T19:01:42.519099Z

Example for listing the set of functions in the :ns-default for the built in tools tool:

clojure -A:deps -Ttools help/dir
(from the official docs)

2025-07-17T19:02:11.083209Z

right. it's just a design that feels like it doesn't actually help the user

seancorfield 2025-07-17T19:02:26.682809Z

Hence Ask 11214 🙂

👍 1
2025-07-17T19:02:52.918529Z

my next step was going to be writing up an Ask if none existed, so i'm glad i can upvote

👍🏻 1
seancorfield 2025-07-17T19:04:26.092759Z

It's simple and consistent and composable. It's just not easy. 🤣

😅 1
seancorfield 2025-07-17T19:05:07.886489Z

(it helps that I was a very early adopter of the CLI / deps.edn way back in 2018)

2025-07-17T19:05:57.493509Z

yeah, i'm trying to word my feelings in a way that's not shaming or like "this sucks", just trying to express my confusion as someone who is already quite well-versed in the ecosystem

seancorfield 2025-07-17T19:19:28.701709Z

It's why I put the help line in the deps-new readme and in all my build.clj files. We even used to have it in our build.clj at work for quite a while. I mean, "it's all in the docs" but I think it's a) a bit hard to find and b) not trivial to connect-the-dots to general tool/build usage... 😐 And why I raised those two Asks. It would be nice to make this (`help/dir`, help/doc, etc) much more widespread in terms of practice and knowledge.

👍 1
Alex Miller (Clojure team) 2025-07-17T20:35:51.589779Z

oh, I think it sucks, no bad feelings :)

🤣 3
Alex Miller (Clojure team) 2025-07-17T20:37:05.008019Z

I have a bunch of ideas on this but it ties into other things. some day I hope to have some time to reengage on this stuff