INNER CODE UNIT · Python
_download_skill_from_registry
ghost-in-the-droid/android-agent · gitd/cli.py:77
def _download_skill_from_registry(name: str) -> Path | None:
"""Download a skill from the official registry by name.
Downloads individual files from the registry raw GitHub URL.
Returns the temp directory path on success, None on failure.
"""
# Fetch the registry to find the skill metadata
registry = _fetch_registry()
entry = next((s for s in registry if s.get("name") == name), None)
if entry is None:
logger.info("Skill '%s' not found in official registry.", name)
return None
# Download the skill folder from raw GitHub
tmp = Path(tempfile.mkdtemp(prefix=f"android-agent-skill-{name}-"))
base_url = f"{REGISTRY_RAW_BASE}/{name}"
# Files and dirs we expect in a skill