fetch-github-file

Fetch source code from GitHub URLs using the gh CLI.

19|4|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/wunki/amplify --skill fetch-github-file
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fetch-github-file
Source: https://github.com/wunki/amplify/tree/main/skills/fetch-github-file
Command: npx skills add https://github.com/wunki/amplify --skill fetch-github-file

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of retrieving source code directly from GitHub repositories, eliminating the need for manual cloning or copy-pasting.

Core Features & Use Cases

  • Fetch File Contents: Retrieve the content of specific files, including support for line ranges.
  • List Directory Contents: Browse and view the files within a specified directory in a repository.
  • Clone Repositories: Perform full repository clones for deeper exploration when necessary.
  • Use Case: When discussing a bug in a specific function, you can paste a GitHub URL, and the Skill will fetch and display the relevant code snippet directly in the chat.

Quick Start

Fetch the code from the GitHub URL https://github.com/owner/repo/blob/main/src/file.ex.

Frequently Asked Questions about fetch-github-file

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

FAQPage Schema
How do I fetch file contents directly from a GitHub URL without cloning?

To fetch file contents from a GitHub URL, simply share the link in your chat. The Skill automatically triggers on GitHub URLs, using the gh CLI to retrieve and display the specific source code instantly.

Can I retrieve a specific line range from a file in a GitHub repository?

Yes, you can retrieve a specific line range from a GitHub repository file. The Skill supports fetching partial file contents, allowing you to target and extract only the exact code snippet you need for your discussion.

Does fetching GitHub code require the gh CLI to be installed?

Fetching GitHub code requires the gh CLI because the Skill relies on it for authenticated access. This ensures secure retrieval of source code, directory listings, and line ranges from private and public repositories.

What is the best way to browse directory contents in a GitHub repository?

The best way to browse directory contents in a GitHub repository is by sharing the directory URL. The Skill will list and view the files within that specified directory, eliminating the need for manual cloning.

Can I perform a full repository clone for deeper code exploration?

You can perform a full repository clone for deeper code exploration. When discussing complex bugs or features, the Skill supports full clones alongside fetching specific file contents and directory listings.

Why does fetching source code from a GitHub URL fail silently?

Fetching source code from a GitHub URL may fail if the gh CLI is not installed or authenticated. The Skill is designed to parse URLs and handle these errors gracefully, preventing silent failures during code retrieval.