Fork me on GitHub

Hi, is there any plans to allow some sugar (short names / shortcuts) that would allow one to hide the sometimes long, not so sexy, commands behind a short name? Like Leiningen does with “aliases” (!= deps aliases)? So that e.g. clj graph could execute clj -X:graph graph :deps '"mydeps.edn"' :trace true :output '"trace" I know tools deps is not intended to replace Leiningen, but it seem to have fragmented the already small Clojure(script) community and intended or not, my impression is that it’s used as a replacement as is, with no other tool wrapping it. I do not mean to be rude and I’m very grateful for all the hard work that Cognitect and others puts into the tech I benefit from. I’m just a bit concerned in regards to how it looks to outsiders and newcomers and that you now need to remember, wrap in a script or copy paste long commands to get things done. Sure you can still use lein, but enough people seem to have transitioned that it’s pretty much mandatory to know both. PS: If I missed something obvious here, then please enlighten me, nothing would be more welcome.


Sounds like aliases with :exec-fn and :exec-args


I believe it is semi-common to create short bash scripts and/or Makefile kind of things for this, too.

Alex Miller (Clojure team)15:04:10

the best place to file requests is at (and this is not something that has an existing question specifically for it already afaik) - asking there lets this accumulate votes, which we factor into prioritization

Alex Miller (Clojure team)15:04:31

as @U47G49KHQ says, you can get part of the way there by creating an alias with :exec-fn and :exec-args keys and then invoking the alias. for this example, you'd create an alias like:

:trace {:exec-fn graph 
        :exec-args {:deps "mydeps.edn"
                    :trace true
                    :output "trace"}}
and then execute this in combination with the graph tool like:
clj -X:trace:graph

Alex Miller (Clojure team)15:04:48

or you could fold the :graph alias stuff into that same alias to get down to just clj -X:trace

Alex Miller (Clojure team)15:04:10

there is also some additional work coming soon around tool installation

🤤 15

Thanks, I knew this was close to a feature request, but I wanted to see the reaction to it 🙂 For some reason I keep forgetting that exists. If that’s the desired channel, then I will consider writing up something around this. Clojure itself and many of the libraries are very elegant and concise and I have the same hopes for the tooling.


@U1S4F3M4M I am making something like "npm scripts" for babashka: Feel free to give feedback


It's already possibly today to "hide" this behind a function and call it like bb -m tasks/my-clojure-invocation


Also made a short video about it:


@U04V15CAJ Thanks, I think I have had a look at babashka previously, but after a quick read now I see that I should have another look as it might actually fit well in my toolbox. That said, I think my initial question/request should be solved preferably in tools-deps itself to keep things simple. Especially for beginners that will soon enough have to navigate the library landscape in search of pieces that fit together.


Right. It would be useful if deps.edn had something like lein aliases. I wished this existed so I'm implementing it for bb. But I want to support something broader than lein aliases (more something in between npm run and make) and I don't expect deps.edn will support this use case. There is always the startup of the JVM too.


But only having "shortcuts" for specific clojure invocations would already be useful.


I just use my shell history, I never have to type in a full command more than once. I have zsh (presto) with fish shell completion. A lot simpler than any other approach.


Just (Justfile) is also a good companion to deps.edn, it's quite easy to replicate most of lein with it +deps.edn


There are many runners like this that can be used for now