-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(REPL): poc for heroku REPL and prompt mode #3176
Open
justinwilaby
wants to merge
11
commits into
main
Choose a base branch
from
feature/interactive-prompt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This looks really 🔥 . I like how this takes advantage of oclif metadata to deliver value without plugin development overhead. I'm interested in learning how we can iterate on this to allow flexibility for plugin developers to provide their own prompt behavior. If this project goes down that path, I'd love to be an internal tester using our data plugins. 🤙 when the time comes |
4a8f384
to
c3e72a4
Compare
c3c00b6
to
eb8e5f6
Compare
zwhitfield3
reviewed
Jan 30, 2025
dd6baf6
to
1c32225
Compare
1c32225
to
eda9277
Compare
d80b2d4
to
fe2cd0e
Compare
000fcb1
to
388a1ae
Compare
388a1ae
to
9d01de9
Compare
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.
Heroku CLI REPL and Prompt Mode
This PR introduces two new interaction modes for the Heroku CLI:
Overview
REPL Mode
A new interactive shell experience that allows users to execute Heroku CLI commands continuously without needing to prefix each command with
heroku
. This mode maintains command history and supports tab completion for commands, flags, and common Heroku resources (apps, teams, spaces, etc.). Execution time for each command improves by up to 500% when using REPL.Prompt Mode
An interactive prompt mode that guides users through command execution by asking for required and optional inputs in a structured manner. This is particularly helpful for complex commands or when users are unsure about available options.
Testing Instructions
Testing REPL Mode
Start the REPL:
heroku # OR ./bin/run
Try basic commands:
Test tab completion:
app
and press TAB to see available app-related commands--app
followed by TAB to see your available appsteams:
followed by TAB to see team-related commandsTest command history:
history
to see command historyTest persistent settings:
Testing Prompt Mode
Test with app creation:
Test with add-ons:
Test with pipeline operations:
MCP Mode
The CLI supports a special Model Context Protocol (MCP) mode that can be enabled by setting the
HEROKU_MCP_MODE=true
environment variable. This mode modifies the output format to be more LLM-friendly:Testing MCP Mode
Enable MCP mode:
export HEROKU_MCP_MODE=true heroku
Execute commands in the REPL:
heroku > apps:list
Output will be wrapped with special markers:
Error handling:
When errors occur, they are wrapped in error markers:
MCP Mode Features
Key Features
set
andunset
commands)Notes
~/.heroku_repl_history
~/.heroku_repl_state
Future Considerations