# Reference (/docs/reference)

> Generated reference for the server API, package exports, the CLI, error codes, packages, and the changelog, extracted from the repository.



Everything in this section is generated from the repository by `apps/docs/scripts/generate.mjs`, so it matches the
code it documents: method names and signatures come from the built TypeScript declarations and a live
`betterIam()` instance, error codes from every `IamError` thrown in `packages/*/src`, CLI usage from the CLI's own
help text, and packages from the workspace manifests.

  - [Server API](/docs/reference/api): Every `iam.api` group and method with its HTTP route, credential requirement, and TypeScript signature.

  - [Package exports](/docs/reference/exports): Every function, hook, component, and class the packages export, what it does, and the guide that uses it.

  - [CLI](/docs/reference/cli): The `better-iam` command line: migrations, bootstrap, audits, configuration as code, and scheduled jobs.

  - [Error codes](/docs/reference/errors): Every stable `IamError` code grouped by HTTP status, with example messages.

  - [Packages](/docs/reference/packages): The publishable packages, their subpath exports, and dependencies.

  - [Changelog](/docs/reference/changelog): Every notable change, newest first.

## Machine-readable docs [#machine-readable-docs]

The site serves its content for tools and language models as well as for people:

| URL                   | Content                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `/llms.txt`           | An index of every page with its description                                                                               |
| `/llms-full.txt`      | Every page as Markdown in one file                                                                                        |
| `/docs/<page>.md`     | One page as Markdown (also served for `Accept: text/markdown`)                                                            |
| `/api/search?query=…` | The search index behind the search dialog, as JSON                                                                        |
| `/api/mcp`            | An MCP server with search, page, API-method, export, and error-code tools; see [Use the docs with AI](/docs/reference/ai) |
| `/openapi.json`       | The OpenAPI 3.1 description of the HTTP API                                                                               |

## Regenerating [#regenerating]

```bash
pnpm build                                  # declarations the API catalog is read from
pnpm --filter @better-iam/docs generate     # data + generated pages (API, exports, errors, CLI, glossary)
node apps/docs/scripts/check-content.mjs    # validate every page and link
```
