Leiningen Plugin

pretty can act as a plugin to Leiningen.

To enable pretty exception reporting automatically, add pretty to both the :plugins and the :dependencies lists of your project.clj.

(defproject ...
 :plugins [[io.aviso/pretty "1.3"]]
 :middleware [io.aviso.lein-pretty/inject]
 :dependencies [...
                [io.aviso/pretty "1.3"]]

Adjust the version number for the current version, “1.4.4”.


Often, you only add io.aviso/pretty to your :dev profile dependencies.

This adds middleware to enable pretty exception reporting when running a REPL, tests, or anything else that starts code in the project.

Another option is to add the following to your ~/.lein/profiles.clj:

:pretty {
  :plugins [[io.aviso/pretty "1.3"]]
  :dependencies [[io.aviso/pretty "1.3"]]
  :middleware [io.aviso.lein-pretty/inject]

This creates an opt-in profile that adds and enables pretty exception reporting.

You can then enable pretty in any project, even one that does not normally have pretty as a dependency, as follows:

lein with-profiles +pretty run


lein with-profiles +pretty do clean, test, install

You may also want to add the following to your ~/.bash_profile:

alias pretty="lein with-profile +pretty"

At which point, you can use the command pretty instead of lein.