Although the AWS CLI is a great resource to manage your AWS-powered services, it's tough to remember usage of:
SAWS
aims to supercharge the AWS CLI with features focusing on:
Under the hood, SAWS
is powered by the AWS CLI and supports the same commands and command structure.
SAWS
and AWS CLI
Usage:
aws <command> <subcommand> [parameters] [options]
SAWS
features:
SAWS
is available for Mac, Linux, Unix, and Windows.
You can control which theme to load for syntax highlighting by updating your ~/.sawsrc file:
# Visual theme. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
# native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
# colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
theme = vim
SAWS
provides smart autocompletion as you type. Entering the following command will interactively list and auto-complete all subcommands specific only to ec2
:
aws ec2
In addition to the default commands, subcommands, and options the AWS CLI provides, SAWS
supports auto-completion of your AWS resources. Currently, bucket names, instance ids, and instance tags are included, with additional support for more resources under development.
Option for s3api
:
--bucket
Sample Usage:
aws s3api get-bucket-acl --bucket
Syntax for s3
:
s3://
Sample Usage:
aws s3 ls s3://
Note: The example below demonstrates the use of fuzzy resource completion:
Option for ec2
:
--instance-ids
Sample Usage:
aws ec2 describe-instances --instance-ids
aws ec2 ls --instance-ids
Note: The ls
command demonstrates the use of customizable shortcuts:
Option for ec2
:
--ec2-tag-key
--ec2-tag-value
Sample Usage:
aws ec2 ls --ec2-tag-key
aws ec2 ls --ec2-tag-value
Tags support wildcards with the *
character.
Note: ls
, --ec2-tag-value
, and --ec2-tag-key
demonstrate the use of customizable shortcuts:
Feel free to submit an issue or a pull request if you'd like support for additional resources.
The ~/.saws.shortcuts file contains shortcuts that you can modify. It comes pre-populated with several handy shortcuts out of the box. You can combine shortcuts with fuzzy completion for even less keystrokes. Below are a few examples.
List all EC2 instances:
aws ec2 ls
List all running EC2 instances:
aws ec2 ls --ec2-state running # fuzzy shortcut: aws ecstate
List all EC2 instances with a matching tag (supports wildcards *
):
aws ec2 ls --ec2-tag-key # fuzzy shortcut: aws ectagk
aws ec2 ls --ec2-tag-value # fuzzy shortcut: aws ectagv
List EC2 instance with matching id:
aws ec2 ls --instance-ids # fuzzy shortcut: aws eclsi
List all DynamoDB tables:
aws dynamodb ls # fuzzy shortcut: aws dls
List all EMR clusters:
aws emr ls # fuzzy shortcut: aws emls
Add/remove/modify shortcuts in your ~/.saws.shortcuts file to suit your needs.
Feel free to submit:
To toggle fuzzy completion of AWS resources and shortcuts, use F3
key.
Sample fuzzy shortcuts to start and stop EC2 instances:
aws ecstop
aws ecstart
Note: Fuzzy completion currently only works with AWS resources and shortcuts.
SAWS
supports Fish-style auto-suggestions. Use the right arrow
key to complete a suggestion.
SAWS
allows you to execute shell commands from the saws>
prompt.
SAWS
keeps track of commands you enter and stores them in ~/.saws-history
. Use the up and down arrow keys to cycle through the command history.
SAWS
supports contextual command line help
and contextual web docs
.
The help
command is powered by the AWS CLI and outputs help within the command line.
Usage:
aws <command> <subcommand> help
Sometimes you're not quite sure what specific command/subcommand/option combination you need to use. In such cases, browsing through several combinations with the help
command line is cumbersome versus browsing the online AWS CLI docs through a web browser.
SAWS
supports contextual web docs with the docs
command or the F9
key. SAWS
will display the web docs specific to the currently entered command and subcommand.
Usage:
aws <command> <subcommand> docs
SAWS
supports a number of toolbar options:
F2
toggles output syntax highlightingF3
toggles fuzzy completion of AWS resources and shortcutsF4
toggles completion of shortcutsF5
refreshes resources for auto-completionF9
displays the contextual web docsF10
or control d
exits SAWS
SAWS
has been tested on Windows 7 and Windows 10.
On Windows, the .sawsrc file can be found in %userprofile%
. For example:
C:\Users\dmartin\.sawsrc
Although you can use the standard Windows command prompt, you'll probably have a better experience with either cmder or conemu.
SAWS
is hosted on PyPI. The following command will install SAWS
along with dependencies such as the AWS CLI:
$ pip install saws
You can also install the latest SAWS
from GitHub source which can contain changes not yet pushed to PyPI:
$ pip install git+https://github.com/donnemartin/saws.git
If you are not installing in a virtualenv, run with sudo
:
$ sudo pip install saws
Once installed, start SAWS
:
$ saws
It is recommended that you install Python packages in a virtualenv to avoid potential issues with dependencies or permissions.
To view SAWS
virtualenv
and Docker installation instructions, click here.
There is a known issue with Apple and its included python package dependencies (more info at https://github.com/pypa/pip/issues/3165). We are investigating ways to fix this issue but in the meantime, to install saws, you can run:
$ sudo pip install saws --upgrade --ignore-installed six
Configure your credentials with the AWS CLI:
$ aws configure
If you'd like to use a specific named profile with SAWS
, run the following commands on OS X, Linux, or Unix:
$ export AWS_DEFAULT_PROFILE=user1
$ saws
Or as a one-liner:
$ AWS_DEFAULT_PROFILE=user1 saws
Windows users can run the following commands:
> set AWS_DEFAULT_PROFILE=user1
> saws
Command line options for starting SAWS
with a specific profile are under development. For more details on how to install and configure the AWS CLI, refer to the following documentation.
Light testing indicates that SAWS
also seems to be compatible with Python 3.5.
Pypy3 is not supported due to lack of support from boto.
If you're interested in contributing to SAWS
, run the following commands:
$ git clone https://github.com/donnemartin/saws.git
$ pip install -e .
$ pip install -r requirements-dev.txt
$ saws
Continuous integration details are available on Travis CI.
Dependencies management details are available on Gemnasium.
Run unit tests in your active Python environment:
$ python tests/run_tests.py
Run unit tests with tox on multiple Python environments:
$ tox
Source code documentation is available on Readthedocs.org.
Run the following to build the docs:
$ scripts/update_docs.sh
Contributions are welcome!
Review the Contributing Guidelines for details on how to:
SAWS
under the hoodSAWS
SAWS
and for some handy utility functionsFeel free to contact me to discuss any issues, questions, or comments.
I am providing code and resources in this repository to you under an open source license. Because this is my personal repository, the license you receive to my code and resources is from me and not my employer (Facebook).
Copyright 2015 Donne Martin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
问题内容: 我经常不得不调试编写的Java代码,以便有一个接口和该接口的一个实现。 例如,将有一个接口Foo,其中有一个名为FooImpl的实现。在下面的代码中,如果我按住ctrl键单击doThings,则当我实际要转到FooImpl.java来查看实现时,它将跳至Foo.java。 当我结束界面时,必须使用ctrl-shift-r打开FooImpl。如果我可以按一下ctrl- alt并单击doT
问题内容: 首先,我不是要在这里发动战争。我非常了解Jersey,但是很少使用httpclient。 jersey-client和Apache的httpclient之间的主要区别是什么?在哪些方面比另一方面更好?哪里有比较好的图表?较大的文件(例如2048 MB)中,哪一个效果更好? 非常感谢您的评论! 问题答案: 这两件事可能不应该直接比较。Jersey是REST客户端,具有完整的JAX-RS实
问题内容: 我的应用程序中有两个表。左表就像一个列表。单击左表将打开一个右表,其中包含基于我单击左表的字段的值。 现在的问题是,如果我在右表中编辑一个单元格,而不按Enter键并单击左表中的新项目,则所有表中的特定单元格都处于可编辑模式。以及所有表格的单元格值。 我该如何解决这个问题? 问题答案: 不能完全肯定,我明白你的感受VS你所期望的,但表的默认行为是有点出乎意料的是,当焦点转到表外的某个地
问题内容: 如何使用google-api-java-client解析用户Google日历中事件的开始和结束时间? 从Google代码安装此示例android项目后,我可以进入Google日历并解析一些信息(例如所有日历,事件名称,发布时间和摘要),但是我无法终生获取事件的开始和结束时间。 我对代码的理解是这样的。 在主要活动类(CalendarAndroidSample.java)内,这是获取我每
问题内容: 我正在为小型LibGDX驱动的游戏编写服务器端代码,偶然发现了一个问题。每次尝试使用任何方法时,都会遇到。 显然这是因为我没有实现ApplicationListener,所以LibGDX尚未初始化。 有没有办法以无头/ CLI方式初始化LibGDX?我需要能够在服务器端加载TiledMap对象。 com.esotericsoftware.kryonet.Server $ 1.recei
问题内容: 我们正在尝试将声音集成到我们的一个项目中,我的团队成员没有收到此错误,而是在两台不同的机器上收到了此错误。 堆栈跟踪: 码: 我们从domainController调用此类 有谁知道如何解决此异常?我尝试重新安装编辑器软件(Eclipse),但无济于事。 预先感谢分配。 编辑 我们只是尝试切换声音文件。我们尝试使用较小的文件运行它。现在可以使用,但是一旦切换回较大的.wav文件(10
问题内容: 我在Web应用程序中使用Jersey 2.13检索数据异步。在某些情况下,请求需要一段时间(即执行复杂报告时,即EE)才能将响应返回给客户端。 当客户端不等待异步响应(离开页面,关闭浏览器等)时,将抛出ClientAbortException。此行为是预期的,但它使堆栈跟踪淹没了我的日志文件,因为在响应返回之前被取消的每个单个异步请求都会打印堆栈跟踪。 堆栈跟踪如下所示: 我也正在使用
问题内容: 我在Netbeans中的Java中创建了一个表,并在其中填充了一些数据。现在,我想在单击该单元格时在与行中的特定列相对应的文本区域中显示一些详细信息。如何使用事件侦听器找出单元用户已单击的位置。 问题答案: 找到点击事件的位置并获取要搜索的单元格: