Named arguments for command parsed from $ARGUMENTS #1473

Open
opened 2026-02-16 17:31:08 -05:00 by yindo · 7 comments
Owner

Originally created by @fmatsos on GitHub (Aug 24, 2025).

Originally assigned to: @thdxr on GitHub.

I thought about a better DX around $ARGUMENTS in commands, and saw a PR started for that: #2199
But I think we can improve much more the DX by using named arguments, thanks to frontmatter.

$ARGUMENTS will be parsed if an arguments key exists, assign values to each array value based on their array position.

I thought about something like that:

---
description: My command with arguments
arguments:
  - lorem
  - ipsum
  - ...
---

Show to user the argument 1: $LOREM

`! echo $IPSUM`

arguments values indicate the arguments names, and their position on which index of $ARGUMENTS retrieve the value.
In the example $LOREM will be value of $ARGUMENTS[0], $IPSUM value of $ARGUMENTS[1], etc.

Imho it will help to have prompts of commands more understandable.

Originally created by @fmatsos on GitHub (Aug 24, 2025). Originally assigned to: @thdxr on GitHub. I thought about a better DX around `$ARGUMENTS` in commands, and saw a PR started for that: #2199 But I think we can improve much more the DX by using named arguments, thanks to frontmatter. `$ARGUMENTS` will be parsed if an `arguments` key exists, assign values to each array value based on their array position. I thought about something like that: ```markdown --- description: My command with arguments arguments: - lorem - ipsum - ... --- Show to user the argument 1: $LOREM `! echo $IPSUM` ``` `arguments` values indicate the arguments names, and their position on which index of `$ARGUMENTS` retrieve the value. In the example `$LOREM` will be value of `$ARGUMENTS[0]`, `$IPSUM` value of `$ARGUMENTS[1]`, etc. Imho it will help to have prompts of commands more understandable.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 24, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2199: This PR implements $ARGUMENTS indexing and splitting functionality which addresses the same core need for better argument handling in commands, just with a different syntax approach

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 24, 2025): This issue might be a duplicate of existing issues. Please check: - #2199: This PR implements `$ARGUMENTS` indexing and splitting functionality which addresses the same core need for better argument handling in commands, just with a different syntax approach Feel free to ignore if none of these address your specific case.
Author
Owner

@shanepadgett commented on GitHub (Dec 23, 2025):

It would be great if the arguments rendered hints as well when you are typing out the command. Auggie does this.

@shanepadgett commented on GitHub (Dec 23, 2025): It would be great if the arguments rendered hints as well when you are typing out the command. Auggie does this.
Author
Owner

@rekram1-node commented on GitHub (Dec 23, 2025):

we have numbered args btw

@rekram1-node commented on GitHub (Dec 23, 2025): we have numbered args btw
Author
Owner

@shanepadgett commented on GitHub (Dec 27, 2025):

And we use them, but some like auggie is doing here would be much better. They have you define named argument hints in the frontmatter so they render as your selecting the command. Its sometimes hard to remember the argments and what order they are in without the hint.

Image
@shanepadgett commented on GitHub (Dec 27, 2025): And we use them, but some like auggie is doing here would be much better. They have you define named argument hints in the frontmatter so they render as your selecting the command. Its sometimes hard to remember the argments and what order they are in without the hint. <img width="787" height="367" alt="Image" src="https://github.com/user-attachments/assets/82d19b63-8c60-4df8-98d0-94e1bb953c1e" />
Author
Owner

@rekram1-node commented on GitHub (Dec 28, 2025):

yeah the hints is. a great idea, we should totally have that

@rekram1-node commented on GitHub (Dec 28, 2025): yeah the hints is. a great idea, we should totally have that
Author
Owner

@ertucode commented on GitHub (Jan 9, 2026):

@rekram1-node I would like to implement this with some "improvements". Making the args easier to use with helpful hints is my goal. Something like the following structure would be the final usage. Validation of the inputs would be up to the implementer. These will be used just to improve the user experience.

---
description: My command with arguments
arguments:
  - name: arg1
    type: string

  - name: arg2
    type: select
    options:
      - name: Option
        value: option
      - value: option1

  - name: arg3
    type: path
---
@ertucode commented on GitHub (Jan 9, 2026): @rekram1-node I would like to implement this with some "improvements". Making the args easier to use with helpful hints is my goal. Something like the following structure would be the final usage. Validation of the inputs would be up to the implementer. These will be used just to improve the user experience. ``` --- description: My command with arguments arguments: - name: arg1 type: string - name: arg2 type: select options: - name: Option value: option - value: option1 - name: arg3 type: path --- ```
Author
Owner

@shanepadgett commented on GitHub (Jan 10, 2026):

@rekram1-node I would like to implement this with some "improvements". Making the args easier to use with helpful hints is my goal. Something like the following structure would be the final usage. Validation of the inputs would be up to the implementer. These will be used just to improve the user experience.

---
description: My command with arguments
arguments:
  - name: arg1
    type: string

  - name: arg2
    type: select
    options:
      - name: Option
        value: option
      - value: option1

  - name: arg3
    type: path
---

I like this. I almost wonder for complex input like this if it could trigger the new question UI to guide through the input more easily.

@shanepadgett commented on GitHub (Jan 10, 2026): > [@rekram1-node](https://github.com/rekram1-node) I would like to implement this with some "improvements". Making the args easier to use with helpful hints is my goal. Something like the following structure would be the final usage. Validation of the inputs would be up to the implementer. These will be used just to improve the user experience. > > ``` > --- > description: My command with arguments > arguments: > - name: arg1 > type: string > > - name: arg2 > type: select > options: > - name: Option > value: option > - value: option1 > > - name: arg3 > type: path > --- > ``` I like this. I almost wonder for complex input like this if it could trigger the new question UI to guide through the input more easily.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1473