Skip to main content

eai resources

Perform CRUD operations on platform resources stored in ResourceAPI.

Description

Resources are instances of your Object Types -- the actual data records in your vertical application. The eai resources command group provides subcommands for creating, reading, updating, deleting, and querying resources, as well as viewing the published schema.

Subcommands

SubcommandDescription
eai resources listList resources of a given type
eai resources getGet a specific resource by ID
eai resources createCreate a new resource
eai resources updateUpdate an existing resource
eai resources deleteDelete a resource
eai resources queryRun cross-type queries
eai resources schemaShow published Object Types

eai resources list

List resources of a given Object Type.

Syntax

eai resources list <type> [options]

Arguments

ArgumentDescriptionRequired
typeObject Type name (e.g., Application)Yes

Options

FlagDescriptionDefault
--page <n>Page number for pagination1
--limit <n>Number of items per page20
--sort <field>Sort field (prefix with - for descending)-created_at
--jsonOutput raw JSONfalse

Examples

# List all Applications
eai resources list Application

# List with pagination
eai resources list Application --page 2 --limit 10

# Sort by name ascending
eai resources list Application --sort name

# Sort by creation date descending (default)
eai resources list Application --sort -created_at

# Output as JSON
eai resources list Application --json

eai resources get

Retrieve a specific resource by its type and ID.

Syntax

eai resources get <type> <id> [options]

Arguments

ArgumentDescriptionRequired
typeObject Type nameYes
idResource IDYes

Example

eai resources get Application abc123

eai resources create

Create a new resource of the specified Object Type.

Syntax

eai resources create <type> [options]

Arguments

ArgumentDescriptionRequired
typeObject Type nameYes

Options

FlagDescription
--data <json>Resource data as a JSON string
--file <path>Read resource data from a JSON file

You must provide either --data or --file.

Examples

# Create from inline JSON
eai resources create Application --data '{"applicantName":"Jane","status":"draft"}'

# Create from a JSON file
eai resources create Application --file ./seed-data/app1.json

eai resources update

Update an existing resource.

Syntax

eai resources update <type> <id> [options]

Arguments

ArgumentDescriptionRequired
typeObject Type nameYes
idResource IDYes

Options

FlagDescription
--data <json>Updated resource data as a JSON string
--file <path>Read updated data from a JSON file

Example

eai resources update Application abc123 --data '{"status":"submitted"}'

eai resources delete

Delete a resource by its type and ID.

Syntax

eai resources delete <type> <id> [options]

Arguments

ArgumentDescriptionRequired
typeObject Type nameYes
idResource IDYes

Example

eai resources delete Application abc123
caution

Deletion is permanent. There is no undo. Make sure you have confirmed the correct resource ID before running this command.


eai resources query

Run cross-type queries for complex searches across multiple Object Types.

Syntax

eai resources query [options]

Description

The query subcommand allows you to perform advanced searches that span multiple Object Types. This is useful when you need to find resources based on relationships or complex criteria.

Example

eai resources query

eai resources schema

Show the published Object Types for the current tenant.

Syntax

eai resources schema

Description

Displays the Object Type schema that is currently published and active on the platform for your tenant. This shows what types and properties are available for resource operations.

Example

eai resources schema
  • eai types -- Manage Object Type definitions (the schema for resources)
  • eai tenant list -- List tenants to identify which tenant's resources you are working with