CLI tool for Go backend codebase intelligence β analyze microservices, generate dependency graphs, detect tech stack, and produce an interactive HTML report.
Built in pure Go with zero external dependencies.
cd goscope
go run ./cmd/goscope ~/backend --openWhere ~/backend is the parent folder where all your backend service repositories are cloned:
~/backend/
βββ api-gateway/ β cloned repo (.git inside)
βββ user-service/ β cloned repo
βββ payment-service/ β cloned repo
βββ proto/ β shared proto definitions
βββ auth-service/ β cloned repo
βββ docker-compose.yml
Services are auto-detected up to 3 levels deep, so layouts like src/<service>/ or services/<service>/ also work. Non-Go services (Python, Java, PHP, etc.) are detected and shown in the report with language badges.
-
π Summary β microservice count, Go files, lines of code, declarations by type (structs, interfaces, enums, functions), proto files, gRPC services. Non-Go services detected in the repo tree get line count cards per language (Python, Java, etc.)
-
π₯ Team Contribution Map β developer activity with files modified, commit counts, first/last change dates, and top-3 microservices per author. Git history is collected from each cloned repo's
.gitindependently -
π Tech Stack β three subsections:
- Technologies β auto-detected from Go imports (
pgxβ PostgreSQL,saramaβ Kafka, etc.),go.moddependencies,docker-compose.ymlimages/ports, andMakefilehints. Non-Go languages shown with orange badges - Microservices β clickable grid of all detected microservices, including non-Go services with language badges
- Architecture β interactive force-directed graph showing how microservices connect to technologies
- Technologies β auto-detected from Go imports (
-
π Microservices Penetration β which microservice is imported by the most other microservices, plus TODO/FIXME density per microservice
-
π₯ Hot Zones β top 10 most interconnected files by PageRank dependency score, with clickable microservice badges
-
π Longest Functions β ranked list of functions by line count, with clickable microservice badges
-
π§ Microservices β detailed breakdown of each microservice (starting with API Gateway, then Proto, then by size):
- Complete file inventory sorted by lines of code
- Declaration statistics (structs, interfaces, enums, funcs, gRPC services/RPCs)
- Interactive force-directed dependency graph per microservice (includes big functions β₯50 lines)
cd goscope
# Build
go build -o goscope ./cmd/goscope
# Analyze a Go backend (point to the parent folder with all repos)
./goscope ~/backend
# See help
./goscope --helpgo run ./cmd/goscope ~/backend --opengo build -o goscope ./cmd/goscope
./goscope ~/backend --opengo build -o goscope ./cmd/goscope
sudo mv goscope /usr/local/bin/
goscope ~/backend --openCreate .goscope.json in your project root (or run goscope init):
{
"excludePaths": [".git", "node_modules", "vendor", "dist", "build", ".idea"],
"maxFilesAnalyze": 50000,
"gitCommitLimit": 1000,
"enableCache": false,
"enableParallel": true,
"hotspotCount": 15,
"fileExtensions": ["go", "proto"]
}goscope/
βββ go.mod
βββ cmd/goscope/
β βββ main.go # CLI entry point
βββ internal/
β βββ config/
β β βββ config.go # Config models + loader
β βββ scanner/
β β βββ scanner.go # Directory walker, microservice detection, tech scanning
β βββ parser/
β β βββ models.go # ParsedFile, Declaration, GitMetadata
β β βββ parser.go # Go + Proto parsers
β βββ git/
β β βββ analyzer.go # Multi-repo batch git log analysis
β βββ graph/
β β βββ graph.go # Dependency graph + PageRank
β β βββ util.go # File helpers
β βββ report/
β βββ report.go # HTML report generator
βββ README.md
- Go 1.22+ (uses standard library only β no external dependencies)
- git (for repository history analysis)
