Need help with cljstyle?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

142 Stars 21 Forks Eclipse Public License 1.0 564 Commits 19 Opened issues


A tool for formatting Clojure code

Services available


Need anything else?

Contributors list


CircleCI codecov

is a tool for formatting Clojure code. It can take something messy like this:
(  ns  "some doc"
    (:require ( [abc :as abc]
      ;; Need this for the thing

(defn hello "says hi" ( [] (hello "world") ) ([name] ( println "Hello," name ) ))

...and restyle it into nicely-formatted code like this:

  "some doc"
    [ :as abc]
    [ :refer :all])
      ;; Need this for the thing

(defn hello "says hi" ([] (hello "world")) ([name] (println "Hello," name)))

Note that this is a rewrite of the original weavejester/cljfmt tool to provide more capabilities and configurability as well as a native-compiled binary.


Binary releases are available on the GitHub project. The native binaries are self-contained, so to install them simply place them on your path.

Releases are also published to Clojars. To use the latest version, add the following dependency to your project:

Clojars Project

macOS via Homebrew

can be installed on macOS via a Homebrew Cask:
brew cask install cljstyle



tool supports several different commands for checking source files.

Check and Fix

To check the formatting of your source files, use:

cljstyle check

If the formatting of any source file is incorrect, a diff will be supplied showing the problem, and what cljstyle thinks it should be.

If you want to check only a specific file, or several specific files, you can do that, too:

cljstyle check src/foo/core.clj

Once you've identified formatting issues, you can choose to ignore them, fix them manually, or let cljstyle fix them with:

cljstyle fix

As with the

task, you can choose to fix a specific file:
cljstyle fix src/foo/core.clj


command offers a generic way to correct style by reading Clojure code from stdin and writing the reformatted code to stdout:
cljstyle pipe < in.clj > out.clj

This command resolves configuration from the directory it is executed in, since there is no explicit file path to use.


For inspecting what cljstyle is doing, one tool is to specify the

flag, which will cause additional debugging output to be printed. There are also a few extra commands which can help understand what's happening.


command will print what files would be checked by cljstyle. It will print each file path to standard output on a new line:
cljstyle find [path...]


command will show what configuration settings cljstyle would use to process the specified files or files in the current directory:
cljstyle config [path]


will show what version of the tool you're using:
cljstyle version


can be integrated into many different tools, including shells, editors, and tests. See the integration docs for more details.



tool comes with a sensible set of default configuration built-in and may additionally be configured by using a hierarchy of
files in the source tree. The configuration settings include toggles for format rules, width constraints, and the indentation rules.

Ignoring Forms

By default, cljstyle will ignore forms which are wrapped in a

(comment ...)
form or preceeded by the discard macro
. You can also optionally disable formatting rules from matching a form by tagging it with
metadata - this is often useful for macros.


Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.