fix: multiple fixes to how REPL processes argv and autocomplete #3300
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.
All items except W-18564386, W-18564784 and W-18564887 have been fixed in REPL & Prompt Mode Fixes for Releasable State
Overview
This PR introduces enhancements and refactoring to the CLI's interactive prompt and REPL (Read-Eval-Print Loop) experience. The changes focus on improving user input handling, command completion, and error management, as well as streamlining the main CLI entry point for better maintainability and user experience.
Key Features
--repl
flag was added to enter REPL mode.Technical Details
heroku-prompts.js
now provides a more modular and robust set of prompt utilities, including support for required/optional inputs, file path validation, and boolean/choice prompts.promptUser
function is exported and used in the main CLI entry to collect user input interactively before command execution.heroku-repl.js
introduces a class-based REPL with improved command completion (including dynamic completions for flags/args), persistent session state, and command history.Testing Instructions
Prerequisites:
yarn install
).Test Scenarios:
--repl
flag (./bin/run --repl
). Verify the REPL starts, supports command history, and provides completions for commands, flags, and arguments.--prompt
flag (e.g.,heroku apps:create --prompt
). Verify that prompts appear for all required/optional inputs, including file paths and choices.Impact