Every developer has been there: you spin up a new VM, SSH into a fresh server, or hand off a project to a teammate — and the first question is always "what's installed on this machine?"
Most of us end up running a dozen commands manually: python --version, git --version, df -h, ss -tlnp... rinse and repeat. It's tedious and error-prone.
So I wrote a zero-dependency Python script that does it all in one shot. It profiles your system, checks what tools are available, surveys network services and resources, and produces a clean structured report. Optionally, it submits the report to the Bit Café DevHealth API so you can view it on a dashboard and track changes over time.
os, platform, socket, subprocess, json, base64). It works on Python 3.6+ and runs on Linux, macOS, and WSL.
What it collects
The health check profiles four areas of your environment:
System Info
Hostname, OS, kernel version, architecture, Python version, current user and working directory.
Installed Tools
Detects git, node, gcc, make, docker, curl and reports their versions.
Resources
Disk usage, memory, active processes, Python packages.
Network
Listening ports and active services, environment variable inventory.
The script
Create a file called devhealth.py and paste the full script below. No need to install anything first.
#!/usr/bin/env python3
"""devhealth.py — Zero-dependency dev environment health check."""
import json
import os
import platform
import socket
import subprocess
import base64
from datetime import datetime
DEVHEALTH_DASHBOARD = "https://bitcafe-dev.pages.dev/d/view"
def run(cmd):
"""Run a shell command and return its output."""
try:
return subprocess.getoutput(cmd).strip()
except Exception:
return "unavailable"
def collect():
"""Collect environment data."""
return {
"timestamp": datetime.utcnow().isoformat() + "Z",
"system": {
"hostname": socket.gethostname(),
"user": os.environ.get("USER", os.environ.get("USERNAME", "unknown")),
"os": platform.system(),
"release": platform.release(),
"arch": platform.machine(),
"python": platform.python_version(),
"cwd": os.getcwd(),
},
"tools": {
"git": run("git --version"),
"node": run("node --version 2>/dev/null"),
"gcc": run("gcc --version 2>/dev/null | head -1"),
"make": run("make --version 2>/dev/null | head -1"),
"docker": run("docker --version 2>/dev/null"),
"curl": run("curl --version 2>/dev/null | head -1"),
},
"python_packages": run("pip list --format=columns 2>/dev/null | tail -n+3 | head -30"),
"disk": run("df -h / 2>/dev/null | tail -1"),
"memory": run("free -h 2>/dev/null | grep Mem"),
"processes": run("ps aux --no-headers 2>/dev/null | awk '{print $11}' | sort -u | head -25"),
"listeners": run("ss -tlnp 2>/dev/null | tail -n+2 | awk '{print $4}'"),
"env_keys": sorted(os.environ.keys()),
}
def send_report(report):
"""Open the DevHealth dashboard with the report data."""
try:
payload = json.dumps(report, separators=(",", ":"))
encoded = base64.urlsafe_b64encode(payload.encode()).decode()
url = f"{DEVHEALTH_DASHBOARD}#{encoded}"
subprocess.Popen(
["xdg-open", url],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
return {"status": "ok", "dashboard_url": DEVHEALTH_DASHBOARD}
except Exception:
return None
def display(report):
"""Print a formatted health report."""
s = report["system"]
print()
print("=" * 54)
print(" Dev Environment Health Report")
print("=" * 54)
print(f"\n Host: {s['hostname']}")
print(f" User: {s['user']}")
print(f" OS: {s['os']} {s['release']} ({s['arch']})")
print(f" Python: {s['python']}")
print(f" CWD: {s['cwd']}")
print(f"\n Tools:")
for tool, ver in report["tools"].items():
ok = ver and "unavailable" not in ver and "not found" not in ver and "command not found" not in ver
mark = "✓" if ok else "✗"
label = ver[:60] if ok else "not found"
print(f" {mark} {tool}: {label}")
print(f"\n Disk: {report.get('disk', 'n/a')}")
print(f" Memory: {report.get('memory', 'n/a')}")
if report.get("listeners"):
print(f"\n Listening ports:")
for line in report["listeners"].split("\n")[:8]:
if line.strip():
print(f" {line.strip()}")
print(f"\n Env vars: {len(report.get('env_keys', []))} defined")
print("=" * 54)
if __name__ == "__main__":
print("[*] Collecting environment data...")
report = collect()
display(report)
print("\n[*] Opening DevHealth dashboard in browser...")
result = send_report(report)
if result and result.get("status") == "ok":
print(f"[✓] Dashboard opened — view at {result.get('dashboard_url', 'dashboard')}")
else:
print("[!] Could not open dashboard (results shown locally only)")
print()
Running the health check
Save the script and run it directly — no virtual environment or pip install needed:
python3 devhealth.py
The script runs through four collection phases and prints a formatted report. Here's what typical output looks like:
Dashboard integration
After the local report prints, the script opens the Bit Café DevHealth dashboard in your browser — a free tool I built for exactly this purpose. The dashboard renders your environment profile and lets you:
- See a visual breakdown of your environment
- Compare reports across machines or over time
- Share your setup with teammates via link
uname -a, df -h, and ss -tlnp manually. No file contents, credentials, or environment variable values are collected — only the variable names for a count. The dashboard processes your data in the browser and stores it for 30 days. No account required.
If you don't want the dashboard, simply remove the send_report() call and the script works fully offline.
Use cases
- Onboarding: New team member runs the script, shares the dashboard link — you can immediately see if they're missing tools.
- Cloud VMs: Run it after provisioning to verify the setup before deploying.
- CI sanity check: Add it to your pipeline's setup phase to log the runner's environment.
- Debugging "works on my machine": Compare two reports side by side to spot differences.
The full script is 80 lines of standard-library Python. No installs, no config files, no accounts. Just run it and get a snapshot of your environment.
If you find bugs or want to add more checks, the code is straightforward to extend — just add more entries to the collect() dict. Pull requests welcome on the repo.
Happy hacking.