A tool for making deps.edn dependency graphs.
tools.deps.graph uses Graphviz to generate images. You can find a list of platform-specific installations at https://graphviz.gitlab.io/download/.
Add tools.deps.graph as an alias in your ~/.clojure/deps.edn so it's available in any project:
{...
:aliases
{:graph {:replace-deps {org.clojure/tools.deps.graph {:mvn/version "1.1.68"}}
:main-opts ["-m" "clojure.tools.deps.graph"] ;; deprecated
:ns-default clojure.tools.deps.graph}}}
tools.deps.graph supports both older clojure.main invocation (deprecated) and newer exec function invocation (clj -X).
To run with exec in your current project:
clj -X:graph graph <options>
Older clojure.main invocation in your current project (use -M for clj 1.10.1.697+, -A for older):
clj -M:graph <options>
If no options are provided, tools.deps.graph will create a dependency graph for the current project and display it. Ctrl-C to quit.
When using -X, options:
:deps
- Path to deps file (default = "deps.edn"):trace
- Boolean flag to use trace mode (default = false):trace-file
- Path to trace.edn file to read:output
- Output file path:trace-omit
- Collection of lib symbols to omit in trace output:size
- Boolean flag to include sizes in images (default = false)Equivalent clojure.main options:
Show dependency graph for current project:
clj -X:graph graph
Save dependency graph to deps.png for current project:
clj -X:graph graph :output '"deps.png"'
Show dependency graph for current project with jar sizes:
clj -X:graph graph :output '"deps.png"' :size true
Read mydeps.edn, create deps graph, output image to mydeps.png:
clj -X:graph graph :deps '"mydeps.edn"' :output '"mydeps.png"'
Read deps.edn, trace expansion, output steps as trace100.png, trace101.png, ... :
clj -X:graph graph :trace true :output '"trace"'
Read mydeps.edn, trace expansion, output trace100.png, ... :
clj -X:graph graph :deps '"mydeps.edn"' :trace true :output '"trace"'
Use -Strace to output a trace.edn file. Read trace.edn file, output trace100.png, ...
clj -Strace
clj -X:graph graph :trace-file '"trace.edn"' :output '"trace"'
This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository.
Latest release: 1.1.68
deps.edn dependency information:
org.clojure/tools.deps.graph {:mvn/version "1.1.68"}
Copyright © 2019-2022 Rich Hickey, Alex Miller, and contributors
All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close