{"id":50089483,"url":"https://github.com/heyfang/net-reason","last_synced_at":"2026-05-22T22:08:03.663Z","repository":{"id":355460746,"uuid":"1228178631","full_name":"HeyFang/net-reason","owner":"HeyFang","description":"NetReason — Your mini AI sysadmin that figures out network issues and tells you what to do.","archived":false,"fork":false,"pushed_at":"2026-05-03T17:49:36.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T19:31:27.622Z","etag":null,"topics":["aikr","cli-tool","python-script"],"latest_commit_sha":null,"homepage":"","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/HeyFang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-03T17:41:24.000Z","updated_at":"2026-05-03T17:55:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/HeyFang/net-reason","commit_stats":null,"previous_names":["heyfang/net-reason"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/HeyFang/net-reason","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyFang%2Fnet-reason","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyFang%2Fnet-reason/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyFang%2Fnet-reason/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyFang%2Fnet-reason/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeyFang","download_url":"https://codeload.github.com/HeyFang/net-reason/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyFang%2Fnet-reason/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33372739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-22T21:56:13.512Z","status":"ssl_error","status_checked_at":"2026-05-22T21:56:10.769Z","response_time":265,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aikr","cli-tool","python-script"],"created_at":"2026-05-22T22:08:02.015Z","updated_at":"2026-05-22T22:08:03.658Z","avatar_url":"https://github.com/HeyFang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# net-reason\n\n\u003e AIKR (AI Knowledge Reasoning) — Network \u0026 Linux error diagnosis CLI\n\n**net-reason** is a command-line tool that helps diagnose common Linux and Ubuntu network errors through a guided Y/N question flow. It maps your error to a known category, walks a decision tree to narrow down the root cause, and surfaces specific fix commands.\n\n---\n\n## Install\n\n```bash\ngit clone https://github.com/you/net-reason\ncd net-reason\npip install -e .\n```\n\nOr without cloning:\n\n```bash\npip install -e /path/to/net-reason\n```\n\n---\n\n## Usage\n\n### Diagnose an error\n\n```bash\n# Interactive — paste or type your error\nnetreason diagnose\n\n# Pass the error directly\nnetreason diagnose \"temporary failure in name resolution\"\nnetreason diagnose \"could not get lock /var/lib/dpkg/lock\"\nnetreason diagnose ssh\nnetreason diagnose dns\n```\n\n### List supported categories\n\n```bash\nnetreason list\n```\n\n---\n\n## How it works\n\n1. You paste an error message or type a keyword\n2. net-reason matches it to a category via keyword scoring\n3. It asks a short series of Y/N questions to narrow down the condition\n4. It outputs a root cause diagnosis + specific fix commands\n\nThe entire knowledge base lives in `data/errors.json` — it's a tree of questions and leaf-node diagnoses. Easy to extend.\n\n---\n\n## Supported error categories\n\n| Category | Examples |\n|---|---|\n| **DNS Resolution** | `could not resolve host`, `temporary failure in name resolution` |\n| **SSH Connection** | `connection refused`, `host key verification failed`, `permission denied (publickey)` |\n| **APT Package Manager** | `could not get lock`, `unable to fetch`, `dpkg was interrupted` |\n| **Network Connectivity** | `network unreachable`, `no route to host`, `interface down` |\n| **Systemd / Services** | `failed to start`, `unit not found`, `masked`, `active: failed` |\n| **Firewall / UFW** | `ufw`, `port blocked`, `iptables` |\n\n---\n\n## Extending the knowledge base\n\nEdit `data/errors.json`. Each category follows this schema:\n\n```json\n{\n  \"id\": \"my_category\",\n  \"name\": \"Human Name\",\n  \"keywords\": [\"error keyword\", \"another phrase\"],\n  \"description\": \"Short description\",\n  \"tree\": {\n    \"question\": \"Is X happening?\",\n    \"yes\": {\n      \"question\": \"Is Y also true?\",\n      \"yes\": {\n        \"diagnosis\": \"Root cause label\",\n        \"cause\": \"Explanation of why this happens.\",\n        \"fixes\": [\n          \"First fix command or instruction\",\n          \"Second option\"\n        ],\n        \"docs\": \"https://link-to-docs\"\n      },\n      \"no\": { ... }\n    },\n    \"no\": { ... }\n  }\n}\n```\n\nLeaf nodes have `diagnosis`, `cause`, `fixes`, and `docs`.  \nBranch nodes have `question`, `yes`, and `no`.\n\n---\n\n## Project structure\n\n```\nnet-reason/\n├── netreason/\n│   ├── __init__.py\n│   ├── cli.py        — CLI entry point and commands\n│   ├── matcher.py    — Keyword-based category matching\n│   ├── engine.py     — Decision tree walker\n│   └── ui.py         — Terminal UI helpers\n├── data/\n│   └── errors.json   — Knowledge base\n├── setup.py\n└── README.md\n```\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyfang%2Fnet-reason","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyfang%2Fnet-reason","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyfang%2Fnet-reason/lists"}