{"id":47310067,"url":"https://github.com/cosmonic-labs/cviz","last_synced_at":"2026-04-23T22:00:53.210Z","repository":{"id":338867573,"uuid":"1150903510","full_name":"cosmonic-labs/cviz","owner":"cosmonic-labs","description":"CLI tool to visualize WebAssembly component composition structure.","archived":false,"fork":false,"pushed_at":"2026-04-17T20:01:35.000Z","size":4749,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T22:10:24.634Z","etag":null,"topics":["cli","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmonic-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-05T20:34:22.000Z","updated_at":"2026-03-31T17:53:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"de0fc36b-0057-4ca1-b85e-1a432e6e2e6b","html_url":"https://github.com/cosmonic-labs/cviz","commit_stats":null,"previous_names":["cosmonic-labs/cviz"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cosmonic-labs/cviz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmonic-labs%2Fcviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmonic-labs%2Fcviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmonic-labs%2Fcviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmonic-labs%2Fcviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmonic-labs","download_url":"https://codeload.github.com/cosmonic-labs/cviz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmonic-labs%2Fcviz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32200159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T20:19:26.138Z","status":"ssl_error","status_checked_at":"2026-04-23T20:19:23.520Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","wasm","webassembly"],"created_at":"2026-03-17T10:33:27.479Z","updated_at":"2026-04-23T22:00:53.165Z","avatar_url":"https://github.com/cosmonic-labs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cviz\n\nA CLI tool to visualize WebAssembly component composition structure.\n\ncviz parses composed WebAssembly components and generates diagrams showing how component instances are wired together. It's particularly useful for understanding middleware chains in WASI HTTP components.\n\nCurious what this tool does? Clone the repo and run the demo! `cargo run --example demo`\n\n## Installation\n\n```bash\n# From source\ncargo install --path .\n\n# Or from git\ncargo install --git https://github.com/cosmonic-labs/cviz\n```\n\n## Usage\n\n```\ncviz [OPTIONS] \u003cFILE\u003e\n\nArguments:\n  \u003cFILE\u003e  Path to the .wasm component file\n\nOptions:\n  -f, --format \u003cFORMAT\u003e        Output format [default: ascii] [values: ascii, mermaid]\n  -d, --direction \u003cDIRECTION\u003e  Diagram direction (mermaid only) [default: lr] [values: lr, td]\n  -l, --detail \u003cDETAIL\u003e        Detail level [default: handler-chain]\n  -o, --output \u003cOUTPUT\u003e        Output file (stdout if not specified)\n  -h, --help                   Print help\n  -V, --version                Print version\n```\n\n## Output Formats\n\n### ASCII (default)\n\nClean terminal-friendly box diagrams:\n\n```bash\ncviz composed.wasm\n```\n\n```\n┌────────────────────────────────────┐\n│          Middleware Chain          │\n├────────────────────────────────────┤\n│srv ── handler ──\u003e mdl-c            │\n│mdl-c ── handler ──\u003e mdl-b          │\n│mdl-b ── handler ──\u003e mdl-a          │\n│mdl-a ──\u003e [Export: handler]         │\n└────────────────────────────────────┘\n```\n\n### Mermaid\n\nGenerate Mermaid diagrams for documentation or visualization tools:\n\n```bash\ncviz composed.wasm -f mermaid\n```\n\n```mermaid\ngraph LR\n    subgraph composition[\"Middleware Chain\"]\n        srv[\"srv\"]\n        mdl_c[\"mdl-c\"]\n        mdl_b[\"mdl-b\"]\n        mdl_a[\"mdl-a\"]\n    end\n\n    srv --\u003e|\"handler\"| mdl_c\n    mdl_c --\u003e|\"handler\"| mdl_b\n    mdl_b --\u003e|\"handler\"| mdl_a\n    mdl_a --\u003e export([\"Export: handler\"])\n```\n\n## Detail Levels\n\n### `handler-chain` (default)\n\nShows only the HTTP handler middleware chain - the path from the entry point through all middleware to the final handler export.\n\n```bash\ncviz composed.wasm -l handler-chain\n```\n\n### `all-interfaces`\n\nShows all interface connections between components, including host imports (WASI interfaces like filesystem, environment, etc.):\n\n```bash\ncviz composed.wasm -l all-interfaces\n```\n\n```\n┌───────────────────┐\n│   Host Imports    │\n├───────────────────┤\n│  {environment}    │\n│  {exit}           │\n│  {stderr}         │\n│  {stdin}          │\n│  {stdout}         │\n│  {streams}        │\n│  ...              │\n└───────────────────┘\n\n┌─────────────────────────┐\n│   Component Instances   │\n├─────────────────────────┤\n│  [mdl-a]                │\n│  [mdl-b]                │\n│  [mdl-c]                │\n│  [srv]                  │\n└─────────────────────────┘\n\n┌───────────────────────────────────────────┐\n│                Connections                │\n├───────────────────────────────────────────┤\n│  [srv] ── handler ──\u003e [mdl-c]             │\n│  [mdl-c] ── handler ──\u003e [mdl-b]           │\n│  [mdl-b] ── handler ──\u003e [mdl-a]           │\n│  {environment} --- environment --- [srv]  │\n│  ...                                      │\n└───────────────────────────────────────────┘\n```\n\n### `full`\n\nShows all instances (including synthetic ones) with full interface names and component indices:\n\n```bash\ncviz composed.wasm -l full\n```\n\n## How It Works\n\ncviz uses [wasmparser](https://crates.io/crates/wasmparser) to parse the WebAssembly component model structure. It extracts:\n\n1. **Component instances** - The instantiated components within the composition\n2. **Interface connections** - How instances are wired together via their imports/exports\n3. **Export chain** - What the composed component exports to the outside world\n\nFor WASI HTTP middleware compositions, it specifically traces the `wasi:http/handler` interface chain to show the request flow through middleware layers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmonic-labs%2Fcviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmonic-labs%2Fcviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmonic-labs%2Fcviz/lists"}