Git Product home page Git Product logo

aws-shell's Introduction

aws-shell - The interactive productivity booster for the AWS CLI

image

Installation

The aws-shell requires python and pip to install. You can install the aws-shell using pip:

$ pip install aws-shell

If you are not installing into a virtualenv you can run:

$ sudo pip install aws-shell

Mac OS X (10.11 El Capitan) users: There is a known issue with Apple and its included python package dependencies (more info at pypa/pip#3165). We are investigating ways to fix this issue but in the meantime, to install the aws-shell, you can run: sudo pip install aws-shell --upgrade --ignore-installed six

Once you've installed the aws-shell, you can now run:

$ aws-shell

To exit the shell, press Ctrl-D.

Upgrading the aws-shell

If you want to upgrade to the latest version of the aws-shell, you can run:

$ pip install --upgrade aws-shell

You can also use this upgrade command whenever a new version of the AWS CLI is released that includes new services and API updates. You will then be able to use these new services and API updates in the aws-shell.

Supported Python Versions

The aws-shell works on the same python versions supported by the AWS CLI:

  • 2.6.5 and greater
  • 2.7.x and greater
  • 3.3.x and greater
  • 3.4.x and greater

Configuration

The aws-shell uses the same configuration settings as the AWS CLI. If you've never used the AWS CLI before, the easiest way to get started is to run the configure command:

$ aws-shell
aws> configure
AWS Access Key ID [None]: your-access-key-id
AWS Secret Access Key [None]: your-secret-access-key
Default region name [None]: region-to-use (e.g us-west-2, us-west-1, etc).
Default output format [None]:
aws>

For more information about configure settings, see the AWS CLI Getting Started Guide.

Basic Usage

The aws-shell accepts the same commands as the AWS CLI, except you don't need to provide the aws prefix. For example, here are a few commands you can try:

$ aws-shell
aws> ec2 describe-regions
{
    "Regions": [
        {
            "Endpoint": "ec2.eu-west-1.amazonaws.com",
            "RegionName": "eu-west-1"
        },
        ...
aws> s3 ls
2015-12-07 15:03:34 bucket1
2015-12-07 15:03:34 bucket2
aws> dynamodb list-tables --output text
TABLENAMES     First
TABLENAMES     Second
TABLENAMES     Third

Profiles

The aws-shell supports AWS CLI profiles. You have two options to use profiles. First, you can provide a profile when you start the aws-shell:

$ aws-shell --profile prod
aws>

When you do this all the server side completion as well as CLI commands you run will automatically use the prod profile.

You can also change the current profile while you're in the aws-shell:

$ aws-shell
aws> .profile demo
Current shell profile changed to: demo

You can also check what profile you've configured in the aws-shell using:

aws> .profile
Current shell profile: demo

After changing your profile using the .profile dot command, all server side completion as well as CLI commands will automatically use the new profile you've configured.

Features

Auto Completion of Commands and Options

The aws-shell provides auto completion of commands and options as you type.

image

Shorthand Auto Completion

The aws-shell can also fill in an example of the shorthand syntax used for various AWS CLI options:

image

Server Side Auto Completion

The aws-shell also leverages boto3, the AWS SDK for Python, to auto complete server side resources such as Amazon EC2 instance Ids, Amazon Dynamodb table names, AWS IAM user names, Amazon S3 bucket names, etc.

This feature is under active development. The list of supported resources continues to grow.

image

Fuzzy Searching

Every auto completion value supports fuzzy searching. This enables you to specify the commands, options, and values you want to run with even less typing. You can try typing:

  • The first letter of each sub word: ec2 describe-reserved-instances-offerings -> ec2 drio
  • A little bit of each word: ec2 describe-instances -> ec2 descinst
  • Any part of the command: dynamodb table -> Offers all commands that contain the subsequence table.

image

Inline Documentation

The aws-shell will automatically pull up documentation as you type commands. It will show inline documentation for CLI options. There is also a separate documentation panel that will show documentation for the current command or option you are typing. Pressing F9 will toggle focus to the documentation panel allowing you to navigate it using your selected keybindings.

image

Fish-Style Auto Suggestions

The aws-shell supports Fish-style auto-suggestions. Use the right arrow key to complete a suggestion.

image

Command History

The aws-shell records the commands you run and writes them to ~/.aws/shell/history. You can use the up and down arrow keys to scroll through your history.

image

Toolbar Options

The aws-shell has a bottom toolbar that provides several options:

  • F2 toggles between fuzzy and substring matching
  • F3 toggles between VI and Emacs key bindings
  • F4 toggles between single and multi column auto completions
  • F5 shows and hides the help documentation pane
  • F9 toggles focus between the cli and documentation pane
  • F10 or Ctrl-D exits the aws-shell

As you toggle options in the toolbar, your preferences are persisted to the ~/.aws/shell/awsshellrc file so that the next time you run the aws-shell, your preferences will be restored.

image

Dot Commands

The aws-shell provides additional commands specific to the aws-shell. The commands are available by adding the . prefix before a command.

Exiting the Shell

You can run the .exit or .quit commands to exit the shell.

Creating Shell Scripts with .edit

There are times when you may want to take a sequence of commands you've run in the aws-shell and combine them into a shell script. In addition to the command history that's persisted to the history file, the aws-shell also keeps track of all the commands you've run since you first started your aws-shell session.

You can run the .edit command to open all these commands in an editor. The aws-shell will use the EDITOR environment variable before defaulting to notepad on Windows and vi on other platforms.

aws> ec2 describe-instances
aws> dynamodb list-tables
aws> .edit

Changing Profiles with .profile

You can change the current AWS CLI profile used by the aws-shell by using the .profile dot command. If you run the .profile command with no arguments, the currently configured shell profile will be printed.

aws> .profile demo
Current shell profile changed to: demo
aws> .profile
Current shell profile: demo

.cd

You can change the current working directory of the aws-shell by using the .cd command:

aws> !pwd
/usr
aws> .cd /tmp
aws> !pwd
/tmp

Executing Shell Commands

The aws-shell integrates with other commands in several ways. First, you can pipe AWS CLI commands to other processes as well as redirect output to a file:

aws> dynamodb list-tables --output text | head -n 1
TABLENAMES     First
aws> dynamodb list-tables --output text > /tmp/foo.txt

Second, if you want to run a shell command rather than an AWS CLI command, you can add the ! prefix to your command:

aws> !ls /tmp/
foo.txt                                    bar.txt

Developer Preview Status

The aws-shell is currently in developer preview. We welcome feedback, feature requests, and bug reports. There may be backwards incompatible changes made in order to respond to customer feedback as we continue to iterate on the aws-shell.

More Information

Below are miscellaneous links for more information:

aws-shell's People

Contributors

benoit-sedoni avatar candide-guevara avatar clifflu avatar donnemartin avatar edwardbetts avatar jamesls avatar jogusd avatar jonathanslenders avatar jordonphillips avatar quiver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-shell's Issues

Integrate SAWS

Here's a first cut at integrating SAWS into aws-shell.

  • Styled autocompletion menus
  • Bottom toolbar options
    • Placeholder options for now, curious what others think might be good options
  • New fish-style completions

Imgur

How do I navigate the documentation panel?

When I type ec2 run-instances, I get the documentation panel on the bottom of the screen, as pictured here:
documentation-panel

How do I scroll/page up/down in the documentation panel? Default Emacs binding for scroll-other-window (C-M-v) and scroll-other-window-down (C-M-S-v) are not working for me.

ImportError: No module named 'tests' running unit tests

====================================================================================== ERRORS =======================================================================================
_____________________________________________________________________ ERROR collecting tests/unit/test_utils.py _____________________________________________________________________
tests/unit/test_utils.py:1: in <module>
    from tests import unittest
E   ImportError: No module named 'tests'
_______________________________________________________________ ERROR collecting tests/unit/index/test_completions.py _______________________________________________________________
tests/unit/index/test_completions.py:1: in <module>
    from tests import unittest
E   ImportError: No module named 'tests'

Add support for autocompleting/manipulating --query argument

Not sure exactly what this would look like, but I want to:

a) Attempt to autocomplete the JMESPath expression for --query. This seems tough.
b) Live update in a vsplit/hsplit pane the result of applying the query expression provided so far against sample generated output.

I demo'd a POC of this with vim + jpterm at re:Invent, would like to have a similar feature as well.

Add option to show help pane on the right side

e1ven

It provides help, but since it's the bottom half of the window, it's often scrolling off the screen, and can't be easily read. Perhaps putting on the right 50% of the screen would help? For instance, try ec2 describe-instances --filters .. Most of the filter syntax isn't displayed.

Reddit Source

ImportError: cannot import name 'loaders' on startup

@jamesls I don't see the loaders module included in f709ba0, seems to be causing this issue:

$ aws-shell
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell3/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "/Users/donnemartin/.virtualenvs/aws-shell3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/donnemartin/.virtualenvs/aws-shell3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/Users/donnemartin/.virtualenvs/aws-shell3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/Users/donnemartin/.virtualenvs/aws-shell3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/__init__.py", line 12, in <module>
    from awsshell import loaders
ImportError: cannot import name 'loaders'

Support yum install, for non-Amazon Linux boxes

Although the feature request below names awscli, this might also appy to aws-shell.

tuxracer04

Trying to get AWS CLI to work on CentOS 5/6 non-AWS boxes took me a couple days (since I wasn't familiar all with the dependencies
(pip and python, issues with Centos5) (not a sysadmin either, or a python guy)
Feature request: yum install awscli, for non-Amazon Linux boxes por vavor..

Reddit Source

Ensure default editors per platform

Once EDITOR env var support is added, there needs to be reasonable defaults per platform. On posix we can default to vim, on windows we should default to notepad.

.Edit Not Working on Windows

I run the following:

aws-shell
ec2 describe-instances --profile myprofile
dynamodb list-tables --profile myprofile
.edit

The data returns, but Notepad opens with an error:


Notepad

The process cannot access the file because it is being used by another process.


OK

Press OK leaves Notepad empty.

aws-cli/1.9.9 Python/2.7.10 Windows/8 botocore/1.3.9

Recursion limit hit if autocompletion sees say string twice

If the autocompleter sees the same string twice, it will trigger an infinite recursion loop. This can be seen sometimes by quickly typing/backspacing characters.

Even simpler repo is if you hit tab with no chars. This will try to autocomplete twice with an empty string which triggers the bug.

Add toolbar menu to easily toggle between options

Toolbar Options

  • F2 toggles fuzzy completions
  • F3 toggles Vi and Emacs key bindings
  • F4 toggles single and multiple columns in the autocompletion menu
  • F5 toggles the help pane
  • F10 exits aws-shell

Fuzzy Toggle

Some users might want to turn off fuzzy matching. I sometimes toggle this depending on what I'm doing.

On a related note, I think the current fuzzy matching works pretty well, although in some cases it actually results in more keystrokes (#5). For example:

 aws> ec2 describe-inst

Fuzzy On

Imgur

Fuzzy Off

Imgur

Vi/Emacs Key Bindings

Currently aws-shell runs with Vibindings, which might not suit everyone. For SAWS and aws-shell personally I'm starting to use the Emacs mode more it feels more natural to me thinking of these apps as a command line tool rather than an editor.

TODO: With Vi bindings we might want to add info to let the user know what mode is active.

Imgur

Imgur

Single vs Multi Column Completion Menus

Some users might prefer the current multi column and others might prefer the single column. I prefer the latter it seems 'less busy' and more like what I'm accustomed to with other apps, although it could take some scrolling unlike the multi column option where you see pretty much everything.

prompt-toolkit also handles the meta info differently single vs multi. For single you see more meta right away, for multi, you only see meta for the currently highlighted completion. I've also applied pygments styles to the menu and meta, although the multi meta style doesn't seem to be taking hold.

Single Column

Imgur

Multi Column

Imgur

Single Column Meta

Imgur

Multi Column Meta

Imgur

Help Toggle

The help pane is really cool, although it does take up a lot of space. Users might not always want to see this menu--for example they might only want to see this for unfamiliar commands. Users might want to reclaim that screen real estate.

Menu On

Imgur

Menu Off

Imgur

Exit

To exit, Ctrl-D might not be obvious to some users.

Imgur

TODO

These options should probably go to a config file to save their state between sessions.

We could also make the toolbar content configurable if the number of options starts growing large.

S3 server side completions don't seem to be working

e1ven

It says it autocompletes s3 buckets, but it only seemed to using the history, not using a list of accessible buckets. I used s3 ls, and then s3 ls [bucketnames], and s3 ls s3://[bucketnames] and it wasn't autocompleting any of them.

interpeix

I have the same issue, not bucket completion.

Reddit Source

Add regions to the auto-complete

Would like to suggest adding the actual regions to the --region auto-complete (e.g. show us-east... and so on).

It would also be great to support the --region (and other options) in other places except after the service (e.g. also at the end).

Add lexer/syntax highlighting to visually distinguish the different components of a command

A lexer would make it easier to visually distinguish the different components of a command:

 aws [options] <command> <subcommand> [parameters]

Config File

Default theme: vim

# 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.
# to disable themes, set theme = none
theme = vim

Disable Syntax Highlighting

 theme = none

Sample: Dark Background

 theme = vim

Imgur

Samples: Light Background

 theme = vim

Note: My terminal colors are customized which might be why we see light gray for aws>.

Imgur

 theme = xcode

Imgur

Add auto suggest completions (fish-style) to more easily execute popular/recent commands

Suggest

Imgur

Complete Suggestion

You can use the right arrow key to complete a suggestion.

Imgur

TODO

This could also be a toolbar option.

For suggestions to be more effective I think we'd need to use a FileHistory instead of an InMemoryHistory which is persisted between sessions. Another option is to hook up to something more general like .bash_history.

We might need special handling for the .edit command if we switch to FileHistory as that could load a ton of history--maybe on aws-shell startup we can tag where we are in the history and only load from that checkpoint.

Notify user the doc index has completed

When the doc index build was blocking it was obvious when it was complete.

Now that it's in the background (much improved) you're not really sure when the full docs are available.

The toolbar might be a good place to show some info.

Installation Issue (Mac)

Forgive me if this is overly specific to my system, but I'm hoping for help with why installation is failing.

System info:

~/Desktop$ python --version
Python 2.7.10

~/Desktop$ pip --version   
pip 7.1.2 from /Library/Python/2.7/site-packages (python 2.7)

~$ xcodebuild -version 
Xcode 7.1.1
Build version 7B1005

~/Desktop$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.2 (15C50)
      Kernel Version: Darwin 15.2.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Elizabeth
      User Name: Ross Dakin (rossdakin)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 20:12

Error (without sudo):

~/Desktop$ pip install aws-shell     
Collecting aws-shell
Collecting prompt-toolkit==0.52 (from aws-shell)
  Using cached prompt_toolkit-0.52-py2-none-any.whl
Collecting configobj>=5.0.6 (from aws-shell)
Collecting boto3>=1.2.1 (from aws-shell)
  Using cached boto3-1.2.2-py2.py3-none-any.whl
Collecting awscli<2.0.0,>=1.8.9 (from aws-shell)
  Using cached awscli-1.9.13-py2.py3-none-any.whl
Collecting six>=1.9.0 (from prompt-toolkit==0.52->aws-shell)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pygments (from prompt-toolkit==0.52->aws-shell)
  Using cached Pygments-2.0.2-py2-none-any.whl
Collecting wcwidth (from prompt-toolkit==0.52->aws-shell)
  Using cached wcwidth-0.1.5-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.2.1->aws-shell)
  Using cached jmespath-0.9.0-py2.py3-none-any.whl
Collecting futures==2.2.0 (from boto3>=1.2.1->aws-shell)
  Using cached futures-2.2.0-py2.py3-none-any.whl
Collecting botocore<1.4.0,>=1.3.0 (from boto3>=1.2.1->aws-shell)
  Using cached botocore-1.3.13-py2.py3-none-any.whl
Collecting rsa<=3.3.0,>=3.1.2 (from awscli<2.0.0,>=1.8.9->aws-shell)
  Using cached rsa-3.2.3-py2.py3-none-any.whl
Collecting colorama<=0.3.3,>=0.2.5 (from awscli<2.0.0,>=1.8.9->aws-shell)
Collecting docutils>=0.10 (from awscli<2.0.0,>=1.8.9->aws-shell)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.4.0,>=1.3.0->boto3>=1.2.1->aws-shell)
  Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.3.0,>=3.1.2->awscli<2.0.0,>=1.8.9->aws-shell)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Installing collected packages: six, pygments, wcwidth, prompt-toolkit, configobj, jmespath, futures, python-dateutil, docutils, botocore, boto3, pyasn1, rsa, colorama, awscli, aws-shell
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/ff/c957cg417pzf3lszspjvm_880000gp/T/pip-7hp43W-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

