Markdown · llms.txt

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

  1. tf auth completes OAuth 2.0 (PKCE) and writes .tokens.json.
  2. tf fetch pulls likes, bookmarks, and the account’s own posts into tweets.db.
  3. A persona file, persona/PERSONA.md, records voice rules. tf onboard can write it, or you edit the template.
  4. tf generate asks your LLM for four ideas, each with two or three variants. The prompt includes measured voice stats, your reply/quote/repost/like rates when tweets.db has enough impressions, and the published For You weights (xai-org/x-algorithm commit cb45b55). drafts/YYYY-MM-DD.md shows a per-head breakdown and a 0–100 score, and tells you to post one variant.
  5. tf refresh refreshes the database and writes what’s new to flush/pending.md. It does not call an LLM. tf update is 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.

Start here

Files that matter

PathRole
tweets.dbLikes, bookmarks, your posts, article text, tagged Notion pages
persona/PERSONA.mdVoice source of truth. Gitignored once filled in
flush/pending.mdNew interactions since the last flush commit
drafts/YYYY-MM-DD.mdScored drafts
onboarding.jsonStructured bundle from the last tf generate
.envAPI keys. Mode should be 0600
.tokens.jsonOAuth tokens. Written mode 0600
.cloud.jsonOptional cloud-sync device token. Written mode 0600 by tf login. Absent until you link
X_ALGORITHM_BOOST_PLAYBOOK.mdHuman-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.