Step-by-Step Guide to Enabling AWS CLI Autocomplete installed via Snap

Search for a command to run...

No comments yet. Be the first to comment.
Struggling with burnout and constant notifications? Here is a deep dive into my productivity setup, how I manage distractions with DigitalZen

Introduction In Kubernetes, Pod Priority and Preemption is a powerful scheduling feature that ensures critical workloads are placed and maintained on your cluster, even when resources are scarce. With this mechanism, Kubernetes can automatically pree...

n8n stands out as one of the most powerful open-source low-code AI workflow automation tools available. While cloud-hosted n8n can get expensive quickly, Oracle Cloud's Always Free tier offers an incredible opportunity to run n8n completely free, for...

🧠 Why Terraform for Proxmox? While Proxmox has a great web UI, infrastructure-as-code lets you: Automate repeatable VM deployments Keep configurations under version control Easily spin up multi-VM Setups Reduce human error 👋 Quick heads-up! T...

Whether you’re just dipping your toes into Terraform or you’ve been automating your infrastructure for years, Hooking up Terraform with Proxmox is a simple step that unlocks a lot of automation power. By the end of this guide, you’ll have learned how...

I installed the aws-cli via snap using
sudo snap install aws-cli --classic
If you’ve also installed AWS CLI using Snap on Ubuntu or other Linux distributions, you may have stumbled upon the same issue that the aws_completer is not placed in the usual /usr/local/bin/aws_completer
Lets try to locate the path of aws_completer
which aws_completer return is empty. As no path is shown, locating it using find:
$ find / -name aws_completer 2>/dev/null
/snap/aws-cli/1441/aws/dist/aws_completer
/snap/aws-cli/1441/bin/aws_completer
/snap/aws-cli/1443/aws/dist/aws_completer
/snap/aws-cli/1443/bin/aws_completer
Snap packages use internal versioned folders (e.g. 1441, 1443) that change on update, making hard-coded paths impractical. This makes configuring autocomplete tricky.
However, Snap maintains a /snap/aws-cli/current symlink to the active version. Link this to a location in your $PATH instead.
Use the snap's current alias to avoid version-specific paths.
This ensures autocomplete continues working even after AWS CLI updates.
sudo ln -sf /snap/aws-cli/current/bin/aws_completer /usr/local/bin/aws_completer
~/.bashrc):complete -C '/usr/local/bin/aws_completer' aws
~/.zshrc):autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
complete -C '/usr/local/bin/aws_completer' aws
Apply changes:
source ~/.bashrc # or source ~/.zshrc
Press Tab after typing a partial aws command:
aws s3 <TAB><TAB>

Beyond tab completion, AWS CLI v2 offers an interactive auto‑prompt that guides your input after pressing Enter
nable it permanently (default profile):
aws configure set cli_auto_prompt on-partial
Or for just your session:
bashCopyEdiexport AWS_CLI_AUTO_PROMPT=on-partial
This mode is especially helpful when you're exploring less familiar commands
