Back to Blog

Clojure for Beginners: Clojure Aliases and deps.edn Workflows — :dev, :test, :run, and Stacking

Celest KimCelest Kim

Video: Clojure Aliases and deps.edn Workflows — :dev, :test, :run, and Stacking | Episode 24 by CelesteAI

Watch full page →

Clojure Aliases and deps.edn Workflows — :dev, :test, :run, and Stacking

One `deps.edn`, many workflows. In this episode we wire up four aliases — `:run`, `:dev`, `:test`, and `:json` — and drive the same project four different ways from the command line: run it, test it, REPL against it, or spin up a REPL with an extra library. Then we stack aliases — `clj -A:dev:json` — and get both classpaths in one session.

Code

(ns app.core
  (:require [clojure.string :as str]))

(defn greet
  "Capitalize name and wrap it in a friendly hello."
  [name]
  (str "Hello, " (str/capitalize name) "!"))

(defn -main
  "Run with: clj -M:run  (or)  clj -M:run alice"
  [& args]
  (println (greet (or (first args) "friend"))))

Key Points

Watch the video above for a full walkthrough — every keystroke is shown so you can code along.

Student code: GitHub