# Install

Generation uses the Claude Code CLI by default, or an API key if you set one. The X app is covered in [X app setup](x-app.md).

The GitHub repository is private. The release binary is the install path for users. Source stays in the private repo.

## Fast path

```bash
curl -fsSL https://tweetfactory.sh/install.sh | sh
mkdir -p ~/tweet-factory && cd ~/tweet-factory
tf auth
```

`bun run sites:build` copies `install.sh` to the landing site as `/install.sh`. The script reads [the current tag](https://tweetfactory.sh/download/latest/VERSION), then downloads `tf-darwin-arm64`, `tf-darwin-x64`, `tf-linux-x64`, or `tf-linux-arm64` and `SHA256SUMS` from `https://tweetfactory.sh/download/vX.Y.Z/`. Those URLs redirect to a public Blob store. GitHub Release assets are not the download. Set `TF_INSTALL_DIR` to put `tf` somewhere else. Set `TF_VERSION=v0.3.0` to pin a tag.

`tf auth` writes `.env.example` when that file is not already in the directory. Copy it to `.env`, fill in the two X OAuth keys, `chmod 600 .env`, and run `tf auth` again. Then `tf fetch`.

Later, from that binary:

```bash
tf update --check
tf update
```

`tf update` compares `tf version` with the tag in `latest/VERSION`. When a newer tag is published, it downloads the matching binary, checks `SHA256SUMS`, and replaces the executable. `--check` only prints the comparison. A checkout run with `bun run src/index.ts update` refuses; pull the repo, or install the binary above.

> **Verify.** `tf --help` prints `tweet-factory (tf)` and exits 0. `command -v tf` prints the install path.

## Release assets

Built on native runners (OpenTUI’s native addon is not cross-compiled):

| Asset | Machine |
|---|---|
| `tf-darwin-arm64` | macOS Apple silicon |
| `tf-darwin-x64` | macOS Intel |
| `tf-linux-x64` | Linux x64 |
| `tf-linux-arm64` | Linux arm64 |
| `SHA256SUMS` | checksums for the four binaries |

Windows builds are not published. Check a manual download with `sha256sum -c SHA256SUMS` (macOS: `shasum -a 256 -c SHA256SUMS`).

The binary looks upward from the working directory for `tweets.db`, `.env`, or `package.json`, then falls back to the current directory. Pass `--dir` to point at a specific root.

Scoring is compiled into the binary. You do not need `X_ALGORITHM_BOOST_PLAYBOOK.md` on disk for `tf generate` to score drafts.

> **Verify.** `tf --help` lists `auth`, `fetch`, `onboard`, `generate`, `notion`, `enrich`, `flush`, `search`, `notify`, `refresh`, `update`, `cron`, and `analyze`.

## Checkout you already have

`./setup_x.sh` still installs Bun, runs `bun install`, compiles `./tf`, runs `tf auth`, then `tf fetch` and a baseline `tf flush`. Leave a working checkout in place. The installer is for machines that do not have the repo.

```bash
./setup_x.sh
```

Agents that already wrote `.env` should run `NONINTERACTIVE=1 ./setup_x.sh` so the script does not block on prompts. The browser authorize step still needs a person.

A read-only preview that changes nothing:

```bash
./setup_x.sh --check
```

Contributors run the TypeScript directly:

```bash
bun run src/index.ts --help
```

> **Verify.** `./tf --help` prints the command list. `./setup_x.sh --check` exits 0.
