aws / aws/amazon-q-developer-cli

Support for autocomplete aliases - make cd use z (zoxide) completions

Open
#3,348 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

I'm using zoxide with the `--cmd cd` flag, which overrides the `cd` command to use zoxide's smart directory navigation:

```fish
zoxide init fish --hook pwd --cmd cd | source
```

This means `cd` is functionally an alias for `z` in my shell. However, Amazon Q CLI treats them differently for autocomplete:

- When I type `z some-dir`, I get zoxide's smart frecency-based suggestions
- When I type `cd some-dir`, I get standard directory completions, even though `cd` is actually running zoxide

**Expected behavior:**
Amazon Q should respect that `cd` is aliased to `z` and provide the same zoxide-powered completions for both commands.

**Possible solutions:**
1. Add an `autocomplete.aliases` setting to map one command's completions to another (e.g., `q settings autocomplete.aliases.cd "z"`)
2. Auto-detect when a command is aliased and use the aliased command's completion spec

**Environment:**
- Amazon Q CLI version: q 1.19.3
- Shell: Fish
- OS: macOS

Image
Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.