# Install Herald: runbook for coding agents

You are a coding agent with shell access, and the user asked you to install Herald on this
machine. Herald is a self-hosted daily news briefing: a job that runs once a day, reads news
sources, has an AI model choose and write the stories, and delivers one short page to the
user's channels. Follow the steps in order. Reference docs: https://herald.day/docs/ (each
guide is also served as Markdown at its address plus `.md`, such as
https://herald.day/docs/channels.md: read that one rather than the HTML page).

Work from the raw text of this file. If a web tool gave you a summary, fetch it again with
`curl -fsSL https://herald.day/install.md`: the commands must be run exactly as written.

## Rules

- **The user's language.** Talk to the user in the language they write in. If their only
  message was the English install prompt, take the language from the system locale
  (`echo "${LC_ALL:-${LANG:-}}"`) and offer to switch. When that prints nothing, `C` or `POSIX`
  (usual on servers), write in English and offer to switch. Commands, file names and config keys
  stay as they are.
- **One question at a time**, each with a recommended default the user can accept with "ok".
- **Secrets never pass through you.** Never ask for API keys, tokens, passwords or webhook URLs
  in the chat. Never print, `cat`, `source` or open `.env`, and never show its lines. The user
  types secrets into `.env` in their own editor. To check a key, count it:
  `grep -c '^ANTHROPIC_API_KEY=.' .env` prints `1` when it has a value and `0` when it is empty.
- **Ask before anything that costs, sends or deletes.** Steps marked **(OK required)** spend
  model tokens, deliver real messages or delete data. Run them only after the user says yes to
  that step.
- **Exact commands.** Run them as written, from the Herald folder, `~/herald` (start with
  `cd ~/herald` if your shell does not keep the directory). Replace only what a step says to
  replace: the provider, categories, languages, channels, time zone, schedule or folder.
- **Ask, don't escalate.** Don't use `sudo` or install system packages yourself; tell the user
  what to run.
- **Exit code 1 can be the expected answer.** `grep -c` prints `0` and exits 1 when a key is
  empty, `command -v` exits 1 when it finds nothing, and `crontab -l` exits 1 with
  `no crontab for <user>`. Read the output, not only the exit code.
- Linux and macOS are supported; on Windows, run everything inside WSL 2.

## 1. Check the machine

These commands only read. Note the results and don't ask anything yet.

```bash
uname -s
id -u
docker version --format '{{.Server.Version}}'
uv --version
git --version
command -v claude codex ollama gh
readlink /etc/localtime
```

- `docker version` printing a version means Docker works. "permission denied" means the user
  is not in the `docker` group; "command not found" or "Cannot connect" means Docker is missing
  or not running.
- `readlink /etc/localtime` ends with the machine's time zone, such as `America/Sao_Paulo`.
  Keep it for step 6. Servers usually run in UTC (`Etc/UTC`, `UTC`, `Etc/GMT`), which is rarely
  the user's zone.
