Skip to content

feat(cli): improve interactive prompt UI with @clack/prompts#1370

Open
mrgrain wants to merge 7 commits intomainfrom
mrgrain/refactor/cli/replace-promptly-enquirer-with-clack
Open

feat(cli): improve interactive prompt UI with @clack/prompts#1370
mrgrain wants to merge 7 commits intomainfrom
mrgrain/refactor/cli/replace-promptly-enquirer-with-clack

Conversation

@mrgrain
Copy link
Copy Markdown
Contributor

@mrgrain mrgrain commented Apr 14, 2026

Improves the interactive CLI experience for deploy approvals, text prompts, and the flags command by adopting @clack/prompts — a modern, actively maintained prompt library with beautiful default styling.

The CLI previously relied on promptly and enquirer for user interaction, both of which are unmaintained and produce plain, unstyled output. @clack/prompts provides a consistent, visually polished prompt experience out of the box, with clear confirmation dialogs, styled select menus, and proper cancellation handling via Ctrl+C.

Beyond the immediate UI improvements, this also lays the groundwork for richer CLI interactions in the future. @clack/prompts ships with spinner, taskLog, and structured logging utilities that can be used to improve deploy progress, asset upload feedback, and other long-running operations.

Before / After

Deploy approval

Before

After

Flags interactive menu

Before

After

Text input

Before

After


Since @clack/prompts is an ESM-only package and Jest runs in CJS mode, a global mock file is provided at test/_helpers/mock-clack-prompts.js. This is appropriate because prompt functions are inherently interactive and should always be mocked in tests. The bundled CLI binary is unaffected since esbuild handles ESM→CJS interop at build time.

Fixes #

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version: N/A — this replaces two packages with a new one, not an upgrade

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Apr 14, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 14, 2026 16:42
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 72.88136% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.20%. Comparing base (7ce6a36) to head (a06c7e8).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../aws-cdk/lib/commands/flags/interactive-handler.ts 64.51% 11 Missing ⚠️
packages/aws-cdk/lib/cli/io-host/cli-io-host.ts 82.14% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1370      +/-   ##
==========================================
- Coverage   88.31%   88.20%   -0.12%     
==========================================
  Files          74       74              
  Lines       10430    10458      +28     
  Branches     1427     1432       +5     
==========================================
+ Hits         9211     9224      +13     
- Misses       1191     1206      +15     
  Partials       28       28              
Flag Coverage Δ
suite.unit 88.20% <72.88%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants