ctxo visualize β
Produces a self-contained HTML file showing the project's symbol graph, with PageRank-weighted node sizing, dead code highlighting, architectural layer coloring, cyclomatic complexity, and per-file git intent. The file opens in your default browser by default.
Synopsis β
shell
npx ctxo visualize [options]Flags β
| Flag | Default | Description |
|---|---|---|
--max-nodes <N> | all | Keep only the top N symbols by PageRank. Useful for very large graphs |
--output <path> | .ctxo/visualize.html | Where to write the HTML file |
--no-browser | false | Do not open the result in a browser |
What is in the output β
| Dimension | Source |
|---|---|
| Node size | PageRank score (core/importance/pagerank-calculator.ts) |
| Node color | Architectural layer (core/overlay/architectural-overlay.ts) |
| Dead-code badge | find_dead_code detector |
| Cyclomatic complexity | Per-symbol complexity stored in the index |
| Anti-pattern flag | Files with revert or churn anti-patterns |
| Edges | imports, calls, extends, implements, uses |
Each file's commit intent and anti-pattern history are embedded for on-hover inspection.
Examples β
shell
npx ctxo visualizeshell
# Keep only the 200 most central symbols.
npx ctxo visualize --max-nodes 200shell
npx ctxo visualize --output ./reports/graph.html --no-browsershell
# Generate the HTML in a CI job; upload it as an artifact.
npx ctxo visualize --output artifacts/ctxo-graph.html --no-browserExit codes β
| Code | Meaning |
|---|---|
0 | HTML written |
1 | No index found (run ctxo index first), or --max-nodes is not a positive integer |
See also β
ctxo indexβ must run beforevisualizehas data.ctxo statusβ verify the index before visualizing.