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

I installed the aws-cli via snap using

```bash
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`

## 🔗 **Locate the 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`:

```bash
$ 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.

## 🛠️ 1. Create a stable symlink in your PATH

Use the snap's `current` alias to avoid version-specific paths.

This ensures autocomplete continues working even after AWS CLI updates.

```bash
sudo ln -sf /snap/aws-cli/current/bin/aws_completer /usr/local/bin/aws_completer
```

## ✍️ Step 2: Add completion setup to your shell

### For Bash (`~/.bashrc`):

```bash
complete -C '/usr/local/bin/aws_completer' aws
```

### For Zsh (`~/.zshrc`):

```bash
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
complete -C '/usr/local/bin/aws_completer' aws
```

## 🔄 Step 3: Reload your shell

Apply changes:

```bash
source ~/.bashrc  # or source ~/.zshrc
```

Press **Tab** after typing a partial `aws` command:

```bash
aws s3 <TAB><TAB>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1749384291235/ffc94c25-2a77-4996-aa71-c50ebbfaddd3.png align="center")

## 🤖 Step 4 (Optional): Activate AWS CLI v2 Auto‑Prompt

Beyond tab completion, AWS CLI v2 offers an interactive **auto‑prompt** that guides your input after pressing **Enter**

nable it permanently (default profile):

```bash
aws configure set cli_auto_prompt on-partial
```

Or for just your session:

```bash
bashCopyEdiexport AWS_CLI_AUTO_PROMPT=on-partial
```

This mode is especially helpful when you're exploring less familiar commands

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1749384577530/9b92fe56-0645-4594-adc6-1e99fbea1b38.png align="center")
