> For AI agents: the complete documentation index is available at https://docs.hod.sh/llms.txt, the full documentation bundle is available at https://docs.hod.sh/llms-full.txt.

# Quick start

Hod's server isn't ready for other people yet. This is how it runs today, for development and for early testing.

A Hod install has three parts:

- **`hod-server`**: plans runs, schedules jobs, keeps logs and caches, and talks to forges.
- **Postgres**: all of the server's state.
- **Runners** (`hod-runner`, started with `hod runner start`): run the jobs, on any machine that can reach the server.

```sh
cp .env.example .env          # set HOD_ADMIN_TOKEN, HOD_RUNNER_TOKEN and HOD_RUNNER_TOKEN_UNPROTECTED (openssl rand -hex 32 each)
docker compose up --build     # Hod, two runners and Postgres
curl localhost:8080/readyz    # ok
```

Start a run by hand:

```sh
echo "$HOD_ADMIN_TOKEN" | hod login http://localhost:8080 --with-token   # saved in ~/.config/hod/hosts.yaml
hod run trigger --repo https://github.com/acme/app [--ref main]   # the branch's tip
hod run list                # recent runs
hod logs app#1 -f            # follow a run's job logs until it ends
hod run cancel app#1
hod run rerun app#1         # rerun its failed jobs as attempt 2 (--all: every job)
hod webhook deliveries      # webhook deliveries, and the run (or reason) of each
```

In a checkout of a repository the server builds, the CLI works out the project from the `origin` remote, and the branch and commit from git, so most commands need no arguments:

```sh
git push && hod watch        # follow the run of HEAD (waiting for its webhook), exit with its result
hod view                     # the newest run on this branch: its jobs, and where failed ones failed
hod logs --job test          # its log
hod run rerun               # rerun its failed jobs
hod run trigger             # a manual run of HEAD on this branch
hod run list -o json        # this project's runs, as the REST API's JSON (-o yaml too); --all for the org
```

Outside a checkout, a command that needs a run offers a list of recent ones on a terminal, and when piped says which to pass; it never waits for input.

`hod run trigger` asks the server for a manual run. The server fetches `.hod/pipeline.yaml` at that commit, compiles it, and stores the run with its jobs. The project is created on the first trigger for a repository URL, and the ref defaults to the repository's default branch. `hod login` saves the server and its token (mode 0600) and makes it the current server; `hod logout` forgets it. `--server` or `HOD_SERVER`, and `HOD_TOKEN`, win over what's saved, so CI sets those instead. Scripts can log in with `echo $TOKEN | hod login URL --with-token`.

## Reporting a vulnerability

Report vulnerabilities in Hod privately, as [SECURITY.md](https://github.com/hod-ci/hod/blob/main/SECURITY.md) describes, not in a public issue. A Hod server doesn't serve a `/.well-known/security.txt` of its own: the admin is the contact for their install, so serve one at your proxy if you want one.
