cdktf deploy fails in CI with "Error: Raw mode is not supported on the current process.stdin"
Fixes the cdktf deploy failure in non-interactive environments (Azure DevOps, CI agents) where the Ink-based UI needs a TTY. Covers passing --auto-approve to skip the interactive approval prompt. Use when deploy works locally but fails in a pipeline with the raw-mode error. Not for synth failures or approval logic issues.
TL;DR
Add --auto-approve to the deploy command in CI: cdktf deploy --auto-approve. The interactive approval prompt needs a TTY, which pipeline agents do not provide.
The error
Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.Fix it
- In your pipeline definition, change
cdktf deploytocdktf deploy --auto-approve(add the stack name too for multi-stack projects:cdktf deploy MyStack --auto-approve). - Re-run the pipeline and confirm deploy proceeds past the approval step.
Expected result: deploy plans and applies without trying to read from stdin.
When to use this
cdktf deployworks on your machine but fails in Azure DevOps, GitHub Actions, or any headless agent with the raw-mode error- Any
cdktfcommand that prompts for confirmation in an environment without a TTY
When NOT to use this
- The error appears on your local terminal (check that stdin is actually a TTY; something else is wrong)
- You want a human to review the plan in CI (split into
cdktf difffor review and a gateddeploy --auto-approve)
Root cause
The CDKTF CLI renders its interactive UI with Ink (React for CLIs), which puts stdin into raw mode to read keypresses. CI agents run without a TTY, so raw mode is unsupported and Ink throws. --auto-approve skips the confirmation prompt entirely, so stdin is never touched.
Edge cases
cdktf destroyhas the same prompt; it also accepts--auto-approve.- If your pipeline wraps cdktf in Docker, allocate no TTY (
docker runwithout-tis fine once --auto-approve is set).
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.