| Crates.io | gh-docs-download |
| lib.rs | gh-docs-download |
| version | 0.2.0 |
| created_at | 2025-07-27 02:04:33.602404+00 |
| updated_at | 2025-07-27 02:51:44.000473+00 |
| description | Efficient CLI tool for downloading documentation from GitHub repositories using git sparse checkout. Perfect for RAG applications and documentation collection. |
| homepage | https://github.com/sirmews/gh-docs-download |
| repository | https://github.com/sirmews/gh-docs-download |
| max_upload_size | |
| id | 1769657 |
| size | 69,407 |
A CLI tool to download documentation files from specific paths in GitHub repositories using tree URLs. This tool uses git sparse checkout to efficiently download only the documentation files you need from a specific directory path. Files are downloaded with a flattened directory structure, preserving only the filenames.
/tree/main/docs)# Clone and build
git clone <repository-url>
cd gh-docs-download
cargo build --release
# Or install directly
cargo install --path .
# Download docs from a specific path using GitHub tree URL
gh-docs-download --repo "https://github.com/rust-lang/rust/tree/main/src/doc"
# Download from documentation directory
gh-docs-download --repo "https://github.com/TanStack/router/tree/main/docs"
# List files without downloading
gh-docs-download --repo "https://github.com/owner/repo/tree/main/docs" --list-only
# Download to current directory
gh-docs-download --repo "https://github.com/owner/repo/tree/main/docs" --output .
# Specify output directory
gh-docs-download --repo "https://github.com/owner/repo/tree/main/docs" --output ./my-docs
# Download from nested documentation paths
gh-docs-download --repo "https://github.com/TanStack/router/tree/main/docs/router/eslint"
# Control recursion
gh-docs-download --repo "https://github.com/owner/repo/tree/main/docs" --recursive false
# Download Rust documentation from specific path
# All files will be placed directly in rust-docs/ without subdirectories
gh-docs-download --repo "https://github.com/rust-lang/rust/tree/main/src/doc" --output rust-docs
# Preview TanStack Router documentation
gh-docs-download --repo "https://github.com/TanStack/router/tree/main/docs" --list-only
# Download React Native versioned docs to current directory
# Files like website/versioned_docs/version-0.80/view.md become ./view.md
gh-docs-download --repo "https://github.com/facebook/react-native-website/tree/main/website/versioned_docs/version-0.80" --output .
# Download nested documentation structure - all files flattened
gh-docs-download --repo "https://github.com/TanStack/router/tree/main/docs/router/framework/react/guide" --output react-guide-docs
The tool automatically detects documentation files based on:
.md, .markdown.txt.rst.adoc, .asciidoc.org.tex.pdf.html, .htm.xmlOptions:
-r, --repo <REPO> GitHub tree URL (e.g., "https://github.com/owner/repo/tree/branch/path")
-o, --output <OUTPUT> Output directory for downloaded files [default: downloads]
--list-only Only list files without downloading
--recursive <RECURSIVE> Include subdirectories recursively [default: true]
-h, --help Print help
-V, --version Print version
The tool expects GitHub tree URLs in this format:
https://github.com/owner/repo/tree/branch/path
Examples:
https://github.com/rust-lang/rust/tree/main/src/dochttps://github.com/TanStack/router/tree/main/docshttps://github.com/owner/repo/tree/feature-branch/documentation/api# Build the project
make build
# Run tests
make test-unit
make test-doc
# Format code
make format
# Run all checks
make check
# Install locally
make install
MIT License - see LICENSE file for details.