Skip to content

Custom prompts - passing arguments #2890

Closed

Description

@michalkos

What feature would you like to see?

Please implement functionality to allow custom arguments (e.g., $ARGUMENTS) to be passed and rendered within the .md file when executing slash commands.

Additionally, the first line of the .md file could be used as a command title in the TUI. If the line exceeds the maximum allowed length, it should be truncated accordingly.

Image

Once [pull request #2471](#2471) is merged, it would be great to support this functionality in custom commands as well.

Example

# Create a git commit

Based on the code changes, create a single git commit.

If `--push` argument is present, you can run `git push`.

**DO NOT** run `git add` unless asked by argument `--add`.

**DO NOT** add information that the commit is generated by Codex.

## Context

- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`

## Passed arguments 

`$ARGUMENTS`

Are you interested in implementing this feature?

No response

Additional information

No response

Activity

  1. cs-asimoes commented on Sep 1, 2025

    @cs-asimoes

    +1, would be really useful! i was just reading the source code to understand if this was already there!

  2. suvam-jaiswal commented on Sep 2, 2025

    @suvam-jaiswal

    +1, arguments to saved prompts and adding additional content like this is super useful

  3. SuperPauly commented on Sep 2, 2025

    @SuperPauly

    It would be nice to have a more Git centric approach where codex ask if you want to create a new branch for this change.

    Also does appropriate Git commits along the way so if you leave it running the user and Codex can easily step back to a point where it was in a working state regardless of Codex running or not.

    This way you can see in the Git logs the branches and iterative changes over time to pick up any mistakes or changes that may be important or may have caused problems.

    As this also would you help diagnose issues and looking at the state of repository with the many, many tools available for Git repository viewing and analysis out there already.

  4. michalkos commented on Sep 2, 2025

    @michalkos
    Author

    @SuperPauly, how you configure the command is entirely up to you. The example simply demonstrates how to use arguments in the setup.

  5. dedrisian-oai commented on Sep 3, 2025

    @dedrisian-oai
    Contributor

    Thanks! Tracking this.

  6. SystemicVoid commented on Sep 3, 2025

    @SystemicVoid

    +1 That would be very useful, thanks!

  7. sergigp commented on Sep 5, 2025

    @sergigp

    This will make prompts much more powerful. Imo ideally we should be able to pass multiple arguments with $1, $2, ...

  8. avxkim commented on Sep 10, 2025

    @avxkim

    i initially thought i could use something like: /code-review pass PR link and do it, but just found out, that it doesn't accept any args... Hope they will implement this soon.

  9. alexx-ftw commented on Sep 11, 2025

    @alexx-ftw

    This will be a game changer for me. I rely on this a ton with Claude Code. +1

  10. evandavid1 commented on Sep 14, 2025

    @evandavid1

    Status update / proposal

    • Draft PR: Custom prompts: passing arguments ($1..$9, $ARGUMENTS) + @ file picker + frontmatter hints #3565 (minimal, backward‑compatible).
    • Scope:
      • Arguments: $1..$9, $ARGUMENTS, and $$
        (literal); simple quoting for paths with spaces.
      • “@” file picker: inserts quoted file paths (no
        content inlining, no auto‑exec).
      • Optional frontmatter: description and argument-
        hint shown in the slash palette; frontmatter is
        stripped before send.
    • Safety/back‑compat: no changes to approvals/
      sandbox; protocol only adds optional fields; existing
      prompts continue to work.
    • Tests/docs: unit + TUI snapshot tests added; docs/
      prompts.md updated.

    If this approach aligns, I’ll mark #3565 ready for
    review. I’m happy to modify as needed.

  11. evandavid1 commented on Sep 23, 2025

    @evandavid1

    Hi @dedrisian-oai and @aibrahim-oai - PR #3565 (#3565) mentioned above which shows high demand, delivers the full custom prompt update: $1..$9/$ARGUMENTS/$$ handling, @ file picker auto-quoting, inline description + argument-hint rendering, and the docs/tests refresh. It’s rebased on current main and the sweeps (formatting, per-crate tests, cargo test --all-features) are green. It’s still in draft mode and I can’t switch it back to active - could you unlock the PR and mark it ready for review? Please me know if you’d like any changes.

    Image Image
  12. 9 remaining items

  13. Hotion13 commented on Sep 26, 2025

    @Hotion13

    A message above said this feature is now on a branch and should be merged into main soon.

    I this this is this feat : #3565

    We all hope for this. Codex is replacing CC for lot of us, and spec kit hype is growing fast :)

  14. desneck commented on Sep 28, 2025

    @desneck

    Hey @dedrisian-oai, will this feature be in the upcoming 0.43 release?
    Thanks a lot!

  15. dedrisian-oai commented on Sep 29, 2025

    @dedrisian-oai
    Contributor

    Hey guys, coming soon! @evandavid1's PR was merged into a feat branch, and I'll combine it with some named params and submit for a PR & review this week.

  16. dedrisian-oai commented on Sep 30, 2025

    @dedrisian-oai
    Contributor

    Numbered args ($1, $2, $3, $ARGUMENTS) has been merged. Named args coming next!

  17. Was85 commented on Sep 30, 2025

    @Was85

    We can't work with the GitHub Spec kit (Codex) without this.

  18. dedrisian-oai commented on Sep 30, 2025

    @dedrisian-oai
    Contributor

    Both numbered args and named args have been merged! It will be released in the next version :)

  19. Damecek commented on Sep 30, 2025

    @Damecek

    just run the /constitution <input text> custom prompt on the latest build and everything looks working.

    ╭────────────────────────────────────────────────────────╮
    │ >_ OpenAI Codex (v0.43.0-alpha.6)                      │
    │                                                        │
    │ model:     gpt-5-codex   /model to change              │
    │ directory: ~/IdeaProjects/force-navigator-reloaded-2-0 │
    ╰────────────────────────────────────────────────────────╯
    
      To get started, describe a task or try one of these commands:
    
      /init - create an AGENTS.md file with instructions for Codex
      /status - show current session configuration
      /approvals - choose what Codex can do without approval
      /model - choose what model and reasoning effort to use
      /review - review any changes and find issues
    
    
    ›
      The user input to you can be provided directly by the agent or as a command argument - you
      **MUST** consider it before proceeding with the prompt (if not empty).
    
      User input:
    
      This is repository containing source code for Chrome extension. Aimed to improve page navigation
      inside Salesforce org. Creates a set of dynamic and static url paths, scoped to current org,
      leveraging standard salesforce api.
    
      You are updating the project constitution at `.specify/memory/constitution.md`. This file
      is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`,
      `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template
      precisely, and (c) propagate any amendments across dependent artifacts.
    ....
    
  20. 0xdevalias commented on Oct 1, 2025

    @0xdevalias
  21. Tozo1995 commented on Oct 3, 2025

    @Tozo1995

    Can we officially use Codex with the Spec kit and passing an argument? Is it official or experimental?

  22. LostPoE commented on Oct 3, 2025

    @LostPoE

    I think it might be in v0.43.0 . But its not released yet.

  23. aybouzaglou commented on Oct 3, 2025

    @aybouzaglou

    Latest codex cli version now supports custom commands

  24. tibo-openai commented on Oct 19, 2025

    @tibo-openai
    Collaborator
  25. added a commit that references this issue on Feb 26, 2026
    9fdcdc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions