Installation¶
Prerequisites¶
| Requirement | Version |
|---|---|
| Node.js | 18+ |
| npm / yarn / pnpm | any |
1. Install the CLI¶
Verify it works:
2. Create a new project¶
cdkx init detects your environment and scaffolds the project automatically: // (1)
✔ Created /my-project/tsconfig.json
✔ Created /my-project/src/main.ts
✔ Created /my-project/package.json
✔ Created /my-project/cdkx.json
Running yarn install...
✔ Done. Run 'cdkx synth' to get started.
The generated files:
Init modes
cdkx init automatically detects the context:
- Empty directory — creates all files from scratch
- Existing Node project — merges
package.json, skips files that already exist - Nx workspace — also creates a
project.jsonwith synth/deploy/destroy targets
3. Add a provider¶
The core package provides the construct primitives. To deploy real infrastructure, add a provider:
Each provider has its own setup guide with credentials and examples. See Providers.
4. Init options¶
| Option | Description |
|---|---|
[directory] |
Target directory (defaults to current directory) |
--name <name> |
Project name (defaults to directory name) |
--mode <mode> |
Force a mode: empty, existing, or nx |
--package-manager <pm> |
Force a package manager: yarn, npm, or pnpm |
--force |
Overwrite existing src/main.ts and tsconfig.json |
--no-install |
Skip the automatic package install step |