{"id":51016012,"url":"https://github.com/akintunero/netdiag","last_synced_at":"2026-06-21T10:31:06.627Z","repository":{"id":362781670,"uuid":"991586998","full_name":"akintunero/netdiag","owner":"akintunero","description":"Stdlib-only CLI for SRE on-call: traceroute, DNS, ping, TLS, VPN checks, and incident presets. JSON output, stable exit codes.","archived":false,"fork":false,"pushed_at":"2026-06-05T21:06:23.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T23:05:03.094Z","etag":null,"topics":["automation","cli","command-line-tools","devops","dns","json","network-diagnostics","networking","on-call","python","sre","sysadmin","traceroute","troubleshooting","vpn"],"latest_commit_sha":null,"homepage":"https://github.com/akintunero/netdiag","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akintunero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-27T21:15:58.000Z","updated_at":"2026-06-05T21:06:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/akintunero/netdiag","commit_stats":null,"previous_names":["akintunero/netdiag"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/akintunero/netdiag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akintunero%2Fnetdiag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akintunero%2Fnetdiag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akintunero%2Fnetdiag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akintunero%2Fnetdiag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akintunero","download_url":"https://codeload.github.com/akintunero/netdiag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akintunero%2Fnetdiag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34607126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","cli","command-line-tools","devops","dns","json","network-diagnostics","networking","on-call","python","sre","sysadmin","traceroute","troubleshooting","vpn"],"created_at":"2026-06-21T10:31:05.711Z","updated_at":"2026-06-21T10:31:06.618Z","avatar_url":"https://github.com/akintunero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netdiag\n\n**Production runbook CLI for network incidents** - traceroute with ASN/BGP, DNS drift, latency, VPN checks, and on-call presets in one binary.\n\n[![CI](https://github.com/akintunero/netdiag/actions/workflows/ci.yml/badge.svg)](https://github.com/akintunero/netdiag/actions/workflows/ci.yml)\n![Python](https://img.shields.io/badge/python-3.11%2B-blue)\n![PyPI](https://img.shields.io/pypi/v/netdiag-cli?label=PyPI\u0026color=blue)\n\n![License](https://img.shields.io/badge/license-MIT-green)\n\n**Latest:** [0.1.1](CHANGELOG.md) on [PyPI](https://pypi.org/project/netdiag-cli/) (`netdiag-cli`)\n\n**Stdlib-only at runtime** · **`--json` on every command** · **Exit codes built for automation**\n\n```bash\nnetdiag doctor\nnetdiag oncall \u003cHOST\u003e --json\n```\n\n---\n\n## Install\n\n| Method | Command |\n|--------|---------|\n| From source (dev) | `python3 -m pip install -e \".[dev]\"` |\n| PyPI | `python3 -m pip install netdiag-cli` |\n| From Git | `python3 -m pip install \"git+https://github.com/akintunero/netdiag.git\"` |\n\nUse `python3 -m pip` (not bare `pip`) on macOS if `pip` is missing. The PyPI package is **`netdiag-cli`**; the command is still **`netdiag`**.\n\n**System tools:** `ping` (required). Recommended: `traceroute`, `dig`. Optional: **`lsof`** (macOS) or **`ss -p`** (Linux) for process names on `connections`, `listen`, and `local-ports`. Run `netdiag doctor` to see what is on your PATH.\n\n---\n\n## Runbook workflow\n\n| Step | Command | Exit code |\n|------|---------|-----------|\n| 1. Pre-flight | `netdiag doctor` | `0` ready · `2` missing required tools |\n| 2. Incident check | `netdiag oncall \u003cHOST\u003e --json` | `0` pass · `1` fail · `2` error |\n| 3. Ticket artifact | `netdiag report \u003cHOST\u003e -o incident.md` | same |\n\nExit code semantics are stable in v0.x - see [docs/CLI_CONTRACT.md](docs/CLI_CONTRACT.md).\n\n```bash\nnetdiag oncall 1.1.1.1 --json\nnetdiag oncall YOUR-SERVICE.example.com --json | jq '.steps[] | select(.ok==false)'\n```\n\n\u003e **Tip:** Run one command per line. Do not paste trailing `#` comments from docs into zsh/bash.\n\n### VPN and corporate DNS\n\n```bash\nnetdiag vpn --corp intranet.company.com\nnetdiag oncall app.internal --corp app.internal --vpn --json\n```\n\n### Optional config\n\nCopy [docs/config.example.toml](docs/config.example.toml) to `~/.config/netdiag/config.toml`:\n\n```toml\n[defaults]\ncorp_host = \"app.internal.corp\"\n\n[oncall]\npreset = \"oncall\"\n```\n\n### Shell completions\n\n```bash\neval \"$(netdiag completion bash)\"\neval \"$(netdiag completion zsh)\"\n```\n\n### About the CLI\n\n```bash\nnetdiag --info    # version, platform, repo links, wordmark banner\n```\n\nSet `NETDIAG_NO_BANNER=1` to hide the banner.\n\n---\n\n## Why operators use it\n\n| | |\n|---|---|\n| **One CLI** | Replaces ad-hoc `dig` + `ping` + `curl` + `traceroute` scripts |\n| **`--json`** | PagerDuty, CI, Slack bots, `jq` filters |\n| **Presets** | `web`, `api`, `vpn`, `oncall` - tuned check bundles |\n| **Small runtime** | No required PyPI dependencies |\n\n---\n\n## Quick start (developers)\n\n```bash\ngit clone https://github.com/akintunero/netdiag.git\ncd netdiag\npython3 -m pip install -e \".[dev]\"\nnetdiag doctor\npython3 -m pytest tests/ -q\n```\n\nSmoke test (live network, all subcommands):\n\n```bash\nbash scripts/cli_smoke.sh\n```\n\nExample probes:\n\n```bash\nnetdiag oncall 1.1.1.1 --json\nnetdiag oncall 1.1.1.1 --preset api --json\nnetdiag trace 8.8.8.8 -m 12 --no-bgp-api\nnetdiag report 1.1.1.1 -o incident.md\n```\n\n---\n\n## Command reference\n\n| Command | Description |\n|---------|-------------|\n| **`doctor`** | Pre-flight: required tools for runbooks |\n| **`oncall`** | Primary incident bundle (preset `oncall`) |\n| `report` | Markdown report (`-o file.md`, `--vpn`) |\n| `vpn` | VPN, split-tunnel, DNS drift |\n| `check` | Health check; `--preset` for bundles |\n| `trace` | Traceroute + ASN/BGP enrichment |\n| `ping` / `latency` | RTT, jitter, percentiles |\n| `dns` / `dns-trace` / `dns-all` | DNS lookups and delegation trace |\n| **`dns-compare`** | Resolver drift; **`--corp HOST`** for internal DNS (exit `1` on mismatch) |\n| `port` / `ports` | TCP probes and scans |\n| `http` / `tls` / `redirects` / `headers` | Application layer |\n| `speed` | CDN throughput (Cloudflare by default) |\n| `compare` | Two-host DNS + ping diff |\n| `connections` | Established TCP/UDP sockets with **process name and PID** (`lsof` / `ss`) |\n| `local-ports` / `listen` | Listening ports and owning processes |\n| `route` / `ifaces` / `dns-config` | Local routing, interfaces, resolvers |\n| `presets` | List available presets |\n| `completion` | bash / zsh completions |\n\nAlso: `whois`, `subnet`, `ip`, `ptr`, `mtr`, and more.\n\n```bash\nnetdiag --help              # all subcommands\nnetdiag \u003ccommand\u003e --help    # flags for one command\nnetdiag connections --limit 10 --json\nnetdiag dns-compare HOST -t A --corp app.internal --json\n```\n\nAll commands support `--json`.\n\n---\n\n## Documentation\n\n| Doc | Link |\n|-----|------|\n| Docs index | [docs/README.md](docs/README.md) |\n| Cookbook (on-call recipes) | [docs/cookbook.md](docs/cookbook.md) |\n| CLI contract (exit codes, flags) | [docs/CLI_CONTRACT.md](docs/CLI_CONTRACT.md) |\n| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |\n| Security | [SECURITY.md](SECURITY.md) |\n| Roadmap | [ROADMAP.md](ROADMAP.md) |\n| Changelog | [CHANGELOG.md](CHANGELOG.md) |\n\n---\n\n## Author\n\n**Olúmáyòwá Akinkuehinmi** - [@akintunero](https://github.com/akintunero) · [akintunero101@gmail.com](mailto:akintunero101@gmail.com)\n\n## License\n\nMIT - see [LICENSE](LICENSE).\n\n## Responsible use\n\nUse only on networks and hosts you are authorized to test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakintunero%2Fnetdiag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakintunero%2Fnetdiag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakintunero%2Fnetdiag/lists"}