markwallsgrove / ec2.cli

Generate SSH aliases for EC2 machines
3 stars 1 forks source link

Connect to multiple instances #19

Open kiyanwang opened 8 years ago

kiyanwang commented 8 years ago

It would be nice to do something like

$ ae ssh babel-*

and have ae launch ( or spit out ) some config that we can create wrappers around that could launch multiple windows, tmux panes etc.

markwallsgrove commented 8 years ago

How about using --cmd to output a list of commands that would have been executed:

ae ssh --cmd babel-*

output

ssh -i ~/.ssh/cert mw@host1
ssh -i ~/.ssh/cert mw@host2
ssh -i ~/.ssh/cert mw@host3

It would then be trivial to use xargs to execute each command.

markwallsgrove commented 8 years ago

I am re-considering my proposal. The user should be able to define the command that is executed once the subset of hosts has been defined by using the tab completion.

ec2.cli cmd "tmux split-window 'ssh -i {cert} {user}@{host}'" babel-

@kiyanwang any thoughts?

kiyanwang commented 8 years ago

@markwallsgrove yeah I like that its easier to understand and provides an incredible amount of flexibility.

An interesting point to consider: do you want to let people store the templates for these commands in their config as a kind of alias?