eai types
Manage Object Type definitions -- the data model for your vertical application.
Description
Object Types define the data schema for your vertical. They are defined locally in src/eai.config/object-types.ts and synced to the platform. The eai types command group provides subcommands for validating, seeding, comparing, and pulling Object Type definitions.
Subcommands
| Subcommand | Description |
|---|---|
eai types validate | Check local Object Types against platform schema rules |
eai types seed | Push Object Types to the platform |
eai types diff | Compare local and remote Object Types |
eai types pull | Download remote Object Types to local definitions |
eai types validate
Check local Object Types against platform schema rules.
Syntax
eai types validate
Description
Validates your local Object Type definitions in src/eai.config/object-types.ts to ensure they conform to the platform's schema requirements. This command catches errors before you push types to the platform.
Validation Rules
The validator checks the following:
- PascalCase naming -- Type names must use PascalCase (e.g.,
LoanApplication, notloanApplication). - Required fields -- Each type must have
nameandpropertiesdefined. - Property type correctness -- Property types must be valid platform types.
- Select type options -- Properties of type
Selectmust include anoptionsarray. - LinkType references --
LinkTypeproperties must reference valid target types that exist in your definitions.
Example
eai types validate
If validation succeeds, you will see a confirmation message. If there are errors, the CLI will list each issue with the type name and property that failed validation.
eai types seed
Push Object Types from src/eai.config/object-types.ts to the platform.
Syntax
eai types seed [options]
Options
| Flag | Description | Default |
|---|---|---|
--env <environment> | Target environment (dev, staging, prod) | dev |
--tenant-key <key> | Seed only a specific tenant | All tenants |
--dry-run | Preview changes without applying them | false |
Examples
# Seed all tenants in the dev environment
eai types seed
# Seed only a specific tenant
eai types seed --tenant-key my-tenant
# Preview what would be seeded without making changes
eai types seed --dry-run
# Seed to the staging environment
eai types seed --env staging
Always run eai types validate before seeding to catch errors early:
eai types validate && eai types seed
eai types diff
Compare local Object Types with what is deployed on the platform.
Syntax
eai types diff
Description
Shows the differences between your local Object Type definitions and the types currently deployed on the platform. The output highlights:
- Additions -- New types or properties that exist locally but not on the platform.
- Removals -- Types or properties that exist on the platform but not in your local definitions.
- Modifications -- Properties that have changed between local and remote versions.
This is useful for reviewing changes before running eai types seed.
Example
eai types diff
eai types pull
Download remote Object Types to local TypeScript definitions.
Syntax
eai types pull [options]
Description
Pulls the Object Type definitions currently deployed on the platform and writes them to your local src/eai.config/object-types.ts file. This is useful for syncing with changes made through the Configurator UI or by other team members.
Example
eai types pull
Running eai types pull will overwrite your local Object Type definitions. Make sure to commit any local changes before pulling.
Related Commands
eai resources schema-- View published Object Types for the current tenanteai verify-- Check platform connectivity before syncing types