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

# crud-unified

> Generate complete CRUD functionality for models

# crud-unified Command

The `crud-unified` command generates complete CRUD (Create, Read, Update, Delete) functionality for models, including database schemas, API endpoints, UI components, validation, and tests.

## Usage

```bash theme={"system"}
zopio crud-unified [options]
```

## Options

* `-m, --model <model>` - Model name (required)
* `-f, --fields <fields>` - Field definitions in format "name:type:label,age:number:Age" (required)
* `-o, --output <directory>` - Output directory for generated files
* `-db, --database <database>` - Database type (mongodb | postgres | mysql) (default: "mongodb")
* `-fw, --framework <framework>` - UI framework (react | vue | angular) (default: "react")
* `--api` - Generate API endpoints only
* `--ui` - Generate UI components only
* `--schema` - Generate database schema only
* `--permissions` - Generate permissions only
* `--validation` - Generate validation schemas only
* `--tests` - Generate tests only
* `--theme, -t <theme>` - UI theme (bootstrap, material) (default: bootstrap)

## Examples

<CodeGroup>
  ```bash basic usage theme={"system"}
  zopio zopio crud-unified -m User -f "name:string,email:string,age:number"
  ```

  ```bash with PostgreSQL theme={"system"}
  zopio zopio crud-unified -m Order -f "id:string,customer:string,total:number,date:date,status:string" -db postgres
  ```

  ```bash with next.js theme={"system"}
  zopio crud-unified -m Product -f "name:string,price:number,inStock:boolean" -fw nextjs
  ```
</CodeGroup>

## Field Types

The following field types are supported:

* `string` - Text values
* `number` - Numeric values
* `boolean` - True/false values
* `date` - Date and time values
* `array` - Array of values
* `object` - Nested object

## Related Commands

The `crud-unified` command combines functionality from several specialized CRUD commands:

### crud

Generate basic CRUD operations.

```bash theme={"system"}
zopio crud -m <model> -f <fields>
```

### crud-schema

Generate database schemas for models.

```bash theme={"system"}
zopio crud-schema -m <model> -f <fields> -t <type>
```

### crud-ui

Generate UI components for models.

```bash theme={"system"}
zopio crud-ui -m <model> -f <fields> -fw <framework>
```

### crud-validation

Generate validation schemas for models.

```bash theme={"system"}
zopio crud-validation -m <model> -f <fields> -l <library>
```

### crud-testing

Generate tests for CRUD operations.

```bash theme={"system"}
zopio crud-testing -m <model> -f <fields> -t <test-type> -fw <framework>
```

### crud-permissions

Generate permission rules for models.

```bash theme={"system"}
zopio crud-permissions -m <model> -r <roles>
```

<Alert type="tip">
  The `crud-unified` command supports internationalization out of the box. All generated UI components and validation messages will be available in all configured languages.
</Alert>