- If `~/herald` already exists, ask before touching it: it may be an install to update
  ([Updating](#updating)).

## 2. Ask: the briefing language

Herald writes the briefing in `pt-BR` (Brazilian Portuguese), `en`, `es`, `fr`, `it` or `de`.
Recommend the user's language when it is one of these, otherwise `en`. They may pick several;
each extra language adds writing cost. Remember the list; the first one is the primary language.

## 3. Ask: the AI provider

| Provider | What the user needs | Install path |
|---|---|---|
| `anthropic` (recommended) | An Anthropic API key. Defaults to `claude-haiku-5-5` and `claude-opus-5-5`; a run usually costs well under US$ 1 | Docker or uv |
| `openai`, `openrouter`, `opencode`, `gemini` | That provider's API key and the two model ids to use | Docker or uv |
| `claude-code` | A Claude subscription, with the `claude` CLI signed in on this machine | uv |
| `codex` | A ChatGPT subscription, with the `codex` CLI signed in on this machine | uv |
| `ollama` | A local Ollama server with the models pulled (`ollama list`) | uv |
| `none` | Nothing: a free briefing from the feed text, no AI. Stories keep their source's language and wording (headline and lede, untranslated): good for a first look, not what the AI briefing reads like | Docker or uv |

- **No key yet.** If the user wants an AI provider but will add its key later, choose that
  provider anyway: step 7 runs on `none` until the key exists and gives the command to switch
  back. Choose `none` here only for a user who wants no AI at all.
- If the user has no API key but `claude` or `codex` was found in step 1, offer their
  subscription. It is for personal use: a briefing sent to other people should use an API key.
  Details: https://herald.day/docs/providers/
- `claude-code` and `codex` are not in the Docker image, and a container cannot reach a local
  Ollama server, so these three use the uv path.
- The others use Docker when step 1 found it working. Without Docker, use the uv path: it
  needs `git`, and uv downloads Python 3.12 itself. If `uv` is missing too, recommend installing
  it for this user only (no `sudo`, into `~/.local/bin`) and run this once they say yes; the user
  may prefer to install Docker (https://docs.docker.com/get-docker/) instead:

  ```bash
  curl -LsSf https://astral.sh/uv/install.sh | sh
  ```

  Its `PATH` change reaches only new shells, so in step 4b write `~/.local/bin/uv` wherever a
  command says `uv`.

## 4. Set up the folder

Follow 4a or 4b, then check the launcher in 4c. The launcher, `~/herald/herald`, runs Herald with
this folder's `config.json`, `.env` and `data/`. Every later step calls it as `./herald`, and so do
the commands Herald suggests (`HERALD_COMMAND` in the launcher).

### 4a. Docker

```bash
mkdir -p ~/herald/data
cd ~/herald
docker pull ghcr.io/felipebossolani/herald:beta
docker run --rm --entrypoint cat ghcr.io/felipebossolani/herald:beta /app/config.example.json > config.json
docker run --rm --entrypoint cat ghcr.io/felipebossolani/herald:beta /app/.env.example > .env
chmod 600 .env
```

```bash
cat > herald <<'EOF'
#!/bin/sh
# Runs Herald from the Docker image with this folder's config.json, .env and data/.
cd "$(dirname "$0")" || exit 1
export PATH="$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH"
exec docker run --rm --user "$(id -u):$(id -g)" -e HERALD_AI_PROVIDER -e HERALD_COMMAND=./herald \
  -v "$PWD/config.json:/app/config.json" -v "$PWD/.env:/app/.env" -v "$PWD/data:/app/data" \
  ghcr.io/felipebossolani/herald:beta "$@"
EOF
chmod +x herald
```

The container runs as the user (`--user`), so it can write `config.json`, `.env` and `data/`.

### 4b. uv

```bash
git clone https://github.com/felipebossolani/herald ~/herald
cd ~/herald
git checkout "$(git tag --list 'v*-beta' --sort=-v:refname | head -n 1)"
uv sync --no-dev --extra embed
cp config.example.json config.json
cp .env.example .env
chmod 600 .env
```

The checkout picks the latest beta release, the version the Docker image `:beta` has (`main` may
hold unreleased work); git's "detached HEAD" note is expected.

```bash
cat > herald <<'EOF'
#!/bin/sh
# Runs Herald from this clone with uv.
cd "$(dirname "$0")" || exit 1
export PATH="$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH"
export HERALD_COMMAND=./herald
if [ -r "$HOME/.config/herald/claude-token" ]; then
  CLAUDE_CODE_OAUTH_TOKEN=$(cat "$HOME/.config/herald/claude-token")
  export CLAUDE_CODE_OAUTH_TOKEN
fi
exec uv run --no-sync herald "$@"
EOF
chmod +x herald
```

If `command -v claude`, `codex` or `uv` printed a folder that is not in the launcher's `PATH`
line, add it there, so scheduled runs find it. The token file is only for `claude-code`
(step 7).

### 4c. Check

```bash
./herald --version
```

It prints `herald` and a version. The first Docker call can take a minute.

## 5. Ask: the categories, then run init

A category is a topic in a region. The quickest answer is a group: `br` (Brazil), `latam`, `us`,
`eu`, `apac`, `oceania`, `mea` (Middle East and Africa), `ca` (Canada), `global` (tech and AI,
fintech and crypto, macro), `topics` (science, health, climate and energy, culture, startups),
`sports`, or `all`. Recommend the user's region plus `global`, such as `br global` or
`us global`; fewer categories make a faster, cheaper run. The groups `br`, `latam`, `us`, `eu`
and `oceania` include that region's sports category (such as `br-sports`): say so, and if the
user doesn't want it, remove it after init with `./herald categories remove br-sports`. For the
full list of 40, with names in the primary language (`pt-BR`, `en`, `es`, `fr`, `it` or `de`):

```bash
./herald categories list --lang en
```

Groups, ids and list numbers can be mixed. Then save the provider and the categories:

```bash
./herald init --provider anthropic --categories br global
```

Replace `anthropic` with the chosen provider and `br global` with the chosen categories. It sets
`HERALD_AI_PROVIDER` in `.env` and `profiles.enabled` in `config.json`, and prints the categories
and how many sources the run will fetch.

## 6. Ask: the channels, then save the settings

Where should the briefing arrive? Several channels are fine. Recommend Telegram: free, set up in
five minutes, and it gets the whole briefing. "None for now" is fine too: every briefing is
also saved in `data/briefings/`.

| Channel | `.env` keys the user fills | Other `config.json` fields (ask; not secret) | Setup guide |
|---|---|---|---|
| `telegram` | `TELEGRAM_BOT_TOKEN`, `TELEGRAM_CHAT_ID` | | https://herald.day/docs/channels/#telegram-in-five-minutes |
| `slack` | `SLACK_WEBHOOK_URL` | | https://herald.day/docs/channels/#slack-and-discord |
| `discord` | `DISCORD_WEBHOOK_URL` | | https://herald.day/docs/channels/#slack-and-discord |
| `teams` | `TEAMS_WEBHOOK_URL` | | https://herald.day/docs/channels/#microsoft-teams-workflows-webhook |
| `google_chat` | `GOOGLE_CHAT_WEBHOOK_URL` | | https://herald.day/docs/channels/#google-chat-space-webhook |
| `matrix` | `MATRIX_TOKEN` | `homeserver`, `room_id` | https://herald.day/docs/channels/#matrix |
| `ntfy` | `NTFY_TOPIC` (and `NTFY_TOKEN` for a server with login) | `server` | https://herald.day/docs/channels/#phone-push-ntfy-and-pushover |
| `pushover` | `PUSHOVER_TOKEN`, `PUSHOVER_USER` | | https://herald.day/docs/channels/#phone-push-ntfy-and-pushover |
| `webhook` | `HERALD_WEBHOOK_URL`, `HERALD_WEBHOOK_SECRET` | | https://herald.day/docs/channels/#webhook-for-agents |
| `whatsapp` | `WHATSAPP_TOKEN`, `WHATSAPP_PHONE_NUMBER_ID` | `recipients`, `template` | https://herald.day/docs/channels/#whatsapp-official-cloud-api |
| `email` | `SMTP_FROM`; `SMTP_HOST`, plus `SMTP_USER` and `SMTP_PASSWORD` if the server needs a login, or `RESEND_API_KEY`; optional `HERALD_UNSUBSCRIBE_URL` | `transport`, `smtp_port`, `starttls`, `ssl` | https://herald.day/docs/channels/#email-subscribers |

WhatsApp needs a Meta business account and an approved template. Email needs an SMTP server (or a
Resend account) that accepts the sender address; mailing other people also needs the user's own
domain and an unsubscribe endpoint. Say so before the user picks them.

Then ask the briefing's time zone: it dates the briefing and sets the delivery time. Recommend
the machine's zone from step 1 only when it is not UTC; otherwise ask where the user lives and
use that zone's IANA name, such as `America/Sao_Paulo` or `Europe/Lisbon`.

Save the languages from step 2, the channels and the time zone:

```bash
./herald config set languages en
./herald config set channels telegram
./herald config set timezone America/Sao_Paulo
```

Replace `en` with the languages, the primary one first (`en es` for several); `telegram` with
the chosen channels (`telegram slack` for several, `none` for none); and `America/Sao_Paulo`
with the zone. Every channel gets all the languages. Each command prints what it saved, and stops
with an error naming a value it doesn't know.

The fields in the table's "Other" column are the only hand edits: change them in that channel's
block in `notifiers` in `config.json` with your file-editing tool, and keep it valid JSON. For
email, ask the server's port and TLS: the block ships with `"smtp_port": 587` and
`"starttls": true`; port 465 needs `"ssl": true`, and a server without TLS (a local relay)
`"starttls": false`.

**Email only: the recipients.** Email goes only to confirmed subscribers, and none exist yet. Ask
which address should receive the briefing (recommend the user's own) and in which of the
languages, then add it; the user consents for their own address, hence `--confirmed`:

```bash
./herald subscribers add you@example.com --lang en --confirmed
```

Replace `you@example.com` and `en`. One address gets one language. Other people should subscribe
themselves through the confirmation email (https://herald.day/docs/channels/#email-subscribers).

**Docker path: services on this machine.** Inside the container, `localhost` and `127.0.0.1` are
the Herald container itself, not this machine. A service running here (an SMTP relay, a
self-hosted ntfy server, the test webhook receiver below) is reached at the Docker bridge's
gateway address, which this prints; use the address it prints (it varies, such as `172.17.0.1`
or `172.18.0.1`) in `.env` or `config.json`. The service must listen on that address or on
`0.0.0.0`, not only on `127.0.0.1`.

```bash
docker network inspect bridge --format '{{(index .IPAM.Config 0).Gateway}}'
```

**Webhook with no receiver yet.** To try the `webhook` channel, run Herald's test receiver; it
accepts any signature and saves each event as a file in `data/sink/`. On the uv path, in the
background:

```bash
mkdir -p data
nohup ./herald dev sink --port 8787 --out data/sink > data/sink.log 2>&1 &
```

The URL for step 7 is `http://127.0.0.1:8787/`. On the Docker path, the receiver needs its own
container with the port published, and the URL is `http://<gateway address>:8787/`, with the
address printed above:

```bash
docker run -d --name herald-sink --user "$(id -u):$(id -g)" -p 8787:8787 -v "$PWD/data:/app/data" ghcr.io/felipebossolani/herald:beta dev sink --host 0.0.0.0 --port 8787 --out /app/data/sink
```

The user puts the URL in `HERALD_WEBHOOK_URL` and any value in `HERALD_WEBHOOK_SECRET` (step 7);
after the sample send in step 9, `ls data/sink` shows one `.json` file per event. It is a test
tool: step 9 stops it and turns the channel off.

## 7. The user fills in .env

Send the user one message with:

- the full path of the file (run `echo ~/herald/.env`), to open in their own editor; it is
  readable only by them;
- the keys to fill, one `KEY=value` per line, no spaces around `=`: the provider's key
  (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_API_KEY` or
  `GEMINI_API_KEY`), the model ids for `openai`, `openrouter`, `opencode`, `gemini` and `ollama`
  (`HERALD_SCORING_MODEL` for a cheap model, `HERALD_ENRICH_MODEL` for a strong one), and the
  keys of each channel from step 6, each with its setup guide link;
- optional: `SEC_USER_AGENT` with their name and email if they follow US categories (the SEC
  asks automated clients for contact details), and the free `FRED_API_KEY` and
  `CONGRESS_API_KEY` for the US calendar;
- that they should never paste a key into this chat.

Wait until they say they are done, then check each required key you asked for, one command per
key (optional keys, such as `SMTP_USER` for a server without login or `HERALD_UNSUBSCRIBE_URL`,
may stay empty):

```bash
grep -c '^ANTHROPIC_API_KEY=.' .env
```

`1` means set. On `0`, tell them which key is still empty and wait again.

**No key yet** (step 3): don't wait for it. Switch to `none`, so the checks below and any
scheduled run work for free meanwhile, and tell the user the briefing stays untranslated feed
text until then:

```bash
./herald config set provider none
```

Only once they say the key is in, check it as above and switch back to their provider with
`./herald config set provider anthropic` (replace `anthropic`).

**`claude-code` only.** A browser sign-in expires, so a daily job needs a long-lived token. Ask
the user to run `claude setup-token` in their own terminal and save the token it prints in
`~/.config/herald/claude-token`, created like this:

```bash
mkdir -p ~/.config/herald
touch ~/.config/herald/claude-token
chmod 600 ~/.config/herald/claude-token
```

Check it without reading it, then set `"use_oauth_token_env": true` in both `ai.scoring` and
`ai.enrichment` of `config.json`. The launcher hands the token to the `claude` CLI; Herald never
reads it.

```bash
test -s ~/.config/herald/claude-token && echo set
```

## 8. Verify, at no cost

For each enabled channel, print what it would send, without sending:

```bash
./herald notify preview --sample --channel telegram
```

Replace `telegram` with each channel. It prints the requests with secrets redacted and ends with
`-> ok: N requests built, not sent` (exit 0), or with `-> failed:` and the setting that is missing
(exit 1), the same check a real send makes. Don't paste the output; tell the user it worked, or
fix the error it names.

Then build a briefing with no AI at all (untranslated feed text, see step 3). It fetches and
ranks every source (about 4 minutes for a few hundred sources on 2 vCPUs, with a progress line at
least every 30 seconds; the first run also downloads the embedding model into `data/models/`),
sends nothing and costs nothing. Its `embeddings: loading ... (N threads: <why>)` line says how
many threads rank the items. If the run takes much longer and N is above the CPUs the machine
really has (a VPS plan names them; on some LXC VPSes and in Docker inside a container, `nproc`
shows the host's), set `"threads"` to that number in the `embeddings` block of `config.json`
(https://herald.day/docs/configuration/#configuration-reference) and run it again:

```bash
HERALD_AI_PROVIDER=none ./herald --dry-run
```

It ends with a run report (`status=ok`) and one `briefing <lang>:` line per language, pointing at
`data/briefings/<date>.<lang>.md` (`/app/data` inside Docker is `~/herald/data`). Show the user
the `funnel` line and offer to show the briefing. Note the `took` time on the report's first line:
step 10 uses it. A `status=failed` report names the problem; the full report is in
`data/reports/`.

## 9. First send and first run (OK required)

Ask before each command and run it only after a yes.

Send the bundled sample briefing to each channel, to prove it arrives (no AI cost):

```bash
./herald notify send --sample --channel telegram
```

`-> ok:` means delivered; ask the user to confirm it arrived. For email, `-> warning:` (exit 1)
means no confirmed subscriber in that language: the recipient from step 6 is missing or has
another `--lang`.

Then the first real run. It uses the AI provider (with an API key, usually under US$ 1; with a
subscription, it counts against the plan), takes a few minutes, delivers to every enabled
channel and records what was published:

```bash
./herald
```

If the user would rather read it before anything is sent, run `./herald --dry-run` instead: it
also spends tokens but sends nothing. Show the `total` cost line of the report, and note its
`took` time for step 10.

**Only if the webhook went to the test receiver from step 6** (skip this otherwise): once the
user has seen it work, stop the receiver, with `docker rm -f herald-sink` on the Docker path or
`pkill -f '[h]erald dev sink'` on the uv path (the brackets keep `pkill` from matching your own
shell). Then, unless the user points `HERALD_WEBHOOK_URL` at a real receiver now
(https://herald.day/docs/webhooks/), turn the channel off, or every run ends `partial` with a
failed webhook delivery:

```bash
./herald config set channels telegram
```

Replace `telegram` with the channels from step 6 without `webhook` (`none` if it was the only
one).

## 10. Schedule it

Ask, one at a time: the delivery time (recommend 06:30) and the days (recommend weekdays, `1-5`;
every day is `*`). Both are in the briefing's time zone from step 6; if the user wants another,
save it with `./herald config set timezone <zone>`.

Recommend this machine (cron) when it is on at that hour. Offer GitHub Actions when it is not,
unless the provider is `claude-code`, `codex` or `ollama` (they need this machine) or a channel
is `email` (its subscriber list lives in `data/`, which Actions doesn't keep).

### On this machine (cron)

Start the run early enough to be done by the delivery time, from what you measured, not a
guess: the `took` time of the run in step 9, or, if it was skipped, of the dry run in step 8.
Add 10 minutes for the AI calls when that run had none (the dry run, or a run on `none` while
the key is pending), unless the user wants no AI at all. Then add a third (at least 5 minutes)
and round up to 5 minutes. For example, a 12-minute run starts 20 minutes early: delivery 06:30,
start 06:10. After a pending key is in, the first scheduled run with it shows the real time
(`grep 'status=' data/cron.log | tail -n 1`); if its `took` passes the head start, start earlier.

Cron reads times in the machine's zone, so Herald picks the hour itself: cron calls it every
hour, and `run --at` runs the briefing only in the hour from the start time in the briefing's
zone, on the `--days` there (cron weekday syntax); every other call exits at once and logs one
line (`not due: ...`), so `data/cron.log` shows that cron is calling. Daylight saving and a
server in UTC then change nothing; log times are in the briefing's zone.

```bash
crontab -l
```

```bash
(crontab -l 2>/dev/null; echo '10 * * * * "$HOME/herald/herald" run --at 06:10 --days 1-5 >> "$HOME/herald/data/cron.log" 2>&1') | crontab -
```

Replace `06:10` with the start time, `10` (the cron minute) with its minute, and `1-5` with the
days. Only when the machine's zone or the briefing's is offset by a half hour (India, Iran,
Newfoundland, central Australia) does the cron minute differ: on Linux,
`date -d 'TZ="Asia/Kolkata" 06:10' +%M` prints it (with the briefing's zone and start time).
Keep the user's other crontab lines. Docker Desktop (on macOS) must be running and the machine
awake at that time.

### On GitHub Actions

The workflow `.github/workflows/daily.yml` runs in the user's fork of the repository. It works
with `anthropic`, `openai`, `openrouter`, `opencode`, `gemini` and `none`, and with every
channel except `email`: it reads each `.env` key from the GitHub secret of the same name, and it
keeps no subscriber data. It needs `gh`, signed in (`gh auth status`).

```bash
gh repo fork felipebossolani/herald --clone=false
```

Ask the user to open `https://github.com/<their user>/herald/actions` and enable workflows (a
fork starts with them off). Then, with their GitHub user in place of `OWNER`:

```bash
gh secret set HERALD_CONFIG_JSON --repo OWNER/herald < config.json
gh secret set HERALD_AI_PROVIDER --body anthropic --repo OWNER/herald
gh variable set HERALD_DAILY --body true --repo OWNER/herald
```

Replace `anthropic` with the chosen provider. Ask the user to run
`gh secret set NAME --repo OWNER/herald` in their own terminal for each key from step 7,
`HERALD_SCORING_MODEL` and `HERALD_ENRICH_MODEL` included (it prompts for the value), then check
the names, never the values:

```bash
gh secret list --repo OWNER/herald
```

It runs at 06:00 São Paulo time (`0 9 * * 1-5`, UTC) on weekdays. For another time, change the
`cron` line (UTC) and `TZ` in the fork's `daily.yml`. A test run on demand spends tokens but
sends nothing (OK required): `gh workflow run daily.yml --repo OWNER/herald -f dry_run=true`.

## 11. Tell the user what they have

In their language, briefly:

- **Where things live** (`~/herald`): `config.json` (categories, channels, languages, time
  zone, watchlists), `.env` (keys; only they edit it), the launcher `herald`, and `data/`:
  briefings in `data/briefings/<date>.<lang>.md`, run reports in `data/reports/`, the cron log in
  `data/cron.log`.
- **Schedule:** the delivery time, the start time, the time zone and days, and where it runs.
  Each run's report line in `data/cron.log` (`grep 'status=' data/cron.log`) shows its status
  and how long it took; if `took` grows past the head start (more categories or languages),
  start earlier. A `partial` run went out but something failed, named on its `failures` line,
  such as a channel; it still exits 0, so cron doesn't flag it.
- **Change categories:** `./herald categories list`, `add`, `remove` or `set`, for example
  `./herald categories add sports`.
- **Change channels, languages or time zone:** `./herald config set channels telegram slack`
  (the full list; the others go off), `./herald config set languages en es` or
  `./herald config set timezone Europe/Lisbon`. A new channel's keys go in `.env`; test it with
  `./herald notify preview --sample --channel <type>`.
- **Email recipients:** `./herald subscribers add <address> --lang <language> --confirmed`,
  `./herald subscribers list`, `./herald subscribers unsubscribe <address>`.
- **Past runs:** `./herald runs` (dry runs are marked). Docs: https://herald.day/docs/
- **With `none`:** the briefing is untranslated feed text until an AI provider is set
  (`./herald config set provider <provider>` once its key is in `.env`).

## Updating

Docker:

```bash
docker pull ghcr.io/felipebossolani/herald:beta
```

uv (the latest beta release, as in step 4b):

```bash
cd ~/herald
git fetch --tags
git checkout "$(git tag --list 'v*-beta' --sort=-v:refname | head -n 1)"
uv sync --no-dev --extra embed
```

Then check with `./herald --version`. New config keys and changes are listed in
https://github.com/felipebossolani/herald/blob/main/CHANGELOG.md

## Uninstalling (OK required)

This deletes the briefings, the history and any subscribers. Remove the schedule, anything
still running (a test receiver from step 6), then the folder:

```bash
crontab -l | grep -v 'herald/herald' | crontab -
docker ps -aq --filter ancestor=ghcr.io/felipebossolani/herald:beta | xargs -r docker rm -f
docker image rm ghcr.io/felipebossolani/herald:beta
pkill -f '[h]erald dev sink'
rm -rf ~/herald
rm -f ~/.config/herald/claude-token
uv cache clean
```

Skip the lines that don't apply: the `docker` lines on the uv path, `pkill` and
`uv cache clean` on the Docker path (`pkill` exits 1 when nothing was running). If you installed
uv in step 3, remove it too, unless the user wants to keep it:

```bash
rm -rf "$(uv python dir)" "$(uv tool dir)"
rm -f ~/.local/bin/uv ~/.local/bin/uvx ~/.local/bin/env ~/.local/bin/env.fish
```

Then, with your file-editing tool, delete the line the uv installer added to the shell
profiles (`. "$HOME/.local/bin/env"` in `~/.profile`, `~/.bashrc`, `~/.zshrc`, or the fish
config), and nothing else.

On GitHub Actions, turn the job off with
`gh variable set HERALD_DAILY --body false --repo OWNER/herald`, or let the user delete the fork.

## Troubleshooting

- **`permission denied` on the Docker socket:** the user must join the `docker` group
  (`sudo usermod -aG docker $USER`, then log out and in) or use the uv path.
- **`error: no categories found`:** `config.json` is not where the launcher mounts it; run
  `./herald` from `~/herald`.
- **A key is set but the run says it is missing:** a space around `=`, or quotes that don't
  match, in `.env`. Ask the user to check that line; don't read it yourself.
- **The AI calls fail** (`status=failed`, no stories scored): wrong key, no credit, or an expired
  CLI sign-in. The report in `data/reports/` says which provider failed.
- Anything else: https://herald.day/docs/ and https://github.com/felipebossolani/herald/issues
