fix(dx-4439): Show human-readable prompts in interactive mode after command correction v2-dev#2444
Closed
harshithad0703 wants to merge 5 commits intov2-devfrom
Closed
fix(dx-4439): Show human-readable prompts in interactive mode after command correction v2-dev#2444harshithad0703 wants to merge 5 commits intov2-devfrom
harshithad0703 wants to merge 5 commits intov2-devfrom
Conversation
fix: lockfile updated
When an invalid command is corrected (e.g. loginasda → login), init had run with the invalid command so context.messageFilePath was never set. Interactive prompts then showed i18n keys instead of messages (e.g. Enter your email address). - Add prerun hook init-context-for-command that re-builds context and re-initializes messageHandler/cliux/SDKs when messageFilePath is missing and the actual command id is available (e.g. auth:login). - Register the hook as the first prerun hook. Made-with: Cursor
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
aman19K
approved these changes
Mar 4, 2026
Contributor
Author
|
closing this PR, will create new branch and raise PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Interactive prompts after command correction: When an invalid command is corrected (e.g.
csdx loginasda→ "Did you mean login?" → Yes), the CLI shows i18n keys (e.g.CLI_AUTH_LOGIN_ENTER_EMAIL_ADDRESS) instead of user-friendly text (e.g. "Enter your email address").Logout confirmation message: When the user answers No to "Are you sure you want to log out?", the CLI still shows "SUCCESS: You're already logged out", which is incorrect—the user chose not to log out and remains logged in.
Solution
1. Human-readable prompts after command correction
init-context-for-command: Whencontext.messageFilePathis missing and the current command id is available (e.g. after correction), re-buildCsdxContextfor that command and re-initializemessageHandler,cliux, and SDK initiators so the correct plugin message file is loaded.2. Correct message when user cancels logout
CLI_AUTH_LOGOUT_CANCELLED: "Log out cancelled".auth:logout, when the user answers No to the confirmation and is still authenticated, show "Log out cancelled" instead of "You're already logged out". "You're already logged out" is now only shown when the user is actually not authenticated.Testing
Interactive prompts (command correction):
csdx loginasda(ornode bin/run.js loginasdafrompackages/contentstack).Logout cancel:
csdx auth:loginand log in.csdx auth:logout, answer No to the confirmation.csdx whoamito confirm you are still logged in.