A CLI tool that turns tweets from a Twitter archive into standalone, self-contained HTML documents — no JavaScript, no external requests, no tracking. Just a single HTML file you can embed anywhere.
Images, GIFs, and videos are base64-encoded directly into the HTML, so each file works completely offline. Works directly with the archive zip file — no need to extract first.
Use tweetembed directly in your browser at duggan.github.io/tweetembed — no install required. Drop your archive zip, enter a tweet ID, and render it in-page. Works offline; nothing is uploaded.
brew install duggan/tap/tweetembedDownload the latest binary for your platform from the releases page.
Requires Go 1.21+. No external dependencies.
go install github.com/duggan/tweetembed@latestOr clone and build:
git clone https://github.com/duggan/tweetembed.git
cd tweetembed
go build -o tweetembed .tweetembed [flags] <tweet-id-or-url>
The input can be any of:
- A tweet ID:
656428954958626816 - A Twitter/X URL:
https://twitter.com/duggan/status/656428954958626816 - A Nitter URL:
https://xcancel.com/duggan/status/656428954958626816
# Output to stdout
tweetembed 656428954958626816
# Save to a file
tweetembed -o tweet.html 656428954958626816
# Dark theme
tweetembed -theme dark -o tweet.html 656428954958626816
# Use the X logo instead of the classic bird
tweetembed -logo x -o tweet.html 656428954958626816
# From a URL (any Twitter, X, or Nitter URL works)
tweetembed -o tweet.html https://xcancel.com/duggan/status/656428954958626816
# Use a zip archive directly
tweetembed -archive twitter-archive.zip -o tweet.html 656428954958626816| Flag | Default | Description |
|---|---|---|
-archive |
auto-detect | Path to the Twitter archive directory or zip file |
-o |
stdout | Output file |
-theme |
light |
light or dark |
-logo |
bird |
bird (classic) or x |
-version |
Print version and exit |
This tool reads from a Twitter data archive. It works with both extracted archive directories and the original zip file — no need to unzip.
- Run
tweetembedfrom the directory containing the archive (it auto-detectstwitter-*folders andtwitter-*.zipfiles), or - Point to it explicitly with
-archive /path/to/twitter-2019-11-20-abc123/or-archive /path/to/twitter-archive.zip
- Author name, avatar, and @username
- Tweet text with linked @mentions, #hashtags, and URLs
- Embedded photos, animated GIFs (autoplay), and videos
- Reply indicators
- Like and retweet counts
- Timestamp linking back to the original tweet
Releases are built with GoReleaser. To create a release:
git tag v0.1.0
git push origin v0.1.0
goreleaser release --cleanMIT