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

# bazable generate

> Generate backend code from the contract

Generates backend code from the contract.

## Subcommands

<Card title="backend" icon="server">
  Express.js or Hono router stubs with Zod validation.
</Card>

## Usage

```bash theme={null}
bazable gen backend [options]
```

## Options

<ParamField query="-f, --framework" type="string">
  Target framework. One of `express` or `hono`.
</ParamField>

<ParamField query="-o, --output" type="string">
  Output directory for generated files.
</ParamField>

<ParamField query="-v, --no-validation" type="boolean">
  Skip Zod validation schemas.
</ParamField>

<ParamField query="--postman" type="boolean">
  Also generate a Postman collection (`postman_collection.json`) from the contract next to the router stubs.
</ParamField>

<ParamField query="--test" type="boolean">
  Print instructions to run Newman against the generated stub server. Requires `--postman`.
</ParamField>

## Examples

<CodeGroup>
  ```bash Express theme={null}
  bazable gen backend -f express -o ./api
  ```

  ```bash With Postman collection theme={null}
  bazable gen backend --framework express --postman
  ```

  ```bash Hono + test instructions theme={null}
  bazable gen backend --framework hono --postman --test
  ```
</CodeGroup>

<Tip>
  Pair with [`bazable gen ui`](/commands/generate-ui) to scaffold matching frontend forms, and see [Postman Integration](/guides/postman) for testing the generated stubs with Newman.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.