-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_completer doesn't complete filenames #2402
Comments
Marking as a feature request. I think the difficult part about this is determining if a user wants to autocomplete a parameter/command or autocomplete a local file. |
@Malvineous what OS and terminal are you using? I'm able to autocomplete local filenames using tab on Mac OSX in iTerm2 and regular Terminal |
@ahuwaa I'm using bash under Linux with aws-cli/bin/aws_bash_completer. Have you enabled an autocomplete script for your shell like this one? You might be using your shell's default autocomplete process which will only complete filenames but not aws-cli command parameters. |
Sorry, I misunderstood. I did not know there was an autocomplete feature but have now reproduced the issue. I'd like to take a shot at this, if someone hasn't already started. Any advice/tips appreciated. |
Going to need help with this due to time constraints. So far I thought it was simplest to just default to the shell's autocomplete e.g. this works in bash import subprocess
import pipes
# ...
def complete(cmdline, point):
choices = Completer().complete(cmdline, point)
if len(choices) > 0:
print(' \n'.join(choices))
else:
cmd = cmdline.split(" ").pop()
try:
out = subprocess.check_output("compgen -o default " + pipes.quote(cmd), shell=True)
except subprocess.CalledProcessError:
out = ""
print out but of course this relies on something like compgen being available. If anyone has a better suggestion or would like to take over, feel free |
@kyleknap remote filename completion is the primary thing I hoped for when I learned that there is a complete module, calling it a feature-request is somewhat of an understatement. Even (also should note that this should also complete |
Is there any ETA on this feature? Now with the new AWS S3 interface its a pain to have to type out paths. I have no idea why they took out the full path from the to of the page. |
Good Morning! We're closing this issue here on GitHub, as part of our migration to UserVoice for feature requests involving the AWS CLI. This will let us get the most important features to you, by making it easier to search for and show support for the features you care the most about, without diluting the conversation with bug reports. As a quick UserVoice primer (if not already familiar): after an idea is posted, people can vote on the ideas, and the product team will be responding directly to the most popular suggestions. We’ve imported existing feature requests from GitHub - Search for this issue there! And don't worry, this issue will still exist on GitHub for posterity's sake. As it’s a text-only import of the original post into UserVoice, we’ll still be keeping in mind the comments and discussion that already exist here on the GitHub issue. GitHub will remain the channel for reporting bugs. Once again, this issue can now be found by searching for the title on: https://aws.uservoice.com/forums/598381-aws-command-line-interface -The AWS SDKs & Tools Team This entry can specifically be found on UserVoice at: https://aws.uservoice.com/forums/598381-aws-command-line-interface/suggestions/33168376-aws-completer-doesn-t-complete-filenames |
Based on community feedback, we have decided to return feature requests to GitHub issues. |
Recently installed |
Any updates on this feature request? It would be extremely useful to have tabcompletion for s3 buckets and files. |
Just chiming in with another voice on this request. I honestly thought my AWS CLI was just broken this entire time. 😬 |
really need this to work pretty please! |
Hi all, I patched the AWS completer to complete s3 paths, for example - typing: I'm not submitting it as pull request since it's a bit hacky, but if anyone's interested - here is the patch - Eran |
@erankor, thanks for sharing! Haven't tried it yet but I inlined erankors patch below for those wary about downloading zips 🙂
|
Do any solutions for local files exist yet? |
+1 for local file completion. |
@erankor I haven't tried your patch, but do you know if the |
Probably won't work, since I'm creating the s3 client directly in my patch, not using something provided by the aws cli. |
This feature request effects v2 as well. The rules for when to drop through to client side file completion seem straightforward. This is not a complete list, but here are some examples that would be really useful. For any command, look for file:// to do client side as in... A few special cases that don't follow that rule of needing/expecting file://. aws cloudformation package --template-file <tab for client-side completion of folders/files> |
I also assumed this would be already built into aws_completer. Making this a standard feature would be immensely useful. |
The issue was created more than 3 years ago, and such a completely fundamental functionality is still missing? No words... |
It will be super useful - please implement |
After more than a year, I circled back to this open feature request... |
Until this is fixed, you can use https://rclone.org/ |
Hi @erankor, I'm going to take a look at your PR. This is a pretty completx feature, especially for the S3 file name completion. I'll comment some more over there. Thanks! |
@kdaily, did you check it out? |
So, two months passed since I opened the PR... is this going to happen at some point? |
One word: Please. 🥺 |
Adding a +1 for this! |
hi |
please. |
OMFG just merge #5849 already, lfg are you serious AWS? Don't make me email Bezo-daddy directly and have an email like: Sender: [email protected] show up in the inbox of the PM for this effing tool. Holy honkers, why have tests if you won't merge PRs that pass them!!!! 😠 |
weak, how does |
Would love to see support for this added. |
+1; saws has had this feature for a long time (https://github.com/donnemartin/saws) ; unfortunately, saws doesn't support aws-cli v2 (donnemartin/saws#122) |
Please let this happen already |
For anyone who lands here, frustrated that this issue is still unfixed, going on 5.5 years, and wants to temporarily disable the broken functionality and uses the # remove broken tab completion from shell
$ complete -r aws
# reinstate the broken tab completion
$ complete -C aws_completer aws And, if you want to disable the functionality completely, comment out the |
Still no completions on |
To get local path completion, the ugly way:
|
AWS, COME ON! It has been 5 years and you have a PR!!!! What the hell? |
Local path completion works now, My aws version: |
@zzhuolun is that on linux? I still can't get the local path completion working when using v2. |
Yes on Linux. Btw, with the bash shell, only local path completion works. And with fish shell, both local path and s3:// remote path completion work! |
@zzhuolun Thanks. I will check out the fish shell. Did you completely remove V1 of the aws-cli to get this working? |
I started with aws-cli v2 without installing v1 in the first place. |
wow are you saying that if we use fish shell we get the remote completion for s3?! whoa - wonder why that would just suddenly work without any code changes to the CLI? do you think this would work if I installed it on mac? |
Yes, remote auto-completion of s3 works with fish shell. I'm not sure about mac OS. My versions:
aws: |
My colleague uses a Mac and he told me zsh works the same way as fish does here. |
Thanks @mtravis (and @zzhuolun )! I have zsh and i get aws autocomplete for everything else it seems (like even dynamo table names) but nothing for s3 (e.g. "aws s3api list-object-versions --bucket" when I tab after that, crickets. same with prefixing with "s3://"). Alot of my s3 bucket paths are pretty long, so this would be a HUGE help if I could get it to work. Do you think your colleague would be willing to give me some more details? I've checked my setup against all the things aws says to do and it's all correct. My contact details are in my profile here, or he could join our convo here. Thanks! |
If you use a command like this:
Then normally the
<tab>
will result in autocompleting a file in the current directory starting witha
. However this does not happen, and pressing tab has no effect.Can the autocompleter be updated to allow completing of filenames at the appropriate times?
The text was updated successfully, but these errors were encountered: