##### Before proceeding

Ensure you [**install**](/content/docs/tooling/command-line/installation#getting-started/index.html) the CLI, [**log in**](/content/docs/tooling/command-line/installation#login/index.html) to your Appwrite account, and [**initialize**](/content/docs/tooling/command-line/installation#initialization/index.html) your Appwrite project.

The `generate` command creates a type-safe SDK tailored to your Appwrite project. It reads your database schema and generates typed helpers, so you can interact with your tables using auto-completed methods, resulting in a better developer experience.

## Generate SDK

Run the following command in your project directory:

```sh

```

The CLI automatically detects your project's language and generates the SDK to a `generated/appwrite/` directory.

## Options

| Option                      | Description                                                                             |
|-----------------------------|-----------------------------------------------------------------------------------------|
| `-o, --output <directory>` | Output directory for generated files (default: `"generated"`)                        |
| `-l, --language <language>`| Target language for SDK generation (supported: `typescript`)                          |
| `--server <mode>`          | Override server-side generation (`auto`|`true`|`false`) (default: `"auto"`)         |
| `-h, --help`               | Display help for command                                                                |

## Generated files

The generated SDK includes the following files:

| File           | Description                                                            |
|----------------|-----------------------------------------------------------------------|
| `types.ts`    | Type definitions based on your database schema.                       |
| `databases.ts`| Typed database helpers for querying and mutating rows.                |
| `index.ts`    | Entry point that exports all generated helpers.                       |
| `constants.ts`| Configuration constants such as your project endpoint and project ID. Update these values before using the SDK. |

## Usage

After generating the SDK, import it into your project:

```ts

```

Configure your SDK constants by setting the values in `./generated/appwrite/constants.ts`.

Use the generated helpers to interact with your tables:

```ts

```

The generated helpers provide auto-completion and type checking based on your database schema, reducing errors and improving developer experience.

## Examples

The generated SDK supports all common database operations. Below are examples across different use cases.

### Get a row

```ts

```

### List rows with queries

The `list` method accepts a typed query builder that provides auto-completion for your table's columns.

```ts

```

### Update a row

```ts

```

### Delete a row

```ts

```

### Bulk operations

Create, update, or delete multiple rows at once.

```ts

```

```ts

```

```ts

```

### Permissions

Set row-level permissions when creating or updating rows.

```ts

```

###### Recommended

- [API reference/Account](/content/docs/references/cloud/client-web/account/index.html)
- [API reference/Teams](/content/docs/references/cloud/client-web/teams/index.html)
- [API reference/Databases](/content/docs/references/cloud/client-web/databases/index.html)
- [API reference/Storage](/content/docs/references/cloud/client-web/storage/index.html)
