ct dev
Run live development workflows directly on cluster workloads from dev.ct (DevSpace-inspired flow).
ct dev executes dev.ct, applies rendered resources, then starts development features such as port forwarding, logs, file sync, and terminal according to your dev targets.
ct devct dev [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--env-file | string | ".env" | Path to .env file (empty string to skip) |
--context | string | (current) | Kubeconfig context to use |
--name | string | "dev" | Release name used for labels and inventory |
--delete | bool | false | Delete resources from the last dev inventory and exit |
Examples
Section titled “Examples”Start dev mode (looks for dev.ct in current directory):
ct devUse a custom env file:
ct dev --env-file .env.devSkip env file loading entirely:
ct dev --env-file ""Use a specific kubeconfig context:
ct dev --context stagingStart named dev session (multiple sessions in one namespace):
ct dev --name dev-aliceCleanup previously deployed dev resources:
ct dev --delete --name dev-alice --context stagingHow it works
Section titled “How it works”ct dev │ ├─ Load .env + system environment ├─ Bundle + execute dev.ct → extract config + dev targets ├─ Deep merge config.values with values.json ├─ Render main.ct with merged values ├─ Inject release labels (managed-by + instance) ├─ Resolve dev target selectors from rendered resources ├─ Patch workloads (remove probes, override command/env/replicas) ├─ Apply manifests to cluster (Server-Side Apply) ├─ Save release inventory │ └─ Start in parallel: ├─ Port forwarding (per target, with reconnect) ├─ File sync — local → container (tar + exec, fsnotify) ├─ Log streaming (colored per target) └─ Terminal auto-attach (first target with .terminal)Cleanup dev environment
Section titled “Cleanup dev environment”When --delete is used, ct dev runs cleanup flow only:
ct dev --delete │ ├─ Execute dev.ct to resolve namespace ├─ Load inventory for release (--name, default: dev) ├─ Delete resources from inventory └─ Delete inventory ConfigMapDev API reference
Section titled “Dev API reference”The dev.ct file uses four global functions to configure development mode. See the full API documentation:
dev()— declare dev targetsconfig()— set namespace and overlay valuesenv()&prompt()— environment variables and interactive prompts- CT Dev Overview — full dev mode documentation
See also
Section titled “See also”ct apply— apply without dev featuresct template— render manifests only