# wp2-cli

A fenced CLI mid-layer over the Twinroll production systems. You need no repository and no build to
use it: one file installed from here forwards your commands to this service, which holds the
Storyblok, Centra and Google credentials so you do not have to.

## Start here

    GET /install     the install instructions, written for the session that reads them
                     (Authorization: Bearer <WP2_INSTALL_TOKEN>, or ?t=<token>)

If you were handed a URL and a token and nothing else, that is the next request to make. Ask the
operator which of the three tokens you hold: they open different doors and none opens two.

## Every route

| route | what | token |
|---|---|---|
| `GET /` | this page | none |
| `GET /health` | liveness, for the deploy gate | none |
| `GET /install` | install instructions and the one-file client | WP2_INSTALL_TOKEN |
| `GET /docs` | every command, its slug and its current documentation version | WP2_REMOTE_TOKEN (header only) |
| `GET /docs/<command>` | one command's documentation, e.g. /docs/db-query | WP2_REMOTE_TOKEN (header only) |
| `POST /command` | run a wp2 command: {"argv":["state"]} | WP2_REMOTE_TOKEN |
| `GET /reports` | the generated HTML reports | WP2_REPORTS_TOKEN |

Naming a gated route gives nothing away: each still needs its own token, and no token is ever
echoed back here.
