typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 422 forks source link

multiple commands per projects #137

Open benavern opened 8 years ago

benavern commented 8 years ago

Hi! I realy like hotel, but one of the big problemes I see is that I can specify only one command on a project.

I would like to know if I would be possible to put multiple commands for a project like I do in my package.json files (npm)

You could then have a sort of dropdown of whatever to choose a command and maybe specify a default one.

Thank you in advance, regards

typicode commented 8 years ago

Hi @benavern,

Good question and suggestion. I'd rather keep it simple. I fear that with multiple commands, it would make the CLI and interface much more complicated. The CLI would need to operate at project level and/or command level.

Would any of these solutions work for you?

1 Use custom names

hotel add 'cmd1' --name app1
hotel add 'cmd2' --name app2

2 Use subdomains

hotel add 'cmd1' --name cmd1.app
hotel add 'cmd2' --name cmd2.app

3 define multiple hotel commands in package.json

{
  "scripts": {
    "activate1": "hotel add cmd1",
    "activate2": "hotel add cmd2"
  }
}

And then in your terminal

$ npm run activate1
$ npm run activate2

4 Add commands to hotel

You don't have to add only servers to hotel, you can also add commands:

hotel add 'hotel add cmd1' --name 'project:activate1'
hotel add 'hotel add cmd2' --name 'project:activate2'

This is maybe what is the closest to your idea. It's not a dropdown, but you can use them to switch between multiple commands for one project from hotel interface.

benavern commented 8 years ago

I like the idea that hotel could read the package.json and provide a switch button for each script it finds inside.

something like this : image

The cli could be very similar : when hotel add is called it adds a command rather than overriding. The same way, hotel rm removes a command rather than deleting the project & when there are no commands left, no project appears in the hotel GUI