aws/amazon-q-developer-cli

Local file-based prompts don't support argument substitution despite CLI accepting arguments

Opened this issue · 1 comments

The /prompts command accepts arguments for local .md file prompts, but the arguments are ignored and not substituted into the prompt content.

Current Behavior:
• CLI accepts: @my-prompt arg1 arg2 or /prompts get my-prompt arg1 arg2
• Arguments are passed to the function but unused
• Content from .md files is copied wholesale without substitution (line 1342 in prompts.rs)
• No placeholder syntax documented for local prompts

Expected Behavior:
• Arguments should be substituted into local prompt content
• Clear documentation of placeholder syntax (e.g., {{arg1}}, {arg1}, etc.)
• Support for required/optional arguments like MCP prompts

Context:
• MCP server prompts fully support arguments with validation
• Local prompts only work as static templates
• Feature gap between MCP and local prompt capabilities

Code Reference:
crates/chat-cli/src/cli/chat/cli/prompts.rs:1342 - content copied without processing

This creates confusion as the interface suggests argument support exists but it's not implemented for local file-based prompts.

Hi @ktingyew

I noticed you requested arguments in file-based prompts and thought you might be interested - I just implemented this feature and created a PR that does exactly what you're looking for!

The implementation lets you:

  • Automatically detects {{placeholder}} patterns in prompt content
  • /prompts command now shows arguments and description
  • Optional headers with description and arguments
  • Full backward compatibility with non-argument prompts

I'd love to get your thoughts on it! Does this solve what you were hoping for? If it looks good to you, any feedback or support would be awesome 🙏

Here's the PR: #3071