Skip to content
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

Feature Request: start/stop/restart saved servers from CLI #30

Open
svicalifornia opened this issue Jun 24, 2022 · 1 comment
Open

Feature Request: start/stop/restart saved servers from CLI #30

svicalifornia opened this issue Jun 24, 2022 · 1 comment

Comments

@svicalifornia
Copy link

Currently hotel and chalet 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:

chalet start --name myapp
chalet stop --name myapp
chalet restart --name myapp

Optionally Tail Server Output

For start and restart, 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 via chalet 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:

"Server '<name>' is already running"

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, then start/stop/restart would manage the daemon, as they do now, so current usage of chalet start/stop/restart would not be affected in any way.

@svicalifornia
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant