"""Support ``python -m mklink`` from source or an installed package."""

from __future__ import annotations

import os
import sys


_skill_dir = os.path.dirname(os.path.abspath(__file__))
_base_dir = os.path.dirname(_skill_dir)

if _base_dir not in sys.path:
    sys.path.insert(0, _base_dir)

try:
    from mklink.cli import main
except ImportError as exc:
    print("[FAIL] mklink package is not importable")
    print(f"       Run: {sys.executable} -m pip install -e \"{_base_dir}\"")
    raise SystemExit(1) from exc

raise SystemExit(main())
