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 |
--here | Scaffold 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 |
|---|---|
minimal | Default. A sample model + data, ready to push to Console. |
empty | A bare folder structure. You add your own data. |
existing | Pulls 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.
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 |
|---|---|
model | A dcupl model definition |
typescript | TypeScript types from a model |
json-schema | A JSON schema from a model |
transformer | A data transformer |
script | A script |
operator | A custom operator |
test | A test file |
test-setup | Test setup boilerplate |
test-config | Test 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 |
--register | Auto-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-run | Preview the output without writing files |