view-file

Fetch raw file content from GitHub blob and tree URLs.

42|2|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/robbyt/claude-skills --skill view-file
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: view-file
Source: https://github.com/robbyt/claude-skills/tree/main/plugins/gh-cli/skills/view-file
Command: npx skills add https://github.com/robbyt/claude-skills --skill view-file

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Fetch clean, raw file content from GitHub URLs to avoid HTML clutter.

Core Features & Use Cases

  • URL-to-source: Converts URLs to plain source content.
  • Direct fetch: Retrieves file content without page chrome.
  • Robust fallback: Includes a Python helper for formatting.

Quick Start

python3 scripts/view_github_file.py https://github.com/user/repo/blob/main/path/to/file.go

Frequently Asked Questions about view-file

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

FAQPage Schema
How do I fetch raw file content from a GitHub URL without HTML?

Raw file content from GitHub URLs can be fetched using the gh CLI and the GitHub API. This Skill parses the owner, repo, ref, and path from blob or tree format URLs, then retrieves plain source code directly, avoiding HTML and JavaScript clutter for cleaner access during code review and debugging.

What GitHub URL formats does this tool support?

This tool supports both blob and tree URL formats from GitHub. It parses standard GitHub URLs like github.com/user/repo/blob/branch/path/to/file and converts them to raw content retrieval via the GitHub API.

Do I need anything installed to view files from GitHub URLs?

Yes, the gh CLI must be installed and authenticated to your GitHub account. The Skill includes a Python helper script as a manual fallback if the primary retrieval method fails.

Can I use this for code review and educational purposes?

Yes. Fetching raw GitHub file content is ideal for code review, education, and research tasks. It provides clean source code without page chrome, making it easier to analyze, reference, and share code snippets.

What happens if the GitHub API fetch fails?

The Skill provides a robust fallback mechanism using a Python helper for formatting and retrieving file content. This ensures you can still access raw file content if the primary API path encounters issues.