go-archer

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2025 License: MIT

README

Go Archer

go-archer is a tool to inspect and analyze dependencies between packages in a project. It produces a graph of dependencies between packages in the project and selected third-party packages, it highlights dependencies that lead towards concrete packages, it estimates distance of the packages from the main sequence.

To install the binary:

go install gitlab.com/shaydo/go-archer/cmd/go-archer@latest

The command tries to load configuration from ~/.go-archer.toml by default. Configuration file might include some concrete packages that you want to track dependencies on and some exclusions:

concrete_packages = [
    "database/sql",
    "net/http",
]

ignore_packages = [
    "net/http/pprof",
]

To create dependency graph in PDF format run:

go-archer | dot -Tpdf -o deps.pdf

MCP Server

You can run go-archer as an MCP server. Here's an example of configuration:

{
  "mcpServers": {
    "go-archer": {
      "command": "go-archer",
      "args": ["mcp-server"],
      "env": {
        "HOME": "/home/me"
        "GOPATH": "/home/me/go"
      }
    }
  }
}

Note, that HOME and GOPATH enviroment variables are required for go-archer to be able to find the config file and go module cache.

Directories

Path Synopsis
cmd
experiment
Command experiment is for exploring functionality of golang.org/x/tools/go/packages
Command experiment is for exploring functionality of golang.org/x/tools/go/packages
go-archer
Command go-archer produces graph of dependencies between packages in Go project
Command go-archer produces graph of dependencies between packages in Go project
internal
archer
Package archer provides functionality to enrich package dependency graph with architectural metrics.
Package archer provides functionality to enrich package dependency graph with architectural metrics.
depcrawler
Package depcrawler implements functionality to traverse specified packages and collect information about their exported symbols and dependencies.
Package depcrawler implements functionality to traverse specified packages and collect information about their exported symbols and dependencies.
depgraph
Package depgraph produces graph of dependencies between packages in a Go project
Package depgraph produces graph of dependencies between packages in a Go project
dot
Package dot implements functionality needed to produce representation of dependency graph in DOT language
Package dot implements functionality needed to produce representation of dependency graph in DOT language
mcpdepgraph
Package mcpdepgraph implements an MCP tool that produces the graph of dependencies between packages for a given module.
Package mcpdepgraph implements an MCP tool that produces the graph of dependencies between packages for a given module.
mcpserver
Package mcpserver implements a Model Context Protocol server
Package mcpserver implements a Model Context Protocol server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL