A modular system diagnostics and analysis CLI for collecting environment data, running health checks, and generating structured reports for debugging and development workflows.
-
sysforge collectCollects a structured JSON snapshot of:- OS and platform details
- Python runtime
- Hardware (CPU, memory)
- Disk usage
- Safe environment variable summary
- Timestamp
-
sysforge doctorRuns health checks withpass/warn/failstatuses:- Disk space threshold
- Git availability
- Python version (>= 3.11)
-
sysforge reportRunscollect+doctor, writes a JSON report, and prints a short summary.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"sysforge --versionsysforge collect --pretty
sysforge collect --output ./collection.jsonsysforge doctor --disk-threshold 0.1sysforge report --output ./sysforge-report.json --pretty{
"timestamp": "2025-01-01T00:00:00+00:00",
"os": {
"name": "Darwin",
"release": "23.0",
"version": "...",
"platform": "...",
"machine": "arm64"
},
"python": {
"version": "3.11.8",
"implementation": "CPython",
"executable": "/usr/bin/python3"
},
"hardware": {
"cpu_count": 8,
"memory_bytes": 17179869184
},
"disk": {
"path": "/Users/me",
"total_bytes": 500000000000,
"used_bytes": 200000000000,
"free_bytes": 300000000000,
"percent_free": 0.60
},
"environment": {
"allowed": {
"PATH": "/usr/bin:..."
},
"total_count": 42
}
}{
"results": [
{
"name": "disk_space",
"status": "pass",
"message": "Disk space healthy: 60.00% free"
},
{
"name": "git_installed",
"status": "pass",
"message": "git is available in PATH."
},
{
"name": "python_version",
"status": "pass",
"message": "Python 3.11.8 meets requirement (>=3.11)."
}
],
"summary": {
"pass": 3,
"warn": 0,
"fail": 0
}
}The disk space check uses explicit, deterministic boundaries:
Let:
disk_threshold= user-provided threshold (default:0.10)WARN_THRESHOLD_MARGIN= internal margin (default:0.05)warn_limit = min(disk_threshold + WARN_THRESHOLD_MARGIN, 1.0)
Then:
percent_free <= disk_threshold→ faildisk_threshold < percent_free <= warn_limit→ warnpercent_free > warn_limit→ pass
This ensures predictable behavior at boundary values.
Used by both sysforge doctor and sysforge report:
| Exit Code | Meaning |
|---|---|
0 |
All checks pass |
1 |
Warnings only |
2 |
Any failures or malformed summary data |
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install
pre-commit run --all-files
ruff check .
pytest- Deterministic, machine-readable output
- Minimal dependencies
- Cross-platform behavior
- Safe-by-default environment inspection
- Easy to embed in CI and debugging workflows
MIT License