<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tooling on Home</title><link>/tags/tooling/</link><description>Recent content in Tooling on Home</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 13 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="/tags/tooling/" rel="self" type="application/rss+xml"/><item><title>Mirroring Red Hat Documentation Locally with rh-mastery</title><link>/2026/mirroring-red-hat-documentation-locally-with-rh-mastery/</link><pubDate>Sat, 13 Jun 2026 00:00:00 +0000</pubDate><guid>/2026/mirroring-red-hat-documentation-locally-with-rh-mastery/</guid><description>&lt;figure&gt;&lt;img src="/images/posts/post_22/overview.png"data-src="/images/posts/post_22/overview.png"
/&gt;&lt;figcaption&gt;
&lt;h4&gt;Workflow diagram of rh-mastery process - AI generated&lt;/h4&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this post, I want to describe a tool built by my team mate &lt;strong&gt;Francisco J. Lopez Grüber&lt;/strong&gt; that solves a problem most people quietly live with: Red Hat product documentation is comprehensive and well-maintained, but it lives on the internet. Accessing it requires a browser, a connection, and knowing where to look. For offline environments, air-gapped labs, or anything beyond casual browsing, that dependency quickly becomes friction.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;rh-mastery&lt;/em&gt; addresses this directly. It mirrors &lt;em&gt;Red Hat&lt;/em&gt; product documentation from &lt;a href="https://docs.redhat.com"&gt;docs.redhat.com&lt;/a&gt; as PDF files into a local directory tree, and optionally can convert those PDFs to Markdown. The Markdown output is where things get particularly interesting: combined with tools like &lt;a href="https://github.com/tobi/qmd"&gt;qmd&lt;/a&gt; from Shopify CEO &lt;a href="https://github.com/tobi"&gt;Tobias Lütke&lt;/a&gt;, the converted documentation becomes a local knowledge base that AI agents can query directly — no internet access required, no context switching, and no copy-pasting from browser tabs. For anyone building AI-assisted developer workflows, having structured access to accurate, version-tracked product documentation is a meaningful step up.&lt;/p&gt;
&lt;p&gt;The tool is available on GitHub at &lt;a href="https://github.com/flg-redhat/rh_mastery"&gt;flg-redhat/rh_mastery&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-rh-mastery-does"&gt;What rh-mastery Does&lt;/h2&gt;
&lt;p&gt;At its core, rh-mastery handles two tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sync:&lt;/strong&gt; For a given product alias or slug, it probes docs.redhat.com, resolves the current documentation version, and downloads all available PDFs into a structured local directory tree: &lt;code&gt;{download_base}/{slug}/{version}/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert:&lt;/strong&gt; Once PDFs are present, the &lt;code&gt;convert&lt;/code&gt; command transforms them into Markdown files using &lt;em&gt;PyMuPDF4LLM&lt;/em&gt; (default) or &lt;em&gt;Docling&lt;/em&gt; as an optional heavier-weight alternative. Each Markdown file includes a short YAML front matter block with provenance metadata — title, source, version, and conversion timestamp.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Individual products can be targeted using short aliases such as &lt;code&gt;--ocp&lt;/code&gt; or &lt;code&gt;--ansible&lt;/code&gt;, or by passing the full Red Hat documentation slug directly. To download the complete documentation for all tracked products at once, &lt;code&gt;rh-mastery sync --all&lt;/code&gt; handles that in a single invocation.&lt;/p&gt;
&lt;p&gt;The recommended way to run rh-mastery is via its container image, which keeps dependencies isolated and makes the workflow reproducible.&lt;/p&gt;
&lt;h2 id="setting-up-the-environment"&gt;Setting Up the Environment&lt;/h2&gt;
&lt;p&gt;The image is built from &lt;em&gt;Red Hat Universal Base Image 10 Init&lt;/em&gt; and includes systemd, allowing for optional scheduled syncs via timers or cron inside the container. Build it from the repository root:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/flg-redhat/rh_mastery
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; rh_mastery
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;podman build -f Containerfile -t rh-mastery:latest .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create a local &lt;code&gt;data/&lt;/code&gt; directory to hold the downloaded files. This directory will be mounted into the container, so its contents persist across container restarts and recreations.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p data
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="the-workflow"&gt;The Workflow&lt;/h2&gt;
&lt;p&gt;The end-to-end workflow from a fresh image to a set of Markdown files ready for distribution follows five steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start the container&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;podman run -d --name rh-mastery &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --systemd&lt;span class="o"&gt;=&lt;/span&gt;always --rm &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -v ./data:/var/lib/rh-mastery:Z &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rh-mastery:latest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This starts the container in detached mode and mounts the local &lt;code&gt;data/&lt;/code&gt; directory into &lt;code&gt;/var/lib/rh-mastery&lt;/code&gt; inside the container. All downloads and converted files will appear under &lt;code&gt;data/&lt;/code&gt; on the host.&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Open an interactive shell&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;podman &lt;span class="nb"&gt;exec&lt;/span&gt; -it rh-mastery bash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="3"&gt;
&lt;li&gt;Sync the documentation&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rh-mastery sync --all
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This downloads the current documentation for all tracked products into the mounted volume. Individual products can be synced using their alias, for example &lt;code&gt;rh-mastery sync --ocp&lt;/code&gt; or &lt;code&gt;rh-mastery sync --ansible&lt;/code&gt;. Run &lt;code&gt;rh-mastery --help&lt;/code&gt; inside the container to see the full alias table.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Convert PDFs to Markdown&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rh-mastery convert --all
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This converts every synced PDF into a Markdown file alongside it. Both the original PDFs and the converted Markdown files are present after this step. The conversion uses PyMuPDF4LLM by default, which handles most layouts well. For documents with complex tables or multi-column layouts, the &lt;code&gt;--engine docling&lt;/code&gt; option is available but requires installing additional dependencies.&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;Exit the container and clean up PDFs (optional step)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once conversion is complete, exit the container shell. Depending on the use case, the original PDF files may no longer be needed, if Markdown is the target format, removing the PDFs reduces the total size of the data directory significantly:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find ./data/RHDocumentation -name &lt;span class="s2"&gt;&amp;#34;*.pdf&amp;#34;&lt;/span&gt; -delete
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Markdown files in &lt;code&gt;data/RHDocumentation&lt;/code&gt; are now ready for local use, distribution, or ingestion by an AI agent.&lt;/p&gt;
&lt;h2 id="from-markdown-to-ai-agent-knowledge"&gt;From Markdown to AI Agent Knowledge&lt;/h2&gt;
&lt;p&gt;The Markdown output from rh-mastery is structured and annotated, which makes it well-suited for ingestion by AI agents and local language model tooling. Each file carries front matter metadata that allows agents to identify the product, version, and source, and the content retains the section hierarchy of the original documentation.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/tobi/qmd"&gt;qmd&lt;/a&gt;, built by Tobias Lütke, is a lightweight tool for querying local Markdown files. Pointed at the directory tree produced by rh-mastery, it gives AI agents fast, accurate access to the full Red Hat documentation corpus, entirely offline and without relying on external APIs or web retrieval. The combination is particularly effective in environments where internet access is restricted, or when a development workflow benefits from a self-contained, version-locked knowledge source.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;rh-mastery turns what would otherwise be an ongoing manual effort into a single repeatable command. The container image keeps the setup clean, and the Markdown output opens up practical AI-assisted use cases that go beyond what a standard documentation browser can offer. Francisco&amp;rsquo;s tool fills a gap that is easy to overlook until you actually need it.&lt;/p&gt;
&lt;h2 id="references"&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;rh-mastery - GitHub repository by Francisco J. Lopez Grüber - &lt;a href="https://github.com/flg-redhat/rh_mastery"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;qmd - GitHub repository by Tobias Lütke - &lt;a href="https://github.com/tobi/qmd"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Red Hat product documentation - &lt;a href="https://docs.redhat.com"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>