Datagen Factory

resources

Register and manage Resources — the reproducible state your agent reaches into during a rollout.

A Resource is a dependency your agent needs to do its job: a Postgres database, a folder of files your tools read, later other shapes. When a rollout runs, your agent sees a Sandbox — a per-rollout reproducible copy of the Resource, so "what were my last five orders" gives the same answer every time.

The resources group lets you register Resources, list them, inspect them, and tear them down. See Resources and sandboxes for the conceptual model and when each Resource type fits.

Supported types

TypeModeWhat you provide
postgresn/aSchema DDL; optional default seed rows.
file_corpuslocal (required)A folder of files your agent reads.

More types are on the roadmap. The CLI validates the --type / --mode combination locally before the request lands.


resources list

List Resources in your active organization.

datagen resources list [--type TYPE] [--mode MODE] [--limit N] [--cursor TOKEN]

Flags

FlagTypeDefaultDescription
--typestringNoneFilter by type (postgres, file_corpus).
--modestringNoneFilter by mode (e.g. local).
--limitinteger20Maximum number of Resources to return.
--cursorstringNonePagination cursor, printed by the previous page.
--formattext|jsontextOutput format.

Example

$ datagen resources list --type postgres
                             Resources
 ID Name Type Mode Description
 res_8kz23a prod-catalog-ro postgres - Product catalog
 res_1jm4qw support-tickets postgres - Ticket history

resources get

Fetch one Resource by ID, including its schema and default seed.

datagen resources get <resource_id>

Arguments

ArgumentDescription
resource_idResource ID returned by create or list.

Flags

FlagTypeDefaultDescription
--formattext|jsontextOutput format.

resources create

Register a new Resource.

datagen resources create \
  --name "<name>" \
  --type <postgres|file_corpus> \
  [--mode <mode>] \
  [--schema "<json-or-path>"] \
  [--default-seed "<json-or-path>"] \
  [--metadata "<json-or-path>"] \
  [--description "<text>"]

Flags

FlagTypeDefaultDescription
--namestring(required)Human-readable name.
--typestring(required)postgres or file_corpus.
--modestringNoneRequired for file_corpus (local); must be omitted for postgres.
--schemaJSON or path{}Inline JSON or path to a JSON file describing the Resource schema (e.g. DDL metadata for Postgres).
--default-seedJSON or path{}Inline JSON or path to seed data applied to every Sandbox unless overridden.
--metadataJSON or path{}Inline JSON or path for free-form metadata.
--descriptionstringNoneShort description.
--formattext|jsontextOutput format.

Any flag that accepts JSON will treat its value as a file path if the file exists, otherwise as an inline JSON string. Values must parse to JSON objects (not arrays or scalars).

Example

$ datagen resources create \
    --name "prod-catalog-ro" \
    --type postgres \
    --schema ./schemas/catalog.json \
    --default-seed ./seeds/catalog-demo.json \
    --description "Product catalog, read-only mirror of prod."
resource_id: res_8kz23a
name: prod-catalog-ro
type: postgres

resources delete

Delete a Resource. Running datasets that reference it may be affected — the CLI prompts for confirmation unless --yes is set.

datagen resources delete <resource_id> [--yes]

Arguments

ArgumentDescription
resource_idResource ID to delete.

Flags

FlagTypeDefaultDescription
--yes, -yflagoffSkip the confirmation prompt.
--formattext|jsontextOutput format.

Example

$ datagen resources delete res_8kz23a -y
Deleted resource res_8kz23a.

resources templates

List built-in Resource templates. A template is a ready-made Resource shape — schemas, seed data, sensible defaults — you can materialize into a concrete Resource in one step.

datagen resources templates

Flags

FlagTypeDefaultDescription
--formattext|jsontextOutput format.

Example

$ datagen resources templates
                    Resource Templates
 Template Name Type Mode Description
 postgres-ecomm E-commerce postgres - Orders, SKUs, customers
 files-rag RAG corpus file_... local Markdown + PDF starter

resources materialize

Instantiate a template into a real Resource. Useful for quickly spinning up a realistic Resource for a first dataset before plumbing your own.

datagen resources materialize <template_name> [--name NAME] [--default-seed JSON] [--metadata JSON]

Arguments

ArgumentDescription
template_nameTemplate name from resources templates.

Flags

FlagTypeDefaultDescription
--namestringtemplate defaultOverride the resulting Resource name.
--default-seedJSON or pathtemplate defaultOverride seed data.
--metadataJSON or pathtemplate defaultOverride metadata.
--formattext|jsontextOutput format.

Example

$ datagen resources materialize postgres-ecomm --name "my-ecomm-sandbox"
resource_id: res_1jm4qw
name: my-ecomm-sandbox
type: postgres

Once the Resource exists, any dataset brief that needs it will bind to it automatically. See Resources and sandboxes for the full model.