janakaud / aws-cli-repl Goto Github PK
View Code? Open in Web Editor NEWREPL-mode wrapper/proxy for [aws-cli](https://github.com/aws/aws-cli)
License: Apache License 2.0
REPL-mode wrapper/proxy for [aws-cli](https://github.com/aws/aws-cli)
License: Apache License 2.0
Currently the client cannot communicate the exit code or stderr. I suggest using a different wire format to send args and receive output. nailgun has a rich command set that aws-cli-repl could implement part of. The Ruby-based railgun describes it:
https://github.com/timuralp/railgun/blob/master/lib/railgun/client.rb
Could you add an explicit license to this project, preferably MIT or Apache v2? My employer does not allow me to contribute to projects without one.
have now got a working setup, but get an error when running
in terminal 1 export AWSR_DAEMON=True;./awsr
to have a server run
in terminal 2 export AWSR_CLIENT=True; ../aws-cli-repl/awsr ec2 describe-instances --query 'Reservations[].Instances[].{Name: Tags[?Key==Name].Value | [0], ID: InstanceId, IP: PrivateIpAddress}'
Then in terminal 1 I get an error
Bad value for --query Reservations[].Instances[].{Name:: Invalid jmespath expression: Incomplete expression:
"Reservations[].Instances[].{Name:"
^
My tests have several commands of the form echo foo | aws s3 cp - s3://bucket
. This hangs the daemon which does not expect stdin.
If you give a bogus command, e.g., aws asdf
, the daemon exits. This behavior differs from a command with bogus arguments, e.g., aws s3 --fake-flag
.
The psutil.process_iter
logic doesn't work in my environment. The most obvious problem is looking at only python
and not python2
or python3
but this is brittle in other ways. Instead could you have an explicit client and server mode, either via a flag or separate script names?
ร am trying to run awsr using python 3 in WSL.
Added to path.
Try to execute:
[root@blah ~]# awsr
Forking new awsr background process
In another WSL window, if i run a command like:
awsr ec2 describe-instances
It just tries again to fork a new background process. Even if I try to fork the command in the background it doesn't work.
Not sure if it's something to do with WSL?
I love you for figuring this out, but I'm sadly running on Cygwin for one of my platforms, and it does not support the psutil python module.
I notice you only seem to use one function from it, though, psutil.process_iter(). I don't suppose there might be some way to do this using the os module instead?
Hi! I have followed the two steps of the instruction (added to system path and made it executable), however, I am getting Command 'awsr' not found error. Can you please provide some info what could be the problem? Thanks!
Hi @janakaud,
I follow your instructions and when I run the command it always fails in the line 77 due to cmd being NoneType. Probably it is something pretty simple to solve.
My python version is 2.7.10
awsr ec2 describe-instances
Traceback (most recent call last):
File "/Users/.../awsr_dir/awsr", line 77, in <module>
if len(cmd) > 1 and cmd[0].endswith("python") and cmd[1] == sys.argv[0]:
TypeError: object of type 'NoneType' has no len()
I tried to use zsh and bash, both have the same problem.
Thank you!
Instead of always passing the default profile if none is set, awsr should consider the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables.
This might allow multiple backend processes to process in parallel.
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.