Generate the Chef cookbook dependency diagram

The Brew viz command reads the Berksfile.lock in the current Chef cookbook directory and saves the cookbook dependency diagram in the graph.png file.

The command requires the graphviz utility

Install graphviz

In the terminal window execute

brew install graphviz

Generate the cookbook dependency diagram and open it in Preview

In the Chef cookbook directory execute

berks viz;open graph.png

If you get the error message

The lockfile is out of sync! Run `berks install` to sync the lockfile.

First try

berks install

If the error persists, execute

berks update

Leave a comment

Your email address will not be published. Required fields are marked *