1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 21:57:44 +00:00

Add custom completions for aws-cli (#1073)

Aws-cli ships with a dedicated completion binary that only needs to be
passed current commandline to work. Space is appended to returned
results so that completing subcommands can be done simply by pressing
tab multiple times
This commit is contained in:
Yethal 2025-03-18 20:26:19 +01:00 committed by GitHub
parent 861a99779d
commit 0bdf55f71f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,13 @@
def complete-commands [
context: string
] {
with-env {COMP_LINE: $context} {
aws_completer
| lines
| each {|x| $"($x) "}
}
}
export extern "aws" [
...command: string@complete-commands
]

View file

@ -0,0 +1,9 @@
# Amazon Web Services CLI completions
A Nushell extern definition and completers for [Amazon Web Services CLI `aws`](https://aws.amazon.com/cli/).
This module utilizes the `aws_completer` binary that ships with `aws` to provide completions
## How to use
Add `source path/to/aws-completions.nu` to your `config.nu` (`$nu.config-path`).