aws-shell for windows

aws-cliはデフォルトではコマンド補完がされないのでaws-shellをインストールする方法がある。だが、Windows版は少し使いにくいように思う。

aws-shellをインストールするためにはpythonをインストールしておく。
python3をインストールしておけばpipを使ってaws-shellをインストールできる。

PS C:\Users\kaoru> C:\Users\kaoru\AppData\Local\Programs\Python\Python36\Scripts
PS C:\Users\kaoru> pip install aws-shell
Collecting aws-shell
Downloading aws-shell-0.1.1.tar.gz (53kB)
100% |████████████████████████████████| 61kB 3.9MB/s
Collecting awscli<2.0.0,>=1.10.30 (from aws-shell)
Downloading awscli-1.11.81-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 1.6MB/s
Collecting prompt-toolkit<1.1.0,>=1.0.0 (from aws-shell)
Downloading prompt_toolkit-1.0.14-py3-none-any.whl (248kB)
100% |████████████████████████████████| 256kB 3.3MB/s
Collecting boto3<2.0.0,>=1.2.1 (from aws-shell)
Downloading boto3-1.4.4-py2.py3-none-any.whl (127kB)
100% |████████████████████████████████| 133kB 6.6MB/s
Collecting configobj<6.0.0,>=5.0.6 (from aws-shell)
Downloading configobj-5.0.6.tar.gz
Collecting Pygments<3.0.0,>=2.1.3 (from aws-shell)
Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
100% |████████████████████████████████| 849kB 2.2MB/s
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading s3transfer-0.1.10-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB …
Collecting botocore==1.5.44 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading botocore-1.5.44-py2.py3-none-any.whl (3.4MB)
100% |████████████████████████████████| 3.5MB 525kB/s
Collecting PyYAML<=3.12,>=3.10 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 6.6MB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB …
Collecting docutils>=0.10 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading docutils-0.13.1-py3-none-any.whl (536kB)
100% |████████████████████████████████| 542kB 1.2MB/s
Collecting colorama<=0.3.7,>=0.2.5 (from awscli<2.0.0,>=1.10.30->aws-shell)
Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<1.1.0,>=1.0.0->aws-shell)
Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting six>=1.9.0 (from prompt-toolkit<1.1.0,>=1.0.0->aws-shell)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3<2.0.0,>=1.2.1->aws-shell)
Downloading jmespath-0.9.2-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.5.44->awscli<2.0.0,>=1.10.30->aws-shell)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 6.6MB/s
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli<2.0.0,>=1.10.30->aws-shell)
Downloading pyasn1-0.2.3-py2.py3-none-any.whl (53kB)
100% |████████████████████████████████| 61kB …
Installing collected packages: jmespath, docutils, six, python-dateutil, botocore, s3transfer, PyYAML, pyasn1, rsa, colorama, awscli, wcwidth, prompt-toolkit, boto3, configobj, Pyg
ments, aws-shell
Running setup.py install for PyYAML … done
Running setup.py install for configobj … done
Running setup.py install for aws-shell … done
Successfully installed PyYAML-3.12 Pygments-2.2.0 aws-shell-0.1.1 awscli-1.11.81 boto3-1.4.4 botocore-1.5.44 colorama-0.3.7 configobj-5.0.6 docutils-0.13.1 jmespath-0.9.2 prompt-to
olkit-1.0.14 pyasn1-0.2.3 python-dateutil-2.6.0 rsa-3.4.2 s3transfer-0.1.10 six-1.10.0 wcwidth-0.1.7

インストール後、aws-shellを呼び出す。

PS C:\Users\kaoru> aws-shell
First run, creating autocomplete index…
Creating doc index in the background. It will be a few minutes before all documentation is available.
aws>

初期設定はaws-cliから引き継いでくれるので、aws-cliでconfigureしていればここでは不要。

例えばec2と打ち込むと以下のように候補が出てくるので選択できる。また、インスタンスIDなども候補が出力される。