> ## 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.

# Backend Developer Cheat Sheet

> Common Bazable workflows for backend developers

## First-time setup

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g bazable-api
    ```
  </Step>

  <Step title="Initialize and extract">
    ```bash theme={null}
    cd your-backend
    bazable init
    bazable extract --payloads
    ```

    Discovers APIs from your own code and infers request payloads.
  </Step>

  <Step title="Publish the contract">
    ```bash theme={null}
    bazable push
    ```

    Creates a cloud project on first push and uploads the contract.
  </Step>
</Steps>

## Daily workflow

```bash theme={null}
bazable diff https://api.example.com/v1/users    # check if live API matches contract
bazable test --all --token <token> --method POST # test all endpoints
bazable push                                     # update contract after changes
```

## When the frontend expects changes

```bash theme={null}
bazable sync                                     # pull latest contract from cloud
bazable generate backend --framework express     # generate route stubs from contract
```

## AI & CI

```bash theme={null}
bazable ci                                                    # generate GitHub Actions workflow
bazable gen ui POST https://api.example.com/v1/settlements    # generate a React form
bazable explain POST https://api.example.com/v1/users         # AI endpoint explanation
bazable propose "Add phone field"                             # AI contract change proposal
bazable accept 1691501234567                                  # approve proposal
bazable mcp                                                   # start MCP server for AI agents
```

## Handy options

| Command | Purpose |
| - | - |
| `bazable serve` | Spin up a mock server for testing. |
| `bazable ui` | View the contract visually. |
| `bazable import openapi.yaml` | Import an existing OpenAPI spec. |
| `bazable inspect` | Validate backend code against the contract. |

<Tip>
  See the [Frontend cheat sheet](/cheat-sheets/frontend) for the client-side workflow.
</Tip>


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