How heymaikol/network-doctor works
Network Doctor is a cross-platform network troubleshooting CLI/TUI. Its main workflow accepts a target or local-network request, runs independent network probes, interprets their evidence into a diagnosis and remediation hints, then presents results interactively or as structured output. Additional documented capabilities include service profiles, watch-mode incident reconstruction, saved snapshots and comparisons, remote and two-ended diagnoses, and a Linux simulator used by Challenge Mode. Source excerpts are partial, so edges to unsampled subsystems are included only where the README or source index supports them.
Main entry points: app.go Mode orchestration · netdoc-sim/main.go Simulator commands · netdoc/main.go CLI entrypoints · checks.go Network probes
Components 21
Command and app
- CLI entrypoints
cmd/netdoc/main.go - Mode orchestration
internal/app/app.go
Diagnosis
- Network probes
internal/diagnostic/checks.go - Diagnosis and fixes
internal/diagnostic/diagnosis.go - Service profiles
internal/profile/profile.go
Results and history
- Interactive TUI
internal/ui/model.go - Results view
internal/ui/view.go - Watch incidents
internal/incident/incident.go - Reports
internal/report/report.go - Diagnostic snapshots
internal/snapshot/snapshot.go - Snapshot comparison
internal/compare/compare.go - Two-sided comparison
internal/compare/twosided.go
Remote diagnosis
- Peer sessions
internal/peer/session.go - Peer protocol
internal/peer/protocol.go - SSH remote client
internal/remote/client.go
Simulation
- Simulator commands
cmd/netdoc-sim/main.go - Challenge runner
cmd/netdoc-sim/challenge.go - Simulation triage
cmd/netdoc-sim/triage.go - Virtual network engine
internal/simulation - Field replay corpus
internal/fieldcase/corpus.go
Other components
- User or script
Connections 22
- User or script → CLI entrypoints: invokes
README.md - CLI entrypoints → Mode orchestration: starts
cmd/netdoc/main.go - Mode orchestration → Network probes: runs checks
internal/app/app.go - Network probes → Diagnosis and fixes: supplies evidence
README.md - Mode orchestration → Service profiles: composes runs
internal/app/app.go - Mode orchestration → Interactive TUI: starts TUI
internal/app/app.go - Interactive TUI → Results view: renders
- Mode orchestration → Reports: emits report
- Mode orchestration → Diagnostic snapshots: saves snapshot
internal/app/app.go - Mode orchestration → SSH remote client: runs remotely
- Mode orchestration → Peer sessions: starts peer mode
internal/app/app.go - Peer sessions → Peer protocol: exchanges messages
internal/peer/session.go - Mode orchestration → Two-sided comparison: compares sides
internal/app/app.go - Two-sided comparison → Snapshot comparison: compares snapshots
internal/compare/twosided.go - Watch incidents → Snapshot comparison: derives changes
internal/incident/incident.go - Mode orchestration → Watch incidents: tracks watch
README.md - Mode orchestration → Simulator commands: offers challenge mode
README.md - Simulator commands → Challenge runner: dispatches
cmd/netdoc-sim/main.go - Simulator commands → Virtual network engine: runs scenarios
cmd/netdoc-sim/main.go - Challenge runner → Virtual network engine: uses scenarios
cmd/netdoc-sim/challenge.go - Simulator commands → Simulation triage: dispatches
cmd/netdoc-sim/main.go - User or script → Field replay corpus: provides replay