CLI

Scaffolding & Code Generation

Stop writing boilerplate by hand. The dcupl CLI scaffolds entire projects and generates individual artifacts — models, TypeScript types, JSON schemas, transformers, scripts, operators, and tests — so you start from working files instead of an empty editor. You can even infer a model directly from a CSV or JSON data file.

Scaffold a project

Use dcupl init (alias dcupl new) with an optional [target] directory.

Flags

Flag Description
--name <str>Project name
--hereScaffold into the current directory
--starter <type>Starter: minimal, empty, or existing
--project-id <id>For existing: the cloud project to link
--api-key <key>For existing: API key for the project

Starters

Starter What you get
minimalDefault. A sample model + data, ready to push to Console.
emptyA bare folder structure. You add your own data.
existingPulls files from an existing Console project.

Generate a model from data

Infer a model from a data file. Preview it first with --dry-run, then --register it so a model and data resource are added to your dcupl.lc.json.

zsh — infer a model from products.csv

preview the inferred model — scan 200 rows, write nothing: dcupl generate model --from products.csv --name Product \ --sample-size 200 --dry-run — output: { "key": "Product", "keyProperty": "id", "properties": { "id": "string", "productName": "string", "price": "string", "category": "string" } } # dry run — no files written

looks right — generate for real and register it: dcupl generate model --from products.csv --name Product --register — output: ✓ Wrote dcupl/models/product.dcupl.json ✓ Registered Product + data resource in dcupl.lc.json

When inferring from CSV, columns default to string types. Use --sample-size to scan more rows for better inference, and prefer explicit, hand-tuned models when you need reliable numeric handling. Some generate subcommands are interactive and need a TTY.

Generate artifacts

Use dcupl generate [type] to scaffold individual artifacts inside an existing project.

Types

Type Generates
modelA dcupl model definition
typescriptTypeScript types from a model
json-schemaA JSON schema from a model
transformerA data transformer
scriptA script
operatorA custom operator
testA test file
test-setupTest setup boilerplate
test-configTest configuration

Key flags

Flag Description
--name <str>Name of the artifact (e.g. the model name)
--file-name <str>Override the generated file name
--from <file>Infer a model from a CSV, JSON, or NDJSON file
--registerAuto-add the model + data resource to dcupl.lc.json
--key-property <str>Override the inferred key (comma-separate for composite)
--sample-size <n>Rows to scan when inferring a schema
--dry-runPreview the output without writing files

Derive types & schemas from a model

Scaffold a transformer, script, or operator