Version: v0.0.1
A tiny CLI that visualizes Fleet GitOps configurations as an interactive graph you can open in your browser.
This tool was developed after attending a fleet-gitops workshop in London. While its current focus is exclusively on fleet gitops config files, the approach can be expanded to be a sidecar to other GitOps tools and workflows.
- Download a sample Fleet GitOps repo
git clone https://github.com/fleetdm/fleet-gitops- Run the binary on a source (directory or single YAML file)
# Using the built binary in this repo
./dist/fleet-gitviz ./fleet-gitops
# Or if installed on your PATH
fleet-gitviz ./fleet-gitops- Open the visualization in your browser
open ./output/index.html # macOS
# or just open the file in any browser: ./output/index.html
# or use the http.server (Python3.x required)
cd ./output
python3 -m http.server 8000
open http://localhost:8000- You can point to a Fleet GitOps directory (must contain a
default.yml) or a single YAML file. - You can pass multiple sources in one run to get multiple tabs in the UI.
-
-o, --output <dir>- Where to write outputs (default:
./output). - Example:
fleet-gitviz -o ./docs/graphs ./fleet-gitops
- Where to write outputs (default:
-
-m, --mode <mode>- How to handle existing tabs:
replace(default) clears them,addappends. - Example (append to an existing visualization):
fleet-gitviz -m add ./another-fleet-gitops
- How to handle existing tabs:
-
-n, --name <name>- Custom name for the tab (applies only to the first source in a single run).
- Example:
fleet-gitviz -n "After Changes" ./fleet-gitops
-
-h, --help- Show usage help.
- Example:
fleet-gitviz -h
- Visualize a single Fleet GitOps repository
fleet-gitviz ./fleet-gitops- Visualize a single YAML file
fleet-gitviz ./starter-library.yml-
Compare two versions (diff) by creating two tabs
- Option A (two runs, lets you name both tabs):
fleet-gitviz -n "v1" ./fleet-gitops-v1 fleet-gitviz -m add -n "v2" ./fleet-gitops-v2 open ./output/index.html
- Option B (single run; first tab uses
-n, second tab is the directory name):fleet-gitviz -n "v1" ./fleet-gitops-v1 ./fleet-gitops-v2
- Option A (two runs, lets you name both tabs):
-
Visualize multiple sources at once as separate tabs
fleet-gitviz ./orig-fleet-gitops ./my-fleet-gitops- Writes
index.html,sources.json, and one JSON graph per source into the output directory (default./output). - Open
./output/index.htmlto explore the graph(s).