Skip to content

Interactive web-based visualization of a Go package's dependency graph

License

Notifications You must be signed in to change notification settings

grishy/gopkgview

Repository files navigation

gopkgview - Go dependency visualization


Status: Maintained

GitHub tag Go Report Card Build Status

gopkgview is an interactive tool designed to visualize and analyze Go project dependencies. It provides a rich, web-based interface for better understanding of how your project connects its components and external libraries.

Implemented with ELK's layout algorithms to arrange the graphs and React Flow to make the visualization interactive and user-friendly.

Example of visualization of lazydocker:

gopkgview-lazydocker.mp4

Features

  • Interactive web-based visualization of Go dependencies
  • Toggle dependencies by type
  • Focus on specific dependencies for analysis

Installation - 3 options

Install via go install

go install github.com/grishy/gopkgview@latest

Download the Release

From the latest release from the Releases Page.

Run with Docker

docker run -p 8080:8080 -v $(pwd):/app ghcr.io/grishy/gopkgview:latest

Usage

Navigate to your Go project directory and run:

cd my-go-project
gopkgview

This will start a web server with the dependency visualization available in your browser.

Available Flags

--root value            From which directory find go.mod (default: ./) [$GO_PKGVIEW_ROOT]
--gomod value           Path to go.mod [$GO_PKGVIEW_GOMOD]
--addr value            Address to listen on (default: :0) [$GO_PKGVIEW_ADDR]
--max-goroutines value  Maximum number of goroutines to use for parsing in parallel (default: 20) [$GO_PKGVIEW_MAX_GOROUTINES]
--help, -h              show help
--version, -v           print the version

Alternatives

  • go-callvis - Great tool for visualizing of call, but panic on Go >= 1.21
  • godepgraph - Same idea, but output is static image
  • depgraph - Inspire me to create this tool
  • gomod

License

© 2024 Sergei G.
This project is GPL-3.0 license licensed.