tools-deps

jumar 2025-10-10T06:19:25.113169Z

Is it possible to invoke clojure / clj outside of a specific project directory but passed it as a command line argument instead? I would like to do this:

/opt/homebrew/bin/clj --project-dir /my/clojure/project

borkdude 2025-10-12T14:43:57.610239Z

$ rlwrap bb
Babashka v1.12.210-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[babashka.tasks :as tasks])
nil
user=> (tasks/clojure {:dir "/tmp"} "-M" "-e" "(System/getProperty \"user.dir\")")
"/private/tmp"

borkdude 2025-10-12T14:44:29.044699Z

similar with babashka.process/shell + {:dir ..} + "clj" or "clojure"

Alex Miller (Clojure team) 2025-10-10T07:42:28.024329Z

Not currently

seancorfield 2025-10-11T00:55:50.002189Z

clj -Sdeps '{:aliases {:project {:deps {my/project {:local/root "/my/clojure/project"}}}}}' -A:project perhaps?