> ## 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 gen context

> Generate AI agent context files so Cursor, Cline, and Roo Code respect your Bazable contract.

Generates AI agent context files in your project root so AI coding tools (Cursor, Cline, Roo Code) automatically respect your Bazable contract.

## Usage

```bash theme={null}
bazable gen context
```

## Options

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

## What it creates

<CardGroup cols={1}>
  <Card title=".cursorrules" icon="file-code">
    Instructions for **Cursor IDE**. Cursor reads this file and follows the rules when suggesting or writing code.
  </Card>

  <Card title=".clinerules" icon="file-code">
    Instructions for **Cline**, **Roo Code**, and other VS Code agents. These tools use the rules to avoid hallucinating API calls.
  </Card>

  <Card title=".mcp.json" icon="plug">
    Pre-configures Bazable's MCP server as an active tool. MCP-compatible agents can call `bazable.inspect`, `bazable.listEndpoints`, and more directly.
  </Card>
</CardGroup>

## After generation

<Steps>
  <Step title="Restart your AI coding tool">
    Cursor, Cline, and similar tools automatically detect the new context files after a restart.
  </Step>

  <Step title="Start the MCP server">
    Run the following in your project directory for real-time contract data:

    ```bash theme={null}
    bazable mcp
    ```
  </Step>

  <Step title="Let the agent use the contract">
    The AI agent will now:

    * Check `bazable.config.json` instead of inventing API endpoints.
    * Use your generated `bazableClient` or `bazable-types` for type-safe API calls.
    * Verify contract compliance before proposing changes.
  </Step>
</Steps>

## Example

```bash theme={null}
bazable gen context
```

Output:

```text theme={null}
✦ Generated .cursorrules
✦ Generated .clinerules
✦ Generated .mcp.json
```

<Tip>
  Pair this with [`bazable mcp`](/commands/mcp) to give your AI agent live access to inspect results and endpoint schemas.
</Tip>


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