Clojure CLI "clojure: command not found" in CI
The clojure and clj launchers come from the Clojure CLI (tools.deps) install, which is separate from Leiningen and from the JDK. If the runner never installed it, any clojure -M or clj command fails immediately.
What this error means
A step running clojure -M:test or clj -X:build fails with "clojure: command not found" and exit code 127.
clj
/home/runner/work/_temp/script.sh: line 1: clojure: command not found
Error: Process completed with exit code 127.Common causes
The Clojure CLI is not installed
The runner has a JDK but no tools.deps launcher, and no setup step provisions it.
A confusion between lein and the CLI
The project uses deps.edn and expects clojure/clj, but the workflow only installed Leiningen (or the reverse).
How to fix it
Install the Clojure CLI with a setup action
Provision the CLI (and a JDK) so clojure and clj are on PATH.
.github/workflows/ci.yml
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- uses: DeLaGuardo/setup-clojure@13.0
with:
cli: latestInstall the CLI with the official script
Run the linux installer, then confirm the launcher works.
Terminal
curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh
chmod +x linux-install.sh && sudo ./linux-install.sh
clojure --versionHow to prevent it
- Install the tool your project actually uses (CLI for deps.edn, lein for project.clj).
- Pin the setup action and CLI version.
- Verify with
clojure --versionbefore the build steps.
Related guides
Leiningen "lein: command not found" on the runner in CIFix "lein: command not found" in CI - Leiningen is not installed on the runner or not on PATH, so no lein tas…
Clojure JDK version mismatch (setup-java) in CIFix Clojure builds failing on a JDK version mismatch in CI - the runner JDK is older or newer than the projec…
clj "Error building classpath. Could not find artifact" in CIFix tools.deps "Error building classpath. Could not find artifact X" in CI - a coordinate in deps.edn cannot…