INNER CODE UNIT · Python
_clone_github_skill
ghost-in-the-droid/android-agent · gitd/cli.py:134
def _clone_github_skill(url: str) -> Path | None:
"""Clone a skill from a GitHub URL. Returns temp dir on success."""
url = _normalize_github_url(url)
tmp = Path(tempfile.mkdtemp(prefix="android-agent-skill-"))
clone_target = tmp / "repo"
try:
result = subprocess.run(
["git", "clone", "--depth", "1", url, str(clone_target)],
capture_output=True,
text=True,
timeout=60,
)
if result.returncode != 0:
logger.error("git clone failed: %s", result.stderr.strip())
shutil.rmtree(tmp, ignore_errors=True)
return None
except FileNotFoundError:
logger.error("git is not installed. Install git or use a registry skill name.")