Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Visualization & Export

Commands for generating DOT graphs, PR writeups, and exporting your decision graph for GitHub Pages.


deciduous dot

Export the graph as DOT format for Graphviz visualization.

FlagShortDescription
--output <file>-oOutput file (default: stdout)
--roots <ids>-rRoot node IDs (comma-separated, traverses children)
--nodes <spec>-nNode IDs or ranges (e.g., 1-11 or 1,3,5-10)
--pngGenerate PNG using graphviz (requires dot command)
--autoAuto-generate branch-specific filename in docs/
--title <text>-tGraph title
--rankdir <dir>Graph direction: TB (top-bottom) or LR (left-right). Default: TB

Basic DOT export

Terminal
$ deciduous dot > graph.dot

$ deciduous dot -o graph.dot

Generate PNG directly

Requires Graphviz installed (brew install graphviz / apt install graphviz).

Terminal
$ deciduous dot --png -o docs/graph.dot
Wrote DOT to docs/graph.dot
Generated PNG: docs/graph.png

Filter by node range

Terminal
$ deciduous dot --nodes 1-11 --png -o docs/auth-flow.dot
Wrote DOT to docs/auth-flow.dot (11 nodes)
Generated PNG: docs/auth-flow.png

$ deciduous dot -r 42 --rankdir LR -t "Auth Decision Tree"
# Outputs DOT to stdout, rooted at node 42, left-to-right layout

Auto-naming for PRs

The --auto flag generates branch-specific filenames (e.g., docs/decision-graph-feature-auth.dot), which prevents merge conflicts when multiple PRs each have their own graph.

Terminal
$ deciduous dot --auto --nodes 1-15 --png
Wrote DOT to docs/decision-graph-feature-auth.dot (15 nodes)
Generated PNG: docs/decision-graph-feature-auth.png

deciduous writeup

Generate a PR writeup from the decision graph. Includes a decision summary, the graph in DOT format, and a test plan section.

FlagShortDescription
--title <text>-tPR title
--roots <ids>-rRoot node IDs (comma-separated, traverses children)
--nodes <spec>-nNode IDs or ranges (e.g., 1-11 or 1,3,5-10)
--output <file>-oOutput file (default: stdout)
--png <filename>PNG filename to embed (auto-detects repo/branch for GitHub URL)
--autoAuto-detect PNG from branch name
--no-dotSkip DOT graph section
--no-test-planSkip test plan section

Basic writeup

Terminal
$ deciduous writeup -t "Add JWT Authentication" --nodes 42-47 -o PR.md
Wrote PR writeup to PR.md (6 nodes)

Auto-detect PNG for embedding

When you have already generated a PNG with deciduous dot --auto --png, use --auto on writeup to find and embed it:

Terminal
$ deciduous writeup --auto -t "Add JWT Auth" --nodes 42-47
# Outputs markdown to stdout with embedded graph image

Update a PR body directly

Terminal
$ gh pr edit 42 --body "$(deciduous writeup --auto -t 'Add JWT Auth' --nodes 42-47)"
https://github.com/owner/repo/pull/42

deciduous sync

Export graph data to JSON files for GitHub Pages deployment. Creates the files needed for a static version of the web viewer.

FlagShortDescription
--output <path>-oOutput path (default: .deciduous/web/graph-data.json)
Terminal
$ deciduous sync
Exported graph to docs/graph-data.json (47 nodes, 52 edges)
Exported git history to docs/git-history.json
Copied viewer to docs/index.html
Ready for GitHub Pages deployment from /docs

The PR Workflow

The recommended workflow for including decision graphs in pull requests:

Terminal -- PR workflow
# 1. Generate branch-specific PNG (avoids merge conflicts)
$ deciduous dot --auto --nodes 1-11 --png
Wrote DOT to docs/decision-graph-feature-auth.dot (11 nodes)
Generated PNG: docs/decision-graph-feature-auth.png

# 2. Commit and push
$ git add docs/decision-graph-feature-auth.dot docs/decision-graph-feature-auth.png
$ git commit -m "docs: add decision graph"
$ git push

# 3. Generate writeup with auto PNG detection
$ deciduous writeup --auto -t "Add Auth" --nodes 1-11

# 4. Update PR body
$ gh pr edit 42 --body "$(deciduous writeup --auto -t 'Add Auth' --nodes 1-11)"
https://github.com/owner/repo/pull/42

GitHub Pages Deployment

To make your decision graph publicly viewable:

  1. Run deciduous sync to export
  2. Push the docs/ folder to GitHub
  3. Go to Settings > Pages > Deploy from branch > select /docs folder
  4. Your graph will be live at https://<user>.github.io/<repo>/