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

# Your first local gate

> Block a regression in CI before lunch. No account required.

# Your first local gate

This is the fastest proof that EvalGate is useful. You will create a baseline,
add a CI step, then watch the gate fail when you break something on purpose. No
account, no API key, no dashboard.

## What you need

* A repo with at least one test or eval command that prints pass/fail.
* A terminal, and permission to push to GitHub.

## Step 1 — Plan the setup

In your repo, run:

```bash theme={null}
npx @evalgate/sdk init
```

This prints what EvalGate would create **without writing anything**. Read the
plan. It should mention a baseline file, a config file, and a CI workflow.

## Step 2 — Apply the setup

When the plan looks right, apply it:

```bash theme={null}
npx @evalgate/sdk init --apply
```

You now have the committed setup artifacts:

| File                                  | What it is for                                      |
| ------------------------------------- | --------------------------------------------------- |
| `evalgate.project.json`               | Shared project, target, and baseline lineage        |
| `evals/baseline.json`                 | A pending baseline that has not accepted a run yet  |
| `evalgate.config.json`                | Tells the gate which command represents app quality |
| `.github/workflows/evalgate-gate.yml` | Runs the same check on every PR                     |

## Step 3 — Accept a baseline

The applied baseline is **pending** — it has not run your suite yet. Run your
suite once and accept the result as the baseline:

```bash theme={null}
npx @evalgate/sdk baseline update
```

## Step 4 — Push and open a PR

```bash theme={null}
git add .
git commit -m "Add EvalGate regression gate"
git push
```

Open a pull request. The CI workflow runs your suite, compares it to the
baseline, and passes.

## Step 5 — Break something on purpose

Change a test or eval so it fails, then push:

```bash theme={null}
git commit -am "Intentional break"
git push
```

The same CI workflow now **fails** with a regression report that names what
changed. That is the whole loop: baseline → change → regression report → CI
gate.

## Troubleshooting

* **The gate passed when it should have failed.** You probably did not run
  `baseline update` after `init --apply`. The baseline is still pending.
* **The gate failed on the first run.** Your suite was already failing when you
  accepted the baseline. Fix the suite, then re-run `baseline update`.
* **Nothing happened in CI.** Confirm `.github/workflows/evalgate-gate.yml` was
  committed and pushed to the default branch.

## Up next

When you are ready to feed real production failures into the same loop,
[connect a model provider key](./connect-provider-key).
