Proto dependency visualizer for gRPC/Connect projects with a Neon-style interactive Web UI.
- Interactive Visualization: React Flow-based graph with zoom, pan, and explore
- Neon Aesthetics: Dark mode with glow effects and animated data flow
- Package Grouping: Organize nodes by package with expand/collapse functionality
- Auto Layout: Automatic graph layout using Dagre algorithm
- Proto Diff: Compare two proto snapshots and detect added/modified/removed definitions
- Markdown Reports: Generate detailed Markdown output for PR comments
- Pipeline-Friendly:
buf build -o - | coral serveworkflow - GitHub Action: Automate proto analysis in your CI/CD pipeline
- GitHub Pages: Deploy interactive documentation for your proto files
# Build from source
git clone https://github.com/daisuke8000/coral.git
cd coral
cargo build --release
# Visualize proto dependencies
cd your-proto-project
buf build -o - | /path/to/coral serve
# Output as JSON
buf build -o - | coral --output json > graph.json
# Output as Markdown report
buf build -o - | coral --output markdown
# Compare two proto snapshots (diff)
coral diff base.json head.jsonAdd Coral to your workflow to automatically analyze proto dependencies on every PR:
# .github/workflows/proto-analysis.yml
name: Proto Analysis
on:
pull_request:
paths:
- 'proto/**'
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Analyze Proto Dependencies
uses: daisuke8000/coral@v0.2.2
with:
proto-path: 'proto'
comment-on-pr: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}Note: When using
comment-on-pr: 'true'on public repositories, proto schema structure (message names, field names, service definitions) will be visible in PR comments. Consider this if your proto files contain internal API specifications.
| Input | Description | Default |
|---|---|---|
proto-path |
Path to proto files directory (must be within the workspace) | proto |
buf-config |
Path to buf.yaml configuration file (relative to proto-path) | '' |
comment-on-pr |
Post analysis and diff as PR comment | false |
github-token |
GitHub token for PR comments (requires pull-requests: write) |
'' (falls back to github.token) |
generate-pages |
Generate static HTML for GitHub Pages | false |
version |
Coral version to download (e.g. v0.2.2, defaults to the action ref tag) |
'' |
| Output | Description |
|---|---|
json-path |
Path to the generated JSON file |
html-path |
Path to the generated HTML directory (if generate-pages is true) |
markdown-report |
Detailed markdown report of proto dependencies |
diff-report |
Diff report showing changes from base branch |
Deploy an interactive visualization of your proto dependencies:
# .github/workflows/pages.yml
name: Deploy Proto Docs
on:
push:
branches: [main]
paths:
- 'proto/**'
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Pages
uses: daisuke8000/coral@v0.2.2
with:
proto-path: 'proto'
generate-pages: 'true'
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v4
with:
path: 'coral-output/html'
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v4
id: deployment| Type | Condition | Color |
|---|---|---|
| Service | Contains service definitions |
Magenta #ff00ff |
| Message | message definitions |
Cyan #00ffff |
| Enum | enum definitions |
Yellow #ffcc00 |
| External | Paths starting with google/ or buf/ |
Gray #666666 |
# Build
cargo build --release
# Test
cargo test
# Run with sample protos
cd sandbox && buf build -o - | ../target/release/coral --output summarycd ui
npm install
npm run dev # Development server
npm run build # Production build
npm run build:static # Static build for GitHub Pagescoral/
βββ src/
β βββ main.rs # CLI entry point
β βββ lib.rs # Public API
β βββ error.rs # Error types (thiserror)
β βββ decoder.rs # Protobuf decoding
β βββ analyzer/ # FileDescriptorSet β GraphModel
β β βββ mod.rs # Module exports
β β βββ core.rs # Analyzer struct + orchestration
β β βββ node_builder.rs # Node creation (Service, Message, Enum)
β β βββ edge_builder.rs # Edge creation + deduplication
β β βββ util.rs # Type resolution helpers
β β βββ tests.rs # Analyzer tests
β βββ diff/ # Proto snapshot comparison
β β βββ mod.rs # Module exports
β β βββ core.rs # Diff types + compute logic
β β βββ markdown.rs # Markdown rendering
β β βββ tests.rs # Diff tests
β βββ reporter.rs # Markdown report generation
β βββ server.rs # Axum web server
β βββ domain/ # Domain models (Node, Edge, GraphModel)
βββ ui/ # React + Vite frontend
βββ action.yml # GitHub Action definition
flowchart LR
subgraph Input["π Input"]
Proto[".proto files"]
Buf["buf build -o -"]
end
subgraph Backend["π¦ Rust Backend"]
Decoder["decoder.rs<br/>(prost_types)"]
Analyzer["analyzer/<br/>core.rs"]
Server["server.rs<br/>(Axum)"]
Diff["diff/<br/>core.rs"]
Reporter["reporter.rs"]
end
subgraph Output["π€ Output"]
API["/api/graph"]
JSON["graph.json"]
MD["markdown report"]
DiffOut["diff report"]
end
subgraph Frontend["βοΈ React Frontend"]
Fetch["useGraphData"]
Flow["React Flow"]
UI["Interactive UI"]
end
Proto --> Buf
Buf -->|FileDescriptorSet| Decoder
Decoder --> Analyzer
Analyzer -->|GraphModel| Server
Analyzer -->|--output json| JSON
Analyzer -->|--output markdown| Reporter
Reporter --> MD
JSON -->|"coral diff base.json head.json"| Diff
Diff --> DiffOut
Server --> API
API -->|fetch| Fetch
JSON -.->|static mode| Fetch
Fetch --> Flow
Flow --> UI
MIT