aws / aws/amazon-q-developer-cli

Feature Request: Add File Injection Capability (@ Command for File Reference)

Open
#2,961 1 comment 1 reaction 0 assignees View on GitHub
Feature request q chat
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### 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

macOS 15.6.0 (24G84)

### Expected behaviour

### Requested Feature:
Add file injection capability using `@filepath` syntax to automatically inject the content of specified files into prompts. This is useful for asking questions about specific code, text, or collections of files without manual copy-pasting. This feature is already available in both Claude Code and Gemini CLI through their respective @ command implementations.
Examples:
- `Explain this text @path/to/your/file.txt `
- `Summarize the code in this directory. @src/my_project/ `
- `What is this file about? @README.md`

### Expected Behavior

Referring to [gemini-cli](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/commands.md#at-commands-), when a user enters a prompt containing @filepath patterns(e.g. `Compare the file @package.json and @src/config.ts`), the processed prompt looks like:
```
Compare the file @package.json and @src/config.ts

--- Content from referenced files ---

Content from @package.json:
{
"name": "my-project",
"version": "1.0.0"
}

Content from @src/config.ts:
export const config = {
port: 3000
};

--- End of content ---
```

### Actual behaviour

Currently, when users want to reference a file in chat, they must:
- Manually copy and paste file path into their prompts
- Wait for Q-CLI to identify their intent and extract file paths
- Wait for Q-CLI to use fs_read tool calls to retrieve file content

### Steps to reproduce

_No response_

### Environment

```yaml
[q-details]
version = "1.16.2"
variant = "full"
[system-info]
os = "macOS 15.6.0 (24G84)"
chip = "Apple M2 Pro"
total-cores = 12
memory = "32.00 GB"
```

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.