netcheckx 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netcheckx-2.1.0/LICENSE +34 -0
- netcheckx-2.1.0/PKG-INFO +244 -0
- netcheckx-2.1.0/README.md +225 -0
- netcheckx-2.1.0/netcheck/__init__.py +1 -0
- netcheckx-2.1.0/netcheck/__main__.py +14 -0
- netcheckx-2.1.0/netcheck/cli.py +512 -0
- netcheckx-2.1.0/netcheck/mcp/server.py +110 -0
- netcheckx-2.1.0/netcheck/mcp/tools.py +236 -0
- netcheckx-2.1.0/netcheck/modules/dns.py +110 -0
- netcheckx-2.1.0/netcheck/modules/http.py +92 -0
- netcheckx-2.1.0/netcheck/modules/interfaces.py +268 -0
- netcheckx-2.1.0/netcheck/modules/ping.py +113 -0
- netcheckx-2.1.0/netcheck/modules/ssl.py +235 -0
- netcheckx-2.1.0/netcheck/modules/tcp.py +70 -0
- netcheckx-2.1.0/netcheck/utils/cache.py +34 -0
- netcheckx-2.1.0/netcheck/utils/formatters.py +707 -0
- netcheckx-2.1.0/netcheck/utils/normalize.py +87 -0
- netcheckx-2.1.0/netcheck/utils/range_expanders.py +77 -0
- netcheckx-2.1.0/netcheck/utils/retry.py +56 -0
- netcheckx-2.1.0/netcheck/utils/timeout.py +23 -0
- netcheckx-2.1.0/netcheckx.egg-info/PKG-INFO +244 -0
- netcheckx-2.1.0/netcheckx.egg-info/SOURCES.txt +28 -0
- netcheckx-2.1.0/netcheckx.egg-info/dependency_links.txt +1 -0
- netcheckx-2.1.0/netcheckx.egg-info/entry_points.txt +2 -0
- netcheckx-2.1.0/netcheckx.egg-info/requires.txt +6 -0
- netcheckx-2.1.0/netcheckx.egg-info/top_level.txt +1 -0
- netcheckx-2.1.0/pyproject.toml +35 -0
- netcheckx-2.1.0/setup.cfg +4 -0
- netcheckx-2.1.0/tests/test_cli.py +225 -0
- netcheckx-2.1.0/tests/test_netcheck.py +363 -0
netcheckx-2.1.0/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2025 Network Access Check Tool Contributors
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
═══════════════════════════════════════════════════════════════════
|
|
20
|
+
|
|
21
|
+
ADDITIONAL PERMISSIONS
|
|
22
|
+
|
|
23
|
+
This software is open source and free to use for:
|
|
24
|
+
✓ Personal use
|
|
25
|
+
✓ Educational purposes
|
|
26
|
+
✓ Commercial use (with source code availability requirement)
|
|
27
|
+
✓ Modifications and improvements
|
|
28
|
+
|
|
29
|
+
COPYLEFT NOTICE:
|
|
30
|
+
Any modifications or derivative works must also be released under GPL v3.
|
|
31
|
+
You cannot create proprietary closed-source versions of this software.
|
|
32
|
+
|
|
33
|
+
For the complete GPL v3 license text, visit:
|
|
34
|
+
https://www.gnu.org/licenses/gpl-3.0.txt
|
netcheckx-2.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netcheckx
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Network connectivity checker with DNS, ping, HTTP, and SSL validation
|
|
5
|
+
Author-email: Network Tools Team <admin@example.com>
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Topic :: System :: Networking :: Monitoring
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
15
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
16
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
17
|
+
Requires-Dist: pyinstaller>=6.0.0; extra == "dev"
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# Network Connectivity Checker (`netcheck`)
|
|
21
|
+
|
|
22
|
+
[](pyproject.toml)
|
|
23
|
+
[](LICENSE)
|
|
24
|
+
[](#)
|
|
25
|
+
[](#)
|
|
26
|
+
|
|
27
|
+
A premium, cross-platform, production-grade **Network Intelligence Engine & CLI** written in pure Python 3. Overhauled from a legacy Bash tool into a zero-dependency Python engine with high-concurrency diagnostics, lenient target input normalisation, structured output (JSON/CSV/XML), and an integrated **Model Context Protocol (MCP) Server** for AI assistants.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🚀 Key Features
|
|
32
|
+
|
|
33
|
+
- **Zero-Dependency Core** — Built on the Python standard library. No third-party packages required to run.
|
|
34
|
+
- **Cross-Platform** — Native support for Linux, macOS, and Windows with consistent terminal output.
|
|
35
|
+
- **Subcommand CLI** — Modular `tcp`, `dns`, `http`, `ssl`, `ping`, and `interfaces` subcommands.
|
|
36
|
+
- **Structured Output** — Every check returns `--format text|json|csv|xml`.
|
|
37
|
+
- **MCP Server** — Turns `netcheck` into a local tool-server for Claude, ChatGPT, and other AI agents.
|
|
38
|
+
- **Lenient Parsing** — Accepts CSVs, URLs, bracketed IPv6, IP ranges (`192.168.1.1-50`), CIDR (`10.0.0.0/24`), port lists (`80,443`), and port ranges (`8000-8100`).
|
|
39
|
+
- **Concurrent Batch Checks** — Configurable thread pools (`--jobs`, default 10) with real-time progress.
|
|
40
|
+
- **DNS Caching** — Resolves each host once per run; subsequent checks reuse the cached result.
|
|
41
|
+
- **IPv6 Dual-Stack TCP** — Tries all resolved IPs (IPv4 + IPv6) until one connects.
|
|
42
|
+
- **SSL Inspection Fallback** — Uses the `cryptography` library to inspect certificate metadata even when strict TLS validation fails.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 📦 Installation
|
|
47
|
+
|
|
48
|
+
### Option 1: `pip` (recommended)
|
|
49
|
+
```bash
|
|
50
|
+
pip install .
|
|
51
|
+
# or system-wide:
|
|
52
|
+
sudo pip install .
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Option 2: Snap Store (Linux)
|
|
56
|
+
```bash
|
|
57
|
+
sudo snap install netcheck
|
|
58
|
+
sudo snap connect netcheck:network-observe # enables ping & interfaces
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Option 3: Debian package (`.deb`)
|
|
62
|
+
```bash
|
|
63
|
+
sudo dpkg -i netcheck_2.0.0_amd64.deb
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Option 4: Chocolatey (Windows)
|
|
67
|
+
```powershell
|
|
68
|
+
choco install netcheck
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Option 5: macOS `.pkg`
|
|
72
|
+
Double-click the downloaded `.pkg` file, or:
|
|
73
|
+
```bash
|
|
74
|
+
sudo installer -pkg netcheck-2.0.0.pkg -target /
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Option 6: Developer / local run (no install)
|
|
78
|
+
```bash
|
|
79
|
+
# 1. Clone the repo
|
|
80
|
+
git clone https://github.com/farman20ali/network_access_check.git
|
|
81
|
+
cd network_access_check
|
|
82
|
+
|
|
83
|
+
# 2. Install dev dependencies
|
|
84
|
+
pip install -r python-requirements.txt
|
|
85
|
+
# or
|
|
86
|
+
pip install -e ".[dev]"
|
|
87
|
+
|
|
88
|
+
# 3. Run directly
|
|
89
|
+
python3 -m netcheck --help
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 🛠️ CLI Reference
|
|
95
|
+
|
|
96
|
+
### Subcommands
|
|
97
|
+
|
|
98
|
+
| Subcommand | Description | Example |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `tcp` | TCP port reachability | `netcheck tcp google.com 80,443` |
|
|
101
|
+
| `dns` | DNS hostname resolution | `netcheck dns github.com` |
|
|
102
|
+
| `http` | HTTP/HTTPS status + latency | `netcheck http https://google.com` |
|
|
103
|
+
| `ssl` | SSL certificate inspection | `netcheck ssl google.com` |
|
|
104
|
+
| `ping` | ICMP ping with RTT stats | `netcheck ping 8.8.8.8` |
|
|
105
|
+
| `interfaces` | Active network interfaces + public IP | `netcheck interfaces --all` |
|
|
106
|
+
|
|
107
|
+
### Global Flags
|
|
108
|
+
|
|
109
|
+
| Flag | Default | Description |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| `-t, --timeout` | `5` | Connection timeout in seconds |
|
|
112
|
+
| `-j, --jobs` | `10` | Concurrent thread pool size |
|
|
113
|
+
| `-f, --format` | `text` | Output format: `text`, `json`, `csv`, `xml` |
|
|
114
|
+
| `--retry` | `1` | Number of connection attempts |
|
|
115
|
+
| `--retry-delay` | `1` | Delay between retries (seconds) |
|
|
116
|
+
| `-c, --count` | `4` | Ping packet count (`ping` subcommand only) |
|
|
117
|
+
| `-v, --version` | — | Print version and exit |
|
|
118
|
+
|
|
119
|
+
### Legacy Flags (kept for backward compatibility)
|
|
120
|
+
|
|
121
|
+
| Legacy | Equivalent subcommand |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `-q, --quick <host> <port>` | `netcheck tcp` |
|
|
124
|
+
| `-d, --dns <host>` | `netcheck dns` |
|
|
125
|
+
| `-p, --ping <host>` | `netcheck ping` |
|
|
126
|
+
| `-s, --status <url>` | `netcheck http` |
|
|
127
|
+
| `--cert <host>` | `netcheck ssl` |
|
|
128
|
+
| `--my-ip, -ip` | `netcheck interfaces` |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 🤖 MCP Server
|
|
133
|
+
|
|
134
|
+
`netcheck` ships an integrated [Model Context Protocol](https://modelcontextprotocol.io/) server.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
netcheck --mcp
|
|
138
|
+
# or
|
|
139
|
+
python3 -m netcheck.mcp.server
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Claude Desktop `claude_desktop_config.json`:**
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"mcpServers": {
|
|
146
|
+
"netcheck": {
|
|
147
|
+
"command": "python3",
|
|
148
|
+
"args": ["-m", "netcheck.mcp.server"],
|
|
149
|
+
"env": { "PYTHONPATH": "/path/to/network_access_check" }
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Exposed MCP tools:** `dns_lookup`, `ping_host`, `check_tcp_port`, `check_http_status`, `check_ssl_certificate`, `list_interfaces`.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 🏗️ Building Packages
|
|
160
|
+
|
|
161
|
+
All packaging is orchestrated by [`build_packages.py`](build_packages.py). Templates live in [`packaging/`](packaging/).
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
packaging/
|
|
165
|
+
├── chocolatey/ ← Windows Chocolatey (.nupkg)
|
|
166
|
+
│ └── tools/
|
|
167
|
+
├── linux/ ← install.sh / uninstall.sh
|
|
168
|
+
├── macos/ ← macOS .pkg scripts
|
|
169
|
+
├── snap/ ← snapcraft.yaml template
|
|
170
|
+
└── windows/ ← NSIS installer script (.nsi)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Common build commands
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Check available tools on this machine
|
|
177
|
+
python3 build_packages.py --check
|
|
178
|
+
|
|
179
|
+
# Sync a new version across all config files
|
|
180
|
+
python3 build_packages.py --sync-version 2.1.0
|
|
181
|
+
|
|
182
|
+
# Build all packages for the current OS
|
|
183
|
+
python3 build_packages.py --all
|
|
184
|
+
|
|
185
|
+
# Individual targets
|
|
186
|
+
python3 build_packages.py --pypi # wheel + sdist
|
|
187
|
+
python3 build_packages.py --deb # Debian .deb
|
|
188
|
+
python3 build_packages.py --rpm # RPM
|
|
189
|
+
python3 build_packages.py --snap # Snap .snap
|
|
190
|
+
python3 build_packages.py --linux # standalone binary (PyInstaller)
|
|
191
|
+
python3 build_packages.py --win # Windows .exe + NSIS + Chocolatey
|
|
192
|
+
python3 build_packages.py --mac # macOS binary + .pkg
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
All output lands in `dist/<target>/`.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🧪 Running Tests
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Using Make
|
|
203
|
+
make test
|
|
204
|
+
|
|
205
|
+
# Using pytest directly
|
|
206
|
+
python3 -m pytest tests/ -v
|
|
207
|
+
|
|
208
|
+
# With coverage
|
|
209
|
+
python3 -m pytest tests/ --cov=netcheck --cov-report=term-missing
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 📁 Repository Structure
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
network_access_check/
|
|
218
|
+
├── netcheck/ ← Python package
|
|
219
|
+
│ ├── __init__.py ← version string
|
|
220
|
+
│ ├── __main__.py ← python3 -m netcheck entry point
|
|
221
|
+
│ ├── cli.py ← CLI argument parsing & dispatch
|
|
222
|
+
│ ├── mcp/ ← MCP server
|
|
223
|
+
│ ├── modules/ ← dns, tcp, http, ssl, ping, interfaces
|
|
224
|
+
│ └── utils/ ← formatters, retry, concurrency helpers
|
|
225
|
+
├── packaging/ ← Platform packaging templates
|
|
226
|
+
│ ├── chocolatey/
|
|
227
|
+
│ ├── linux/
|
|
228
|
+
│ ├── macos/
|
|
229
|
+
│ ├── snap/
|
|
230
|
+
│ └── windows/
|
|
231
|
+
├── tests/ ← pytest test suite
|
|
232
|
+
├── docs/ ← Guides and release notes
|
|
233
|
+
├── .github/workflows/ ← CI (ci.yml) + Release (release.yml)
|
|
234
|
+
├── build_packages.py ← Build orchestration script
|
|
235
|
+
├── pyproject.toml ← Package metadata & build config
|
|
236
|
+
├── python-requirements.txt ← Local dev setup shortcut
|
|
237
|
+
└── Makefile ← make install / test / clean
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 🛡️ License
|
|
243
|
+
|
|
244
|
+
Distributed under the **GNU General Public License v3 (GPL-3.0)**. See [`LICENSE`](LICENSE) for details.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Network Connectivity Checker (`netcheck`)
|
|
2
|
+
|
|
3
|
+
[](pyproject.toml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](#)
|
|
6
|
+
[](#)
|
|
7
|
+
|
|
8
|
+
A premium, cross-platform, production-grade **Network Intelligence Engine & CLI** written in pure Python 3. Overhauled from a legacy Bash tool into a zero-dependency Python engine with high-concurrency diagnostics, lenient target input normalisation, structured output (JSON/CSV/XML), and an integrated **Model Context Protocol (MCP) Server** for AI assistants.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🚀 Key Features
|
|
13
|
+
|
|
14
|
+
- **Zero-Dependency Core** — Built on the Python standard library. No third-party packages required to run.
|
|
15
|
+
- **Cross-Platform** — Native support for Linux, macOS, and Windows with consistent terminal output.
|
|
16
|
+
- **Subcommand CLI** — Modular `tcp`, `dns`, `http`, `ssl`, `ping`, and `interfaces` subcommands.
|
|
17
|
+
- **Structured Output** — Every check returns `--format text|json|csv|xml`.
|
|
18
|
+
- **MCP Server** — Turns `netcheck` into a local tool-server for Claude, ChatGPT, and other AI agents.
|
|
19
|
+
- **Lenient Parsing** — Accepts CSVs, URLs, bracketed IPv6, IP ranges (`192.168.1.1-50`), CIDR (`10.0.0.0/24`), port lists (`80,443`), and port ranges (`8000-8100`).
|
|
20
|
+
- **Concurrent Batch Checks** — Configurable thread pools (`--jobs`, default 10) with real-time progress.
|
|
21
|
+
- **DNS Caching** — Resolves each host once per run; subsequent checks reuse the cached result.
|
|
22
|
+
- **IPv6 Dual-Stack TCP** — Tries all resolved IPs (IPv4 + IPv6) until one connects.
|
|
23
|
+
- **SSL Inspection Fallback** — Uses the `cryptography` library to inspect certificate metadata even when strict TLS validation fails.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
### Option 1: `pip` (recommended)
|
|
30
|
+
```bash
|
|
31
|
+
pip install .
|
|
32
|
+
# or system-wide:
|
|
33
|
+
sudo pip install .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Option 2: Snap Store (Linux)
|
|
37
|
+
```bash
|
|
38
|
+
sudo snap install netcheck
|
|
39
|
+
sudo snap connect netcheck:network-observe # enables ping & interfaces
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Option 3: Debian package (`.deb`)
|
|
43
|
+
```bash
|
|
44
|
+
sudo dpkg -i netcheck_2.0.0_amd64.deb
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Option 4: Chocolatey (Windows)
|
|
48
|
+
```powershell
|
|
49
|
+
choco install netcheck
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Option 5: macOS `.pkg`
|
|
53
|
+
Double-click the downloaded `.pkg` file, or:
|
|
54
|
+
```bash
|
|
55
|
+
sudo installer -pkg netcheck-2.0.0.pkg -target /
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Option 6: Developer / local run (no install)
|
|
59
|
+
```bash
|
|
60
|
+
# 1. Clone the repo
|
|
61
|
+
git clone https://github.com/farman20ali/network_access_check.git
|
|
62
|
+
cd network_access_check
|
|
63
|
+
|
|
64
|
+
# 2. Install dev dependencies
|
|
65
|
+
pip install -r python-requirements.txt
|
|
66
|
+
# or
|
|
67
|
+
pip install -e ".[dev]"
|
|
68
|
+
|
|
69
|
+
# 3. Run directly
|
|
70
|
+
python3 -m netcheck --help
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🛠️ CLI Reference
|
|
76
|
+
|
|
77
|
+
### Subcommands
|
|
78
|
+
|
|
79
|
+
| Subcommand | Description | Example |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| `tcp` | TCP port reachability | `netcheck tcp google.com 80,443` |
|
|
82
|
+
| `dns` | DNS hostname resolution | `netcheck dns github.com` |
|
|
83
|
+
| `http` | HTTP/HTTPS status + latency | `netcheck http https://google.com` |
|
|
84
|
+
| `ssl` | SSL certificate inspection | `netcheck ssl google.com` |
|
|
85
|
+
| `ping` | ICMP ping with RTT stats | `netcheck ping 8.8.8.8` |
|
|
86
|
+
| `interfaces` | Active network interfaces + public IP | `netcheck interfaces --all` |
|
|
87
|
+
|
|
88
|
+
### Global Flags
|
|
89
|
+
|
|
90
|
+
| Flag | Default | Description |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `-t, --timeout` | `5` | Connection timeout in seconds |
|
|
93
|
+
| `-j, --jobs` | `10` | Concurrent thread pool size |
|
|
94
|
+
| `-f, --format` | `text` | Output format: `text`, `json`, `csv`, `xml` |
|
|
95
|
+
| `--retry` | `1` | Number of connection attempts |
|
|
96
|
+
| `--retry-delay` | `1` | Delay between retries (seconds) |
|
|
97
|
+
| `-c, --count` | `4` | Ping packet count (`ping` subcommand only) |
|
|
98
|
+
| `-v, --version` | — | Print version and exit |
|
|
99
|
+
|
|
100
|
+
### Legacy Flags (kept for backward compatibility)
|
|
101
|
+
|
|
102
|
+
| Legacy | Equivalent subcommand |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `-q, --quick <host> <port>` | `netcheck tcp` |
|
|
105
|
+
| `-d, --dns <host>` | `netcheck dns` |
|
|
106
|
+
| `-p, --ping <host>` | `netcheck ping` |
|
|
107
|
+
| `-s, --status <url>` | `netcheck http` |
|
|
108
|
+
| `--cert <host>` | `netcheck ssl` |
|
|
109
|
+
| `--my-ip, -ip` | `netcheck interfaces` |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🤖 MCP Server
|
|
114
|
+
|
|
115
|
+
`netcheck` ships an integrated [Model Context Protocol](https://modelcontextprotocol.io/) server.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
netcheck --mcp
|
|
119
|
+
# or
|
|
120
|
+
python3 -m netcheck.mcp.server
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Claude Desktop `claude_desktop_config.json`:**
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"netcheck": {
|
|
128
|
+
"command": "python3",
|
|
129
|
+
"args": ["-m", "netcheck.mcp.server"],
|
|
130
|
+
"env": { "PYTHONPATH": "/path/to/network_access_check" }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Exposed MCP tools:** `dns_lookup`, `ping_host`, `check_tcp_port`, `check_http_status`, `check_ssl_certificate`, `list_interfaces`.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 🏗️ Building Packages
|
|
141
|
+
|
|
142
|
+
All packaging is orchestrated by [`build_packages.py`](build_packages.py). Templates live in [`packaging/`](packaging/).
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
packaging/
|
|
146
|
+
├── chocolatey/ ← Windows Chocolatey (.nupkg)
|
|
147
|
+
│ └── tools/
|
|
148
|
+
├── linux/ ← install.sh / uninstall.sh
|
|
149
|
+
├── macos/ ← macOS .pkg scripts
|
|
150
|
+
├── snap/ ← snapcraft.yaml template
|
|
151
|
+
└── windows/ ← NSIS installer script (.nsi)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Common build commands
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Check available tools on this machine
|
|
158
|
+
python3 build_packages.py --check
|
|
159
|
+
|
|
160
|
+
# Sync a new version across all config files
|
|
161
|
+
python3 build_packages.py --sync-version 2.1.0
|
|
162
|
+
|
|
163
|
+
# Build all packages for the current OS
|
|
164
|
+
python3 build_packages.py --all
|
|
165
|
+
|
|
166
|
+
# Individual targets
|
|
167
|
+
python3 build_packages.py --pypi # wheel + sdist
|
|
168
|
+
python3 build_packages.py --deb # Debian .deb
|
|
169
|
+
python3 build_packages.py --rpm # RPM
|
|
170
|
+
python3 build_packages.py --snap # Snap .snap
|
|
171
|
+
python3 build_packages.py --linux # standalone binary (PyInstaller)
|
|
172
|
+
python3 build_packages.py --win # Windows .exe + NSIS + Chocolatey
|
|
173
|
+
python3 build_packages.py --mac # macOS binary + .pkg
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
All output lands in `dist/<target>/`.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 🧪 Running Tests
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Using Make
|
|
184
|
+
make test
|
|
185
|
+
|
|
186
|
+
# Using pytest directly
|
|
187
|
+
python3 -m pytest tests/ -v
|
|
188
|
+
|
|
189
|
+
# With coverage
|
|
190
|
+
python3 -m pytest tests/ --cov=netcheck --cov-report=term-missing
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 📁 Repository Structure
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
network_access_check/
|
|
199
|
+
├── netcheck/ ← Python package
|
|
200
|
+
│ ├── __init__.py ← version string
|
|
201
|
+
│ ├── __main__.py ← python3 -m netcheck entry point
|
|
202
|
+
│ ├── cli.py ← CLI argument parsing & dispatch
|
|
203
|
+
│ ├── mcp/ ← MCP server
|
|
204
|
+
│ ├── modules/ ← dns, tcp, http, ssl, ping, interfaces
|
|
205
|
+
│ └── utils/ ← formatters, retry, concurrency helpers
|
|
206
|
+
├── packaging/ ← Platform packaging templates
|
|
207
|
+
│ ├── chocolatey/
|
|
208
|
+
│ ├── linux/
|
|
209
|
+
│ ├── macos/
|
|
210
|
+
│ ├── snap/
|
|
211
|
+
│ └── windows/
|
|
212
|
+
├── tests/ ← pytest test suite
|
|
213
|
+
├── docs/ ← Guides and release notes
|
|
214
|
+
├── .github/workflows/ ← CI (ci.yml) + Release (release.yml)
|
|
215
|
+
├── build_packages.py ← Build orchestration script
|
|
216
|
+
├── pyproject.toml ← Package metadata & build config
|
|
217
|
+
├── python-requirements.txt ← Local dev setup shortcut
|
|
218
|
+
└── Makefile ← make install / test / clean
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🛡️ License
|
|
224
|
+
|
|
225
|
+
Distributed under the **GNU General Public License v3 (GPL-3.0)**. See [`LICENSE`](LICENSE) for details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.0"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
# Ensure parent directory is in sys.path when run directly as `python3 netcheck`
|
|
5
|
+
if __name__ == "__main__" and not __package__:
|
|
6
|
+
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
7
|
+
if parent_dir not in sys.path:
|
|
8
|
+
sys.path.insert(0, parent_dir)
|
|
9
|
+
__package__ = "netcheck"
|
|
10
|
+
|
|
11
|
+
from netcheck.cli import main
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|