edgedb-cli
edgedb-cli copied to clipboard
Add a confirmation step to interactive CLI commands
This could be simple. Something like this for edgedb project init
:
Creating a new project named <project-name> with EdgeDB version <version>. Proceed? (Y/n)
and for edgedb instance create
:
Creating a new instance named <instance-name> with EdgeDB version <version>. Proceed? (Y/n)
I do notice in running project init
that we have a confirmation step at the beginning of the process:
Do you want to initialize a new project? [Y/n]
It seems a bit odd to bookend the process with confirmations on either side. I understand we probably do it at the beginning because we haven't found an existing project to initialize. Maybe instead of a confirmation step at the beginning, we could just log out what we've found:
No edgedb.toml file found. Creating a new project...
The user now understands why they are going through the interactive prompts for a new project. They can sigint if this isn't what they want or they can always respond n
to the confirmation at the end if they decide then they didn't want to create a new project.
Maybe instead of a confirmation step at the beginning, we could just log out what we've found:
Creating a new project is rare operation and should be taken with care. We can probably add more instructions such as: "if you have checked out existing project that uses edgedb, you should chdir there first" or something like that. Because it's likely that people who are using projects first time would be unaware that project init should be run from a directory with sources.
We might also to two more things
- Figure out if there is a
.git
directory (if it is, it's likely the right directory) - Add
--new
flag, to skip asking. This is mostly for running from template repositories.