Error (with sudo):

~/Desktop$ sudo pip install aws-shell
The directory '/Users/rossdakin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/rossdakin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting aws-shell
Collecting prompt-toolkit==0.52 (from aws-shell)
  Downloading prompt_toolkit-0.52-py2-none-any.whl (188kB)
    100% |████████████████████████████████| 188kB 828kB/s 
Collecting configobj>=5.0.6 (from aws-shell)
Collecting boto3>=1.2.1 (from aws-shell)
  Downloading boto3-1.2.2-py2.py3-none-any.whl (106kB)
    100% |████████████████████████████████| 106kB 1.0MB/s 
Collecting awscli<2.0.0,>=1.8.9 (from aws-shell)
  Downloading awscli-1.9.13-py2.py3-none-any.whl (848kB)
    100% |████████████████████████████████| 851kB 591kB/s 
Collecting six>=1.9.0 (from prompt-toolkit==0.52->aws-shell)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /packages/py2.py3/s/six/six-1.10.0-py2.py3-none-any.whl
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting pygments (from prompt-toolkit==0.52->aws-shell)
  Downloading Pygments-2.0.2-py2-none-any.whl (672kB)
    100% |████████████████████████████████| 675kB 713kB/s 
Collecting wcwidth (from prompt-toolkit==0.52->aws-shell)
  Downloading wcwidth-0.1.5-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.2.1->aws-shell)
  Downloading jmespath-0.9.0-py2.py3-none-any.whl
Collecting futures==2.2.0 (from boto3>=1.2.1->aws-shell)
  Downloading futures-2.2.0-py2.py3-none-any.whl
Collecting botocore<1.4.0,>=1.3.0 (from boto3>=1.2.1->aws-shell)
  Downloading botocore-1.3.13-py2.py3-none-any.whl (2.1MB)
    100% |████████████████████████████████| 2.1MB 241kB/s 
Collecting rsa<=3.3.0,>=3.1.2 (from awscli<2.0.0,>=1.8.9->aws-shell)
  Downloading rsa-3.2.3-py2.py3-none-any.whl (44kB)
    100% |████████████████████████████████| 45kB 4.0MB/s 
Collecting colorama<=0.3.3,>=0.2.5 (from awscli<2.0.0,>=1.8.9->aws-shell)
Collecting docutils>=0.10 (from awscli<2.0.0,>=1.8.9->aws-shell)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.4.0,>=1.3.0->boto3>=1.2.1->aws-shell)
  Downloading python_dateutil-2.4.2-py2.py3-none-any.whl (188kB)
    100% |████████████████████████████████| 192kB 2.1MB/s 
Collecting pyasn1>=0.1.3 (from rsa<=3.3.0,>=3.1.2->awscli<2.0.0,>=1.8.9->aws-shell)
  Downloading pyasn1-0.1.9-py2.py3-none-any.whl
Installing collected packages: six, pygments, wcwidth, prompt-toolkit, configobj, jmespath, futures, python-dateutil, docutils, botocore, boto3, pyasn1, rsa, colorama, awscli, aws-shell
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-r9lpB9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

Fix fuzzy search algorithm

Example:

0.746429 dcli                 describe-reserved-instances-listings
0.298566 dcli                 describe-classic-link-instances

describe-classic-link-instances should be higher.

COC?

Hi,

I'm just wondering what your code of conduct is for this project?

Thanks,
Alison

Traceback encountered when running unknown dot command

$ aws-shell
aws> .foo
Traceback (most recent call last):
  File "aws-shell/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "aws-shell/awsshell/__init__.py", line 66, in main
    shell.run()
  File "aws-shell/awsshell/app.py", line 63, in run
    f.write(all_commands)
UnboundLocalError: local variable 'all_commands' referenced before assignment

Support profile switching

I'd like a built in command that allows me to switch profiles. By switching to a different profile, server side autocomplete should be updated to work with the new profile.

Remove the AWSCLIModelCompleter attribute from AWSShell.

Original discussion: https://github.com/awslabs/aws-shell/pull/45/files#diff-d0a45db8e5ed54b02374996d81926a8cR65

The model completer is also available via the .completer property on shellcomplete.AWSShellCompleter. I think I still have some refactoring to do to get all the various autocompleters more coherent.

My line of thinking was that the ShellCompleter is the only thing the app needs to interact with for anything completion related, and the ShellCompleter can proxy to the model completer and server side completer as needed. I don't think I have the abstractions 100% right yet, but ideally I'd like to be able to just say completer.match_fuzzy and then internally, the ShellCompleter can set the match_fuzzy attribute on the model completer.

We don't have to do this now, but I think it would simplify things by not requiring the AWSShell class to take in an additional param in its init.

Setup.py seems to be missing boto3

$ aws-shell
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell2/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/__init__.py", line 66, in main
    autocomplete.AWSCLIModelCompleter(index_data))
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/shellcomplete.py", line 31, in __init__
    server_side_completer = self._create_server_side_completer()
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/shellcomplete.py", line 35, in _create_server_side_completer
    import boto3.session
ImportError: No module named boto3.session

Fix with:

requires = [
    'awscli>=1.8.9,<2.0.0',
    'prompt-toolkit==0.50',
    'boto3>=1.2.1',  # added
]

Not requiring `aws` prefix seems to be causing confusion

Although it seems like e1ven is reporting broken commands, I think the following report actually shows some confusion with not having to prefix commands with aws. Muscle memory could be an issue for veteran users. Also, I'd suspect you won't always have aws-shell up (maybe you're ssh'd into multiple EC2 machines doing various things which might/might not include aws-cli-backed-commands). The command syntax difference between aws-cli and aws-shell could lead to confusion in these cases.

e1ven

Several commands don't seem to return what I'd expect. With the command line, "aws s3api list-buckets" gives me a list of buckets.. With the aws-shell, this gives me "aws: error: argument command: Invalid choice, valid choices are"..

Reddit Source

Note: s3api list-buckets works for me.

Reference other services' resources from server side completions

This is a feature request.

Usecase

elb attach-load-balancer-to-subnets API accepts

  • load-balancer-name(elb describe-loadbalancers)
  • subnet(ec2 describe-subnets)

and you want to autocomplete both parameters.

Problem

At completions-1.json, operation assumes you call API of the same service, and subnet retrieval API belongs to a different service(ec2), you cannot define subnet resource outside of ec2.

  "resources": {
    "Subnet": {
      "operation": "EC2:DescribeSubnets", <-- DOES NOT WORK 
      "resourceIdentifier": {
        "Id": "Subnets[].SubnetId"
      }
    }

Add progress status for long running commands

This request seems to be quite popular (measured by Reddit upvotes).

himynameisjoeyc

Hopefully they include some progress bars, time remaining and current operation info( also prays for indexes) on s3 api...

Reddit Source #1

himynameisjoeyc

Does this by chance include an S3 sync progress metric?

Reddit Source #2

Also relates to: #30

This might be more of an 'epic' that we eventually break out into smaller chunks.

Python 3 startup issues

I'll be plugging the holes as they pop up, here are the first three I've encountered:

$ aws-shell
First run, creating autocomplete index...
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell3/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/__init__.py", line 47, in main
    from awsshell.makeindex import write_index
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/makeindex.py", line 17
    print "Couldn't import awscli: pip install awscli"
                                                     ^
SyntaxError: Missing parentheses in call to 'print'
$ aws-shell
First run, creating autocomplete index...
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell3/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/__init__.py", line 47, in main
    from awsshell.makeindex import write_index
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/makeindex.py", line 8, in <module>
    from cStringIO import StringIO
ImportError: No module named 'cStringIO'
$ aws-shell
First run, creating autocomplete index...
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell3/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.0.1', 'console_scripts', 'aws-shell')()
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/__init__.py", line 48, in main
    write_index(index_file)
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/makeindex.py", line 72, in write_index
    index_command(current, help_command)
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/makeindex.py", line 47, in index_command
    metadata['minidoc'] = remove_html(arg_obj.documentation.split('\n')[0])
  File "/Users/donnemartin/Dev/github/forks/aws-shell/awsshell/utils.py", line 7, in remove_html
    s.feed(html)
  File "/Users/donnemartin/.pyenv/versions/3.4.3/lib/python3.4/html/parser.py", line 165, in feed
    self.goahead(0)
  File "/Users/donnemartin/.pyenv/versions/3.4.3/lib/python3.4/html/parser.py", line 198, in goahead
    if self.convert_charrefs and not self.cdata_elem:
AttributeError: 'DataOnly' object has no attribute 'convert_charrefs'

Windows doc gens show ^M chars

When generating docs on windows, newlines are rendered as '^M'. Need to track down where this \r\n behavior is being introduced.

Maintain history between sessions

I think losing my command history after closing a session is inconvenient. It's handy to be able to use the up arrow to cycle through previous commands.

With the new auto suggestions, this becomes more prevalent. For suggestions to be more effective I think we'd need to use a FileHistory instead of an InMemoryHistory which is persisted between sessions. Another option is to hook up to something more general like .bash_history.

We might need special handling for the .edit command if we switch to FileHistory as that could load a ton of history--maybe on aws-shell startup we can tag where we are in the history and only load from that checkpoint.

Add aws-shell to awesome-aws

Awesome AWS Awesome

A curated list of awesome AWS libraries, open source repos, guides, blogs, and other resources.

The Fiery Meter of AWSome

  • Repo with 0100+ Stars: 🔥
  • Repo with 0200+ Stars: 🔥🔥
  • Repo with 0500+ Stars: 🔥🔥🔥
  • Repo with 1000+ Stars: 🔥🔥🔥🔥
  • Repo with 2000+ Stars: 🔥🔥🔥🔥🔥

aws-shell does not work with prompt_toolkit==0.54.0

I get:

First run, creating autocomplete index...
Creating doc index in the background. It will be a few minutes before all documentation is available.
Traceback (most recent call last):
  File "/usr/local/bin/aws-shell", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/awsshell/__init__.py", line 63, in main
    shell.run()
  File "/usr/local/lib/python2.7/site-packages/awsshell/app.py", line 200, in run
    document = self.cli.run()
  File "/usr/local/lib/python2.7/site-packages/awsshell/app.py", line 193, in cli
    self._cli = self.create_cli_interface(self.show_completion_columns)
  File "/usr/local/lib/python2.7/site-packages/awsshell/app.py", line 367, in create_cli_interface
    display_completions_in_columns)
  File "/usr/local/lib/python2.7/site-packages/awsshell/app.py", line 335, in create_application
    key_bindings_registry=self.key_manager.manager.registry,
  File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/application.py", line 112, in __init__
    assert style is None or isinstance(style, Style)
AssertionError

On OS X 10.11.2; Homebrew Python 2.7.11

Refactor creation of the ~/.aws/shell/ directory

We might want to consolidate the places where we create the ~/.aws/shell/ directory (and sub directories). I count four separate locations now in the codebase (including this new call) where we are calling os.makedirs.

As initially discussed in #62.

When we do consolidate it seems cleaner to go with the try/catch approach vs the check/create approach. Here's a good StackOverflow post with details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.