> ## Documentation Index
> Fetch the complete documentation index at: https://repost.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the CLI in CI and automation

> Authenticate without a browser, run headless forwarding, and pause or resume forwarders from a CI pipeline.

The CLI is non-interactive when it needs to be. In CI, deploy scripts, and other automation, authenticate with an environment token and drive forwarders without the terminal UI.

## Authenticate with a token

Set `REPOST_TOKEN` in the environment. It takes priority over any stored credentials, so the same step works on a fresh CI runner or on a developer machine.

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
export REPOST_TOKEN=rp_your_token_here
repost auth status
```

Create a named, expiring token from the dashboard and store it as a CI secret. See [Authentication](/docs/cli/authentication) for the full token model and lookup order.

## Pause forwarding during a deploy

Forwarders can be paused and resumed from the CLI. Pause a forwarder before a deploy so it stops delivering to a service that is restarting, then resume it once the deploy is healthy.

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
# before deploy: stop delivering to the target
repost forwarder pause --bucket stripe-prod --forwarder prod-api

# after deploy: start delivering again
repost forwarder resume --bucket stripe-prod --forwarder prod-api
```

While a forwarder is paused, the bucket keeps recording incoming requests in event history, so nothing is lost. Anything that arrived during the pause can be redelivered with [history replay](/docs/history/replay).

<Note>
  See [Manage forwarders](/docs/cli/manage-forwarders) for the difference between pause, disable, and resume, the interactive selector, and how to list buckets and forwarders.
</Note>

## Run forwarding headless

`--headless` runs `repost forward` without the TUI. It prints `HEADLESS_READY` once the listener is connected, then processes events in the background. Pass `--skip-pending` so startup does not block on an interactive pending-event decision.

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost forward \
  --bucket stripe-prod \
  --forwarder local-webhooks \
  --skip-pending \
  --headless
```

## Example: GitHub Actions deploy

Pause the production forwarder while a deploy runs, then resume it. Store the token as a repository secret named `REPOST_TOKEN`.

```yaml theme={"languages":{"custom":["/languages/repost.json"]}}
name: deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      REPOST_TOKEN: ${{ secrets.REPOST_TOKEN }}
    steps:
      - name: Install the Repost CLI
        run: curl -fsSL https://releases.repost.sh/cli/install.sh | sh

      - name: Pause the production forwarder
        run: repost forwarder pause --bucket stripe-prod --forwarder prod-api

      - name: Deploy
        run: ./scripts/deploy.sh

      - name: Resume the production forwarder
        if: always()
        run: repost forwarder resume --bucket stripe-prod --forwarder prod-api
```

<Note>
  `if: always()` on the resume step re-enables the forwarder even if the deploy step fails. Pair it with [history replay](/docs/history/replay) to redeliver anything that arrived while the forwarder was paused.
</Note>

## Non-interactive flags

<Columns cols={2} className="gap-y-4">
  <Card title="REPOST_TOKEN" icon="key-round">
    Environment auth. Overrides stored credentials. Required on CI runners.
  </Card>

  <Card title="--bucket / --forwarder" icon="square-terminal">
    Target a bucket and forwarder without prompts. Provide both, or neither.
  </Card>

  <Card title="--skip-pending" icon="skip-forward">
    Skip the interactive pending-event decision at startup. Required with `--headless`.
  </Card>

  <Card title="--headless" icon="server">
    Run `repost forward` with no TUI, printing `HEADLESS_READY` when connected.
  </Card>
</Columns>
