-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
A more customisable CLI and REPL #3018
Comments
REPL was one of the best feature added for developer experience imo. Being able to have some models/classes pre-imported or adding custom utility objects would be great. I'd love to contribute too. |
The CLI bit I was planning for a long time. The how of it was always the concern, but I figured that out. Stay tuned. I like the REPL injection idea also. |
Yes! I'd love to work on it. I have some approaches in mind |
Excellent. What was your thought? It's going to be a bit of a challenge as you are diving deep into the process manager internals. Maybe ping me on the Discord server and we can brainstorm? |
Sure, lets connect on discord! I was not sure about the process manager here. I assumed REPL was running on the main process. Lines 183 to 186 in a575f5c
I was thinking If we could merge the user supplied variables with the currently available locals - super().__init__(locals=locals_available)
+ super().__init__(locals={**locals_available, **user_locals}) and generating the variable description to show dynamically. For the user API, I was thinking of something like from sanic import Sanic
app = Sanic(...)
# variable == module/class/object/callable
app.repl.add_local(variable, "<name>", "desc") |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
Sanic CLI currently has options for different run configurations.
Requested:
Usage can be similar to how inspector commands are created currently.
Sanic REPL currently provides 4 objects by default In the repl context.
Requested:
Thanks
Additional context
No response
The text was updated successfully, but these errors were encountered: