Skip to content

A blazing-fast, resilient GitBook downloader forged in Rust. Render, archive, and convert any GitBook site to local Markdown with high fidelity.

License

Notifications You must be signed in to change notification settings

Ebrahim-hamdy/GitBook-Forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitBook-Forge

CI/CD Release

A high-performance CLI forged in Rust to convert any GitBook site into clean, AI-ready Markdown.

It discovers all pages from a site's table of contents, renders them with a real browser, and saves each page as a separate .md file—creating a perfect corpus for your RAG pipelines and LLM fine-tuning.


Key Features

GitBook-Forge is built for AI developers who need to ingest documentation into RAG pipelines or for model training.

  • AI-Ready Markdown: Intelligently converts complex elements like tables and code blocks into clean Markdown while skipping non-textual assets like images and videos.
  • Blazing Fast: Built in Rust with a concurrent architecture to download and process pages in parallel.
  • Handles Private Sites: Natively supports authentication for private GitBooks.
  • Zero Dependencies: Ships as a single, self-contained executable with no need for Node.js or Python.

Getting Started

Method 1: Download a Pre-compiled Binary

  1. Download: Go to the Releases page.

  2. Extract: Download the archive for your OS (Linux, macOS, Windows) and extract it.

  3. Run: The archive contains a single executable. Run it from your terminal.

    (On Linux/macOS, you may need to make it executable: chmod +x ./gitbook_forge)

Method 2: Build from Source

Requires the Rust toolchain.

  1. Clone & Build:

    git clone https://github.com/Ebrahim-hamdy/GitBook-Forge.git
    cd GitBook-Forge
    cargo build --release
  2. Run: The optimized executable is located at target/release/gitbook_forge.


Usage

The basic command is gitbook_forge <URL> [OPTIONS].

Quick Example

# Download an entire site to a specific directory
gitbook_forge "https://docs.gitbook.com/" -o ./gitbook-docs

Command Reference

Flag (Short/Long) Argument Description Default
(none) <URL> The root URL of the GitBook site to download. (Required)
-o, --output <PATH> The directory to save the Markdown files. ./output
-s, --single-page (none) Download only the single page specified by the URL. false
--no-images (none) Skip downloading all image assets. false
--auth (none) Enable authentication for private sites. false
-u, --username <EMAIL> Username (email) for authentication. none
-p, --password <PASSWORD> Password for authentication (prompted if omitted). none
--help (none) Show detailed help information.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A blazing-fast, resilient GitBook downloader forged in Rust. Render, archive, and convert any GitBook site to local Markdown with high fidelity.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages