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?
compare with clojure -Tnew app which uses the deps-new library to run the app function without namespace or deps declaration
The README says: You can get help on the available functions like this:
clojure -A:deps -Tnew help/doc
Note -Tnew there.my apologies, that's my fault for incorrectly writing it. i intended to write it correctly
the confusion stems from the addition of -A:deps
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/dochelp/doc is part of tools.deps essentially so you need the :deps alias for it.
Where does the alias come from?
The root deps.edn stuff.
As in clojure -X:deps ...
: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"]}
} Note that it replaces paths and deps, so you can use it with tooling but not for nses within your local project.
right, that's very inside baseball
See https://ask.clojure.org/index.php/11214/make-tools-help-more-discoverable
and https://ask.clojure.org/index.php/10888/help-doc-doesnt-work-with-project-dependencies
oh fantastic, thanks. i searched but didn't see that one
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
Official docs on help/* functions https://clojure.org/reference/clojure_cli#fn_help
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)right. it's just a design that feels like it doesn't actually help the user
Hence Ask 11214 🙂
my next step was going to be writing up an Ask if none existed, so i'm glad i can upvote
It's simple and consistent and composable. It's just not easy. 🤣
(it helps that I was a very early adopter of the CLI / deps.edn way back in 2018)
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
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.
oh, I think it sucks, no bad feelings :)
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