-
Notifications
You must be signed in to change notification settings - Fork 251
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
Make cargo shuttle init
interactive
#493
Comments
I'm happy to help out with this! Did you still want to keep the non-interactive route around? If so, do we want it to only be triggered when all arguments are specified (inc. name and path)? If not, would there be any point in keeping those parameters? |
Awesome, thanks @Procrat! Imo we can keep it around, it could be useful for programmatic calls and some users may prefer it over interactive cli. So currently the path is not required and the default is By the way, there are some great crates for interactive CLI's. I haven't used them myself yet, but I've seen them used in some good CLI's (like |
I agree. What would be really nice IMO is if any missing option or parameter is prompted and nothing gets prompted if all required parameters are given. That way |
Thanks for the input! I've made a repo with a toy version of the interactive flow here in case you already wanted to give it a go and give some early feedback. Just to make sure we're on the same page, the interactive and non-interactive versions behave quite differently here. Whereas the non-interactive one (as it is now) just performs actions locally, the interactive one will also log in and create the environment on Shuttle. It might be a bit confusing that the scope of the command changes based on a flag, but I can see it's user-friendly to do everything in one go. @oddgrd: I had already started with |
No opinion, feel free to use whichever crate fits best! That is a good point, originally the plan was to have just the boilerplate generation be interactive, so it would have been the same. I think tying it all together would be nice for the user though, like you said, so that |
That's a good point! My two cents on this: we could retrofit the new behavior to the original command and adjust my proposal somewhat. How about this: the user only needs to be logged in if they desire to create the new project straight away. So maybe in the non-interactive route we add an optional flag to create the project on shuttle ( @oddgrd makes a good point it may be simpler to break this up into two issues: making the existing behavior interactive (ignoring creation and authentication for now), and expanding the behavior of |
I checked out your repo now, and I think it looks really good already. Some neat details too, like the api-key being hidden and the dir being set to the name by default, nice! One point, and this is very subjective, is it better if we clear the terminal between prompts? |
Thanks for taking the time to think about this! That I don't feel strongly about clearing the terminal or not. Any opinions? At the moment, I didn't because I personally like to see the history of what I did in a terminal, but that's just one person's opinion 😄 |
Currently, to initialise a project with the right stub for different frameworks, we use
cargo shuttle init
with a set of mutually exclusive options (e.g.--axum
,--poem
etc).We'd like an interactive route into this where
cargo shuttle init
prompts:${project_name}.shuttleapp.rs
)The text was updated successfully, but these errors were encountered: