-
Notifications
You must be signed in to change notification settings - Fork 227
feat(REPL):Heroku REPL and prompt mode #3176
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
Conversation
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
dd6baf6
to
1c32225
Compare
1c32225
to
eda9277
Compare
d80b2d4
to
fe2cd0e
Compare
* Adding AI plugin core dependency * Bumping plugin-ai dependency to v1.0.1
94684cf
to
144aa06
Compare
* fix: multiple fixes to how REPL processes argv and autocomplete * Added --repl flag * ignore empty lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaving just a couple caveats to be aware of and follow up later, probably, moreover when this will be released as Core CLI on our following release.
Heroku CLI REPL and Prompt Mode
PRD
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