mdoctor Agent
Run reliable mdoctor setup + usage workflows, with dependency handling built in.
Quick start
From the mdoctor repo root, run:
bash skills/mdoctor-agent/scripts/install_mdoctor_with_deps.sh
Useful modes:
# Preview only
bash skills/mdoctor-agent/scripts/install_mdoctor_with_deps.sh --dry-run
# Dev mode: link current checkout (best for branch testing)
bash skills/mdoctor-agent/scripts/install_mdoctor_with_deps.sh --method dev --user-bin
# Force local installer behavior (~/.mdoctor clone/update)
bash skills/mdoctor-agent/scripts/install_mdoctor_with_deps.sh --method local
Workflow
1) Preflight
- Detect OS (
Darwinor Debian-family Linux only). - Validate method (
auto|dev|local|remote). - Check required dependencies:
gitfor local/remote methodscurlfor remote method
- If dependencies are missing:
- Linux: install via
sudo apt update && sudo apt install -y ... - macOS: instruct user to run
xcode-select --install(or Homebrew install)
- Linux: install via
2) Install mdoctor
Choose method by intent:
dev: symlink current repo./mdoctorinto bin dir (branch-accurate testing)local: run localinstall.sh(installs under~/.mdoctor)remote: one-line installer from GitHubauto(default): preferdevwhen current repo is available, fallback tolocal, thenremote
Optional flags:
--user-bin: use~/.local/bin(avoids sudo in most cases)--repo-root <path>: override repository root for dev/local modes
3) Verify installation
Run smoke checks:
mdoctor version
mdoctor help
mdoctor info
mdoctor check -m system
The installer script forces a safe TERM fallback for non-interactive sessions to reduce tput noise during checks.
4) First safe usage
Prefer non-destructive commands first:
mdoctor check
mdoctor clean
mdoctor list
Only run destructive cleanup with explicit intent:
mdoctor clean --force
5) Troubleshooting
- If
mdoctoris not found: verify symlink target and PATH. - If
/usr/local/binis not writable: rerun with--user-bin. - If Linux distro unsupported: stop and explain Debian-family limitation.
- If
sudois unavailable in remote sessions: provide exact commands for user to run locally.
Command reference
Common operations:
mdoctor check
mdoctor check --json
mdoctor check -m security
mdoctor clean
mdoctor clean --interactive
mdoctor fix dns
mdoctor fix disk
mdoctor update --check
mdoctor update
Guardrails
- Ask before state-changing operations (
clean --force,fix *, package installs). - Prefer read-only diagnosis first, then targeted fixes.
- Do not claim support for non-Debian Linux.