A supercharged AWS command line interface (CLI).
Although the AWS CLI is a great resource to manage your AWS-powered services, it's tough to remember usage of:
SAWSaims to supercharge the AWS CLI with features focusing on:
Under the hood,
SAWSis powered by the AWS CLI and supports the same commands and command structure.
aws [parameters] [options]
SAWSis 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
SAWSprovides smart autocompletion as you type. Entering the following command will interactively list and auto-complete all subcommands specific only to
In addition to the default commands, subcommands, and options the AWS CLI provides,
SAWSsupports auto-completion of your AWS resources. Currently, bucket names, instance ids, and instance tags are included, with additional support for more resources under development.
aws s3api get-bucket-acl --bucket
aws s3 ls s3://
Note: The example below demonstrates the use of fuzzy resource completion:
aws ec2 describe-instances --instance-ids aws ec2 ls --instance-ids
lscommand demonstrates the use of customizable shortcuts:
aws ec2 ls --ec2-tag-key aws ec2 ls --ec2-tag-value
Tags support wildcards with the
--ec2-tag-keydemonstrate 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
Sample fuzzy shortcuts to start and stop EC2 instances:
aws ecstop aws ecstart
SAWSsupports Fish-style auto-suggestions. Use the
right arrowkey to complete a suggestion.
SAWSallows you to execute shell commands from the
SAWSkeeps track of commands you enter and stores them in
~/.saws-history. Use the up and down arrow keys to cycle through the command history.
SAWSsupports contextual command line
helpand contextual web
helpcommand is powered by the AWS CLI and outputs help within the command line.
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
helpcommand line is cumbersome versus browsing the online AWS CLI docs through a web browser.
SAWSsupports contextual web docs with the
docscommand or the
SAWSwill display the web docs specific to the currently entered command and subcommand.
SAWSsupports a number of toolbar options:
F2toggles output syntax highlighting
F3toggles fuzzy completion of AWS resources and shortcuts
F4toggles completion of shortcuts
F5refreshes resources for auto-completion
F9displays the contextual web docs
SAWShas been tested on Windows 7 and Windows 10.
On Windows, the .sawsrc file can be found in
%userprofile%. For example:
SAWSis hosted on PyPI. The following command will install
SAWSalong with dependencies such as the AWS CLI:
$ pip install saws
You can also install the latest
SAWSfrom 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 pip install saws
Once installed, start
virtualenvand 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
SAWSwith 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
SAWSalso seems to be compatible with Python 3.5.
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:
Source code documentation is available on Readthedocs.org.
Run the following to build the docs:
Contributions are welcome!
Review the Contributing Guidelines for details on how to:
SAWSunder the hood
SAWSand for some handy utility functions
Feel 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
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.