# API commands

> Look up API generation commands for projects using the legacy API.

The `hulla api` commands generate code for the legacy API. They are incompatible with `@hulla/api` 2.0. For a new API, follow [Build a task API](https://hulla.dev/guides/api/quick-start.md).

The commands below document CLI beta `0.0.0-beta.1` for projects that still use that interface.

## What the legacy commands expect

The CLI still exposes `hulla api init`, `hulla api generate`, and `hulla api dev`. The initializer detects older framework and database setups and writes missing files such as `api.config.ts`, router modules, a handler, and a framework mount. It leaves existing files alone, but generated imports still target the legacy API surface.

The generate and dev commands load an `api.config.ts` that carries the `hulla.api.client-config` marker, compile it with Bun, and call `runGenerateConfig` exported from the installed `@hulla/api`. Dev mode then watches the config and source inputs reported by the generator. These mechanics only describe that legacy integration boundary; they do not make it compatible with 2.0.

## Existing legacy projects

If you maintain a project built against the older generator, confirm its exact `@hulla/api` version and generated output contract before invoking the CLI. The current docs do not prescribe a compatible version pin, and no automatic migration from `createApi` or generated clients is provided here.

For a 2.0 migration, use the current API documentation for [contracts](https://hulla.dev/docs/api/core/contracts.md), [servers](https://hulla.dev/docs/api/core/servers.md), and [clients](https://hulla.dev/docs/api/core/clients.md). Keep generated legacy files separate from new hand-authored 2.0 modules until the migration is complete.
