aws / aws/amazon-q-developer-cli

Feature Request: Direct shell command execution syntax (e.g., !ls)

Aperta
#2,831 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

Linux 6.14.0-29-generic - Ubuntu 24.04.3 LTS

### Expected behaviour

Users should be able to execute shell commands directly within the Q chat prompt using a special syntax like `!command`. For example:
- `!ls` to list directory contents
- `!pwd` to show current directory
- `!git status` to check git status
- `!cat filename.txt` to view file contents

This would provide immediate command execution without needing to ask the AI assistant to run the command via the execute_bash tool.

### Actual behaviour

Currently, there is no direct shell command syntax available in the Q chat interface. Users must ask the AI assistant to run commands, which then uses the execute_bash tool. This adds extra steps for simple, quick commands.

```
[chat-transcript]

> is there a way i can run a local shell command inside the q prompt? Like, a ! syntax or something. for example, if i wanted to just check the content of the local directory, could i just do a !ls or something similar?

[Tool uses: introspect]

Based on the Q CLI documentation, there is **no direct shell command syntax like `!ls`** documented for running commands within the Q chat prompt.

However, you can run shell commands in two ways:

1. **Ask me to run commands** - You can simply ask me to run shell commands like "list the contents of the current directory" and I'll use the `execute_bash` tool to run `ls` for you.

2. **Use the `/editor` command** - The documentation mentions an `/editor` command that opens your `$EDITOR` (defaults to vi) to compose a prompt, but this is for composing chat messages, not executing shell commands.

The `execute_bash` tool is available and can run shell commands, but it requires going through the AI assistant rather than having direct shell access with a special syntax.

For your example of checking directory contents, you would just ask: "show me the contents of the current directory" and I would execute `ls` for you.

The documentation doesn't mention any special syntax like `!` for direct shell command execution within the chat interface.

**Reference:**
- [Built-in Tools](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/built-in-tools.md)
[Tool uses: none]

> seems like that would be a good feature.

I agree! A direct shell command syntax like `!ls` would be a convenient feature for quick commands without having to ask the AI assistant each time.

If you'd like to suggest this as a feature request, you can use the `/issue` command to open a GitHub issue template. This will create a pre-filled issue on the Amazon Q CLI repository where you can describe the feature request for direct shell command execution syntax.

The development team would be able to see community interest in features like this through the GitHub issues.
[Tool uses: none]

> can you put together the details of the feature request and open a github issue for me?

[Tool uses: report_issue]

(...truncated)
```

### Steps to reproduce

1. Open Q chat interface
2. Try to run a shell command with `!ls` or similar syntax
3. Command is not recognized as a shell command
4. User must instead ask "please run ls" and wait for AI to execute via execute_bash tool

### Environment

```yaml

[q-details]
version = "1.15.0"
hash = "a8a0426eaff32ac9b1599ca1b1f1881ffd16054d"
date = "2025-09-02T17:17:19.458949Z (8d ago)"

[system-info]
chip = "12th Gen Intel(R) Core(TM) i7-12700"
total-cores = 12
memory = "31.04 GB"

[system-info.os.linux]
kernel_version = "6.14.0-29-generic"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 24.04.3 LTS"
version_id = "24.04"
version = "24.04.3 LTS (Noble Numbat)"

[environment]
cwd = "/home/USER"
cli-path = "/home/USER"
install-method = "unknown"

[env-vars]
DISPLAY = ":0"
GTK_IM_MODULE = "ibus"
PATH = "/home/USER/.nvm/versions/node/v22.16.0/bin:/home/USER/.local/python-venv/bin:/home/USER/.bin:/home/USER/.local/share/zinit/polaris/bin:/home/USER/.bin/:/home/USER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/USER/.local/bin"
QT_IM_MODULE = "ibus"
Q_SET_PARENT_CHECK = "1"
Q_USING_ZSH_AUTOSUGGESTIONS = "1"
SHELL = "/bin/zsh"
TERM = "st-256color"
XDG_CURRENT_DESKTOP = "dwm"
XDG_SESSION_DESKTOP = "dwm"
XDG_SESSION_TYPE = "x11"
XMODIFIERS = "@im=ibus"

[chat-settings]

[chat-trusted_tools]
fs_read=trusted

[chat-failed_request_ids]
none

[chat-context]
current_profile=q_cli_default
profile_context=
AmazonQ.md
README.md
.amazonq/rules/**/*.md

files=none
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal punto di ingresso della Q chat interface e traccia il modo in cui i prompt vengono inviati allo strumento execute_bash. Confronta questo flusso con le forme proposte !ls, !pwd, !git status e !cat filename.txt. Il lavoro è completato quando i comandi shell diretti vengono riconosciuti nella chat e producono l'output del comando senza richiedere una assistant request.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust, shell
Ambito
cli
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.