coviz
coviz is a Rust 2024 command-line tool for visualizing Go and Rust source code
as a call graph. It is inspired by go-callvis, but targets a smaller MVP:
parse local source files, build a simple function/call relationship graph, and
emit machine-readable output that other tools can render or inspect.
MVP scope
- Analyze a file or directory of Go or Rust source code.
- Infer language from file extensions by default, or accept an explicit language.
- Emit Graphviz DOT for visualization.
- Emit JSON for downstream tooling.
- Keep output focused on source-level call relationships, not full compiler semantic resolution.
Install
From this repository:
From crates.io, after the package is published:
Usage
Analyze the current directory and print DOT to stdout:
Analyze a Go project and write DOT:
Render DOT with Graphviz:
Analyze a Rust crate and write JSON:
Open a quick local browser viewer. The command writes temporary files under
/tmp/coviz-*, starts a localhost server, and opens the default browser:
When Graphviz dot is installed, quick mode renders graph.svg with Graphviz
for a cleaner clustered layout. Without Graphviz, it falls back to the built-in
browser renderer.
Quick mode excludes common test files, Rust #[cfg(test)] code, tests/, and
target/ by default. Use --include-tests when you need those nodes.
Use automatic language detection and stdout:
Language support
- Go:
.gofiles throughtree-sitter-go. - Rust:
.rsfiles throughtree-sitter-rust. - Auto mode: infers supported languages from file extensions.
Mixed-language repositories are part of the MVP target, but language-specific analysis is intentionally lightweight. Treat generated graphs as navigation and inspection aids rather than compiler-accurate call graphs.
Development
Use the stable Rust toolchain.
Run the CLI locally: