awslabs / aws-shell Goto Github PK
View Code? Open in Web Editor NEWAn integrated shell for working with the AWS CLI.
License: Apache License 2.0
An integrated shell for working with the AWS CLI.
License: Apache License 2.0
"exit" should be a .command
This is a feature request.
elb attach-load-balancer-to-subnets
API accepts
elb describe-loadbalancers
)ec2 describe-subnets
)and you want to autocomplete both parameters.
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"
}
}
Especially with the addition of documentation, the index build can take a really long time. It would be better to build this in the background.
Currently there's no auto-completion for .commands
When generating docs on windows, newlines are rendered as '^M'. Need to track down where this \r\n
behavior is being introduced.
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...
himynameisjoeyc
Does this by chance include an S3 sync progress metric?
Also relates to: #30
This might be more of an 'epic' that we eventually break out into smaller chunks.
@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'
A lexer would make it easier to visually distinguish the different components of a command:
aws [options] <command> <subcommand> [parameters]
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
theme = none
theme = vim
theme = vim
Note: My terminal colors are customized which might be why we see light gray for aws>
.
theme = xcode
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.
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'
e1ven
After pressing f3 a few times to switch from emacs to vi and back, it got lost, and stopped responding to the command.
Hi,
I'm just wondering what your code of conduct is for this project?
Thanks,
Alison
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.
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.
Protected branches are a relatively new and handy feature:
https://github.com/blog/2051-protected-branches-and-required-status-checks
At the very least I think we should enable these for master
:
This is also handy too:
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.
We have a good number of branches, most of which have been merged/closed. Should we clean these up after they are merged?
I cloned the latest source to a new directory, installed in a fresh virtualenv.
I'm not seeing the help anymore on Python 3.4.3.
I do see it on Python 2.7.10.
Is this isn't necessary for perf, then JSON is a more suitable choice. Standard, less problems, not risk of changing between python versions, etc.
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'
F2
toggles fuzzy completionsF3
toggles Vi
and Emacs
key bindingsF4
toggles single and multiple columns in the autocompletion menuF5
toggles the help paneF10
exits aws-shell
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
Currently aws-shell
runs with Vi
bindings, 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.
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.
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.
To exit, Ctrl-D
might not be obvious to some users.
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.
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:
The process cannot access the file because it is being used by another process.
Press OK leaves Notepad empty.
aws-cli/1.9.9 Python/2.7.10 Windows/8 botocore/1.3.9
$ 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
====================================================================================== 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'
If I provide a required argument such as --image-id
, we shouldn't be offering it anymore as an autocomplete option. This would improve the case where you have multiple required params, you can keep adding params until no more required params were autocompleted.
Example:
0.746429 dcli describe-reserved-instances-listings
0.298566 dcli describe-classic-link-instances
describe-classic-link-instances
should be higher.
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.
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.
We're not currently completing enums.
because of python-prompt-toolkit : prompt-toolkit/python-prompt-toolkit#86
But, It works well when using Python over 3.4.x.
You'd better change Readme.rst (https://github.com/awslabs/aws-shell#supported-python-versions).
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
There's hardcoded lists for renames such as s3 -> s3api
, we need to be able to have this described in a data driven way.
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.
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.
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..
You can use the right arrow key
to complete a suggestion.
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.
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.
A curated list of awesome AWS libraries, open source repos, guides, blogs, and other resources.
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"..
Note: s3api list-buckets
works for me.
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.
$ 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
]
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).
I sometimes switch directories, such as when working with S3.
Try running:
aws> !pwd
aws> !cd ..
aws> !pwd
Here's one potential way to address this, from SAWS
:
https://github.com/donnemartin/saws/blob/master/saws/saws.py#L279-L309
In my use of the aws-cli/SAWS I find I'm frequently interacting with basic shell commands. aws-shell does not allow me to do this, which seems to force me to pop in/out of aws-shell.
This is supported on SAWS:
See: donnemartin/saws#8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.