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.
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.
-
Download: Go to the Releases page.
-
Extract: Download the archive for your OS (Linux, macOS, Windows) and extract it.
-
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)
Requires the Rust toolchain.
-
Clone & Build:
git clone https://github.com/Ebrahim-hamdy/GitBook-Forge.git cd GitBook-Forge cargo build --release -
Run: The optimized executable is located at
target/release/gitbook_forge.
The basic command is gitbook_forge <URL> [OPTIONS].
# Download an entire site to a specific directory
gitbook_forge "https://docs.gitbook.com/" -o ./gitbook-docs| 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. |
This project is licensed under the MIT License. See the LICENSE file for details.