extract-repo

Download GitHub repositories as clean source code via shallow clone.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/pascalandy/dotfiles --skill extract-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-repo
Source: https://github.com/pascalandy/dotfiles/tree/main/dot_config/opencode/skill/util-extract-repo
Command: npx skills add https://github.com/pascalandy/dotfiles --skill extract-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires questionary, rich, and includes scripts (resource) components.

What problem does it solve?

This Skill downloads GitHub repositories as clean source code (no git history) into a designated WORKDIR to simplify analysis, modification, and archival workflows while avoiding clutter from full repository histories.

Core Features & Use Cases

  • Shallow cloning: fetches only the latest snapshot to reduce download size.
  • Automatic storage: saves repos under WORKDIR with a marker that tracks managed repos.
  • Repo management: handles name conflicts by suffixing duplicates; supports interactive removal of managed repos.
  • Use Case: clone a repository for experimentation or code review without touching your main clones.

Quick Start

Run the extract-repo script via uv to clone a repo: uv run .opencode/skill/extract-repo/scripts/extract_repo.py <URL> and then cd into the extracted directory.

Frequently Asked Questions about extract-repo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clone a GitHub repository without git history?

Cloning a GitHub repository without git history involves using a shallow clone with depth 1 to fetch only the latest snapshot. This approach downloads clean source code into a designated workdir, skipping full commit logs for analysis or archival workflows.

What is the best way to download multiple GitHub repos for code analysis?

Downloading multiple GitHub repos for code analysis is best handled by automating shallow clones into a managed workdir. This method marks each repository with a tracking file and suffixes name conflicts to keep local storage organized across bulk repository downloads.

Can I do a dry run before cloning GitHub repositories?

Yes, you can perform a dry run before cloning GitHub repositories. The extraction script supports an optional dry run feature that simulates the download process, allowing you to verify targets before actually fetching clean source code to your local workdir.

How do I remove cloned repositories from my workdir interactively?

To remove cloned repositories from your workdir interactively, you can use the script's interactive removal feature. It identifies directories marked with the extract_repo tracking file and prompts you for deletion, ensuring only managed repositories are targeted.

Does shallow cloning reduce download size for GitHub repositories?

Yes, shallow cloning significantly reduces download size for GitHub repositories. By fetching only the latest snapshot with depth 1, it skips historical commit data, which is ideal for workflows needing clean source code for experimentation or code review.