Open svicalifornia opened 2 years ago
I just realized/remembered that the add
and run
commands use the name of the current directory as the server name if the -n
/--name
option is not given. This makes me think it might be better to add new CLI commands for the behaviors described above, such as start-server
/stop-server
/restart-server
. However, those look awkward, and newcomers to hotel
/chalet
would likely get confused between the daemon commands (e.g. start
) and these server commands.
I'm open to alternative ideas for command syntax, but I still think it's highly desirable to be able to start/stop/restart servers and to see their log output from the CLI.
Currently
hotel
andchalet
allow a user/developer to start/stop each saved server from the daemon's web app (localhost:2000).I would like to be able to start/stop/restart a saved server via the
chalet
CLI, as shown here:Optionally Tail Server Output
For
start
andrestart
, I would like an option (enabled via a new CLI option such as--listen
) to output the server's logs to STDOUT, so that I could run these commands from a terminal window (or VS Code terminal) and see the server logs right there. This listening/tailing of the server logs could be terminated by SIGTERM or SIGINT (ctrl-C), ending the CLI process and returning to the shell, but keeping the server running (until stopped in the Chalet daemon web app or viachalet stop --name myapp
).If Server Already Running
Running the
start
command and specifying a server that is already running should cause an error message to be emitted to STDERR:However, if the
--listen
option is given, then the CLI process should output the server's logs to STDOUT and continue to tail the logs until terminated by SIGTERM or SIGINT (ctrl-C).Preserve Current Daemon Management via start/stop/restart
If the
-n
/--name
argument is omitted, thenstart
/stop
/restart
would manage the daemon, as they do now, so current usage ofchalet start
/stop
/restart
would not be affected in any way.