# Install with an AI agent

Let a coding agent install Herald for you: paste one line, answer a few questions, and type your
keys into a file yourself. The agent follows a public runbook, the same for every agent, at
[herald.day/install.md](https://herald.day/install.md).

## The prompt

Paste this into the agent, in a terminal on the machine that will run Herald:

```text
Install Herald on this machine: run curl -fsSL https://herald.day/install.md and follow it step by step.
```

It works with Claude Code, Codex, Gemini CLI and any other coding agent that can run shell
commands. Linux and macOS work as they are; on Windows, start the agent inside WSL 2. Let the
agent use the network and Docker when it asks: it has to download Herald.

## What the agent asks

One question at a time, each with a suggested answer, in the language you write to it:

- the language of the briefing: Brazilian Portuguese, English, Spanish, French, Italian or
  German, or several;
- the AI provider: an API key (Anthropic, OpenAI, OpenRouter, OpenCode, Gemini), your Claude or
  ChatGPT subscription, a local Ollama model, or none (see [AI providers](providers.md));
- the categories to follow, such as your region plus global tech and macro
  (see [Categories](configuration.md#categories));
- the channels that receive the briefing, such as Telegram or Slack (see [Channels](channels.md));
- when the briefing should arrive: time, time zone and days.

## What the agent does

1. Checks the machine: Docker, or uv and git, and the Claude or Codex CLI if you use a
   subscription.
2. Sets up `~/herald`: with the Docker image `ghcr.io/felipebossolani/herald:beta`, or from a
   clone of the latest beta release with uv when your provider needs the host (`claude-code`,
   `codex`, `ollama`) or Docker is missing. It writes a small `herald` launcher there, so every
   command is `./herald ...`.
3. Gets `config.json` and `.env` from Herald's examples, runs `herald init` with your provider
   and categories, and `herald config set` with your languages, channels and time zone. For
   email, it adds your address as a confirmed subscriber.
4. Tells you which keys to fill in `.env` and where to get each one, then checks that each is
   set without reading it.
5. Checks the setup at no cost: `herald --version`, `herald notify preview --sample` for each
   channel (prints what would be sent, sends nothing) and a dry run with no AI model.
6. With your OK, sends a sample briefing to your channels and runs the first real briefing.
7. Schedules the daily run with cron on this machine, or on GitHub Actions in your fork (see
   [Scheduling](scheduling.md)). On this machine it starts the run as long before your delivery
   time as the measured runs took, plus a margin, and cron calls Herald every hour so that the
   briefing follows your time zone, daylight saving included, whatever the server's zone.
8. Ends with a summary: where things live, how to change categories and channels, and where
   the briefings and logs are.

The runbook also covers updating and uninstalling: ask the agent to update or remove Herald and
it follows the same file.

## What it never does

- **Ask for your secrets.** API keys, tokens and webhook URLs go into `.env`, typed by you in
  your own editor. The agent never asks for them in the chat, never prints `.env`, and checks a
  key only by counting whether it has a value. If an agent asks you to paste a key, don't.
- **Spend or send without your OK.** The checks before your OK cost nothing and send nothing.
  The first run that uses your AI provider, the first message to a channel and an uninstall each
  wait for your yes.
- **Use `sudo` or install system packages.** If Docker and uv are both missing, it offers to
  install uv for your user only (in `~/.local/bin`, no `sudo`) and waits for your yes; anything
  else it tells you to install.

## Troubleshooting

**The agent can't reach the internet from its shell.** Download the runbook yourself and point
the agent at the file:

```bash
curl -fsSL https://herald.day/install.md -o herald-install.md
```

```text
Install Herald on this machine: follow the steps in herald-install.md.
```

Herald itself still needs the network to download the image and fetch the news, so allow it
when the agent asks, or run the commands it shows you in your own terminal.

**The agent summarized the page instead of following it.** Some web tools return a summary. The
prompt asks for `curl` for that reason; if the agent used another tool, ask it to fetch the raw
file with `curl -fsSL https://herald.day/install.md`.

**Docker says `permission denied`.** Your user is not in the `docker` group. Add it, log out and
back in, and ask the agent to continue; or let it install with uv instead.

**Something else failed.** Each run writes a report to `~/herald/data/reports/`, and scheduled
runs log to `~/herald/data/cron.log`. The steps the agent followed are all in
[the runbook](https://herald.day/install.md), so you can run any of them yourself.
