.ts file under the project root, and each define* call registers a resource as a side effect. There is no manifest — the files are the interface.
The full template
cargo-ai cdk init <dir> --template full scaffolds a complete, runnable workspace that exercises every resource type and wires them together. For a guided walkthrough that builds and deploys this whole tree, see the End-to-end recipe:
How the loader works
- Every
.tsfile is imported. Importing registers whateverdefine*calls it contains. To add a resource, add a file. - Handles create dependencies.
define*returns a handle whose outputs (uuid,datasetUuid, …) are deferred tokens. Passing a handle into another builder (e.g.dataset: hubspot,tools: [enrich]) both orders the deploy and injects the real uuid. The dependency graph is your variable graph. - Bundle directories are skipped. A subdirectory with its own
package.json(a worker or app bundle) is treated as content to upload, not a resource file to import.
cargo.state.json
Every deploy writes cargo.state.json — the authoritative map from each code resource (kind:slug) to the real uuid Cargo assigned it, plus outputs and a content hash.
The lock/backup/audit siblings are ephemeral — git-ignore them:
Which init do I want?
There are several scaffold/init commands — don’t confuse them:
| Command | What it does |
|---|---|
cargo-ai cdk init <dir> | Scaffold a CDK workspace project (this page). |
cargo-ai hosting app init <dir> | Scaffold a hosted Vite app bundle. |
cargo-ai hosting worker init <dir> | Scaffold a hosted edge worker bundle. |
cargo-ai init | An API call that fetches workspace initialization data — not a local scaffold. |
Next steps
Connectors
Start wiring in your data sources.
Deploying
The full reconcile lifecycle and its flags.
State & drift
How state tracks live resources and detects out-of-band changes.

