Overview
tweet-factory is a local Bun + TypeScript CLI, tf. It learns from one X account’s likes, bookmarks, and posts, stores them in SQLite, and drafts new tweets in that person’s voice with their own LLM.
The project directory is the product. Local files are the default. Optional cloud sync (tf login, then tf sync push) copies that directory to a tweetfactory.sh account. Nothing is uploaded until you push.
What a run actually does
tf authcompletes OAuth 2.0 (PKCE) and writes.tokens.json.tf fetchpulls likes, bookmarks, and the account’s own posts intotweets.db.- A persona file,
persona/PERSONA.md, records voice rules.tf onboardcan write it, or you edit the template. tf generateasks your LLM for four ideas, each with two or three variants. The prompt includes measured voice stats, your reply/quote/repost/like rates whentweets.dbhas enough impressions, and the published For You weights (xai-org/x-algorithmcommitcb45b55).drafts/YYYY-MM-DD.mdshows a per-head breakdown and a 0–100 score, and tells you to post one variant.tf refreshrefreshes the database and writes what’s new toflush/pending.md. It does not call an LLM.tf updateis separate: it replaces a release binary.
You publish the drafts yourself. tf never posts to X.
How the For You ranker is described here
These pages quote X_ALGORITHM_BOOST_PLAYBOOK.md, which was checked against xai-org/x-algorithm commit cb45b55 (2026-10-09). They do not add engagement statistics that file does not contain.
- How the X (Twitter) algorithm works
- X algorithm changes in 2026
- How to grow on X
- Best time to post on X
- Myths: links, hashtags, bookmarks, Premium
- Shadowban on X: what the code filters
- Tweet reply generator
- How to reset your X algorithm
- How tweet-factory scores drafts
- What is TweepCred
- Twitter algorithm on GitHub
- Tweet generator in your voice
- Using tweet-factory with Claude Code
- Compared with Typefully, Tweet Hunter, and Hypefury
- Typefully alternative
- Tweet Hunter alternative
- Hypefury alternative
Start here
- A person installing it: Install, then X app setup.
- A coding agent installing it for someone: copy-paste prompt, then the runbook.
- Machine-readable index: /llms.txt. Full text of every page: /llms-full.txt. Each HTML page also has a markdown twin (
/install.md, and/install/index.md).
Files that matter
| Path | Role |
|---|---|
tweets.db | Likes, bookmarks, your posts, article text, tagged Notion pages |
persona/PERSONA.md | Voice source of truth. Gitignored once filled in |
flush/pending.md | New interactions since the last flush commit |
drafts/YYYY-MM-DD.md | Scored drafts |
onboarding.json | Structured bundle from the last tf generate |
.env | API keys. Mode should be 0600 |
.tokens.json | OAuth tokens. Written mode 0600 |
.cloud.json | Optional cloud-sync device token. Written mode 0600 by tf login. Absent until you link |
X_ALGORITHM_BOOST_PLAYBOOK.md | Human-readable ranker write-up. Scoring uses src/rank/weights.ts |
Install the release binary with the command on Install: curl -fsSL https://tweetfactory.sh/install.sh | sh. The site build serves that script. It downloads tf-darwin-arm64, tf-darwin-x64, tf-linux-x64, or tf-linux-arm64 from https://tweetfactory.sh/download/vX.Y.Z/ and checks SHA256SUMS. The current tag is https://tweetfactory.sh/download/latest/VERSION. The repository is private. All rights reserved.