node-triton
node-triton copied to clipboard
"triton ssh" (w/ no arguments) to open ssh if only one running instance present?
This is probably a pattern that could work for several of the subcommands: If only a single running instance exists, assume that the user is referring to that.
Currently, most subcommands require your explicitely define the SHORTID of that one instance you want. Let me illustrate:
$ triton ls -H
a34f4174 packer-builder-singel-ubuntu-16.04 ubuntu-certified-16.04@20180109 running K 14m
$ triton ssh
triton instance ssh: error (Usage): missing INST arg
usage: triton instance ssh [-h] [USER@]INST [SSH-ARGUMENTS]
$ triton ssh a34f4174
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-108-generic x86_64)
Certified Ubuntu Cloud Image
<snip>
ubuntu@a34f4174-f330-e929-d12e-cfc3705dfb0d:~$
I'm proposing that it work more like this:
$ triton ls -H
a34f4174 packer-builder-singel-ubuntu-16.04 ubuntu-certified-16.04@20180109 running K 14m
$ triton ssh
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-108-generic x86_64)
Certified Ubuntu Cloud Image
<snip>
ubuntu@a34f4174-f330-e929-d12e-cfc3705dfb0d:~$