# AGENTS.md

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

## Setup

```
npm ci
```

## Commands

```
npm run dev             # run locally
npm run start           # run the app
npm run build           # produce a build
npm run test            # run the test suite, must pass before any commit
npm run lint            # lint
npm run check           # lint and type check
npm run dev:candidate
npm run prebuild:docs
```

## Layout

- `tests/`      7761 source files
- `src/`        3670 source files
- `open-sse/`   1981 source files
- `scripts/`    323 source files
- `bin/`        224 source files
- `@omniroute/` 105 source files

## Conventions

- Tests live alongside the code they cover, following `@omniroute/opencode-plugin-v2/tests/api-package.test.ts`.
- TypeScript is not in strict mode. Turning it on catches a whole class of mistakes before they run.
- CI defines what passing means. See `.github/workflows/api-route-typecheck.yml`, and keep it green.
- TODO: add the two or three conventions a newcomer always gets wrong here.

## Gotchas

- `@omniroute/opencode-plugin/src/index.ts` is 238KB. It will not fit comfortably in context, so read it in parts.
- Copy `.env.example` before running anything that needs configuration.

---

Drafted by agentreadme.com from what is in this repository. Everything marked TODO
needs a human. Check it in as AGENTS.md at the root.
