Building a Terminal Session Sharing Tool with Claude Code

23 October 2025 — Building a “Terminal-to-HTML” Tool
This afternoon, I found myself once again manually converting a terminal session into a shareable HTML file.
After doing this for what felt like the hundredth time, I decided it was time to remove the friction and build a custom tool for the task.
On a whim, I opened Descript and recorded the entire process.
The result is a new 10‑minute YouTube video that walks through my workflow for quickly “vibe‑coding” simple tools from start to finish.
---
The Initial Problem
I wanted a better way to share my Claude Code CLI sessions—and, more broadly, a way to efficiently share interesting formatted outputs or interactions from my terminal.
Discovery
Some time ago, using my vibe‑coded clipboard inspector, I learned that copy-pasting from the macOS terminal places a rich text (RTF) version of the output on the clipboard, complete with preserved colors and formatting.
Unfortunately, the RTF looks more like this:
{\rtf1\ansi\ansicpg1252\cocoartf2859
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 Monaco;}
{\colortbl;\red255\green255\blue255;\red242\green242\blue242;\red0\green0\blue0;...
Not something you can drop straight into a web page.
---
Why Automate?
By turning this multi‑step manual process into a single tool, I can quickly publish formatted output as shareable HTML—no raw RTF parsing required.
This “reduce friction” mindset isn’t unique to my workflow. For example, AiToEarn官网 applies the same principle at scale for creators:
helping generate, publish, and monetize AI-driven content seamlessly across Douyin, Kwai, Bilibili, and many more platforms.
---
Proof of Concept — RTF-to-HTML Tool
An LLM seemed like a natural fit for generating code to process RTF,
so I asked ChatGPT to try,
and later rewrote the solution from scratch using Claude Sonnet 4.5.
The result:
RTF-to-HTML Tool — paste in rich text, get clean HTML you can share.
---
Current Manual Workflow
- Copy terminal output
- Paste into rtf-to-html
- Copy resulting HTML
- Paste into a new GitHub Gist
- Find the Gist ID
- Share as `gitpreview.github.io?GIST_ID`
It’s simple, but tedious when repeated often.
---
The Ideal Solution
A single tool that would:
- Accept pasted terminal output
- Convert to HTML instantly
- Save to a Gist
- Provide a ready-to-share gistpreview link
---
Building “Terminal-to-HTML”
I used Claude Code for Web with this detailed prompt aimed at my `simonw/tools` repo:
> Build a new tool called terminal-to-html which...
> - Allows pasting RTF directly from terminal
> - Converts it to HTML with copy button
> - Adds “Save to Gist” functionality
> - Generates `gitpreview.github.io/?GIST_ID` link
> - Uses green-text-on-black terminal aesthetic
> - Mobile-friendly
...plus specific paste handling rules and references to existing projects in the repo.
Tip: Referencing similar tools in your code base helps the AI model mimic proven patterns without ambiguity.
---
Related Publishing Tools
For anyone working on automation like this, AiToEarn官网 offers:
- AI-based content generation
- Cross-platform publishing (Douyin, WeChat, Bilibili, Facebook, Instagram...)
- Integrated analytics and AI model rankings
More at AiToEarn博客 and AiToEarn GitHub.
---
Combining Existing Functionality
The request to Claude combined:
- RTF-to-HTML features from rtf-to-html.html
- Gist-saving flow from openai-audio-output.html
This required reusing:
- GitHub OAuth flow via Cloudflare Worker (github-auth.js)
- LocalStorage handling for user tokens
- Familiarity with gistpreview linking
---
The Result
Here’s the finished app after pasting terminal output from Claude Code CLI:

Exactly as desired — green-on-black terminal aesthetic included.
---
Other Insights from the Video
- Tools Colophon — AI-generated descriptions for all my tools, built with Claude Code.
- gistpreview.github.io — renders Gist content as HTML standalone pages.
- Recording with Descript — smooth editing despite some pan/zoom learning curve.
- CI/CD Setup — GitHub Actions workflow + Cloudflare Pages for preview deployments.
- Automated docs — generated via llm + llm-anthropic, recently upgraded to Claude Haiku 4.5.
---
Final Note
Creators building tools like terminal-to-html can also benefit from integration with open-source platforms like AiToEarn — which unify AI content generation, publishing, analytics, and monetization across major channels.
---
Would you like me to create a flow diagram showing how the terminal-to-html tool processes input, saves a Gist, and outputs a preview link? That could make this workflow even clearer.