Skip to content

Feature Request: Add /prompt command for managing reusable custom prompts (create, edit, delete, select, auto-echo) #4209

@YangsonHung

Description

@YangsonHung

What feature would you like to see?

Description
I'd like to request a new feature for Codex CLI: a built-in /prompt command to manage reusable custom prompts.

Use cases / Motivation

  • In daily coding, we often reuse similar prompts (e.g. "Write React component with Tailwind CSS", "Generate Jest unit tests", etc.).
  • Currently, we need to copy/paste these prompts manually each time.
  • A /prompt management system would allow us to store, organize, and quickly reuse prompts locally or in the cloud.

Proposed Features

  1. /prompt add <name> <content>

    • Save a custom prompt with a name (alias).
  2. /prompt list

    • Show all saved prompts.
  3. /prompt edit <name>

    • Edit an existing prompt.
  4. /prompt delete <name>

    • Remove a prompt.
  5. /prompt use <name>

    • Insert a saved prompt into the current input.
  6. Auto echo when using:

    • When selecting a prompt, automatically insert the text into the input so it can be further edited.
  7. Storage options:

    • Local file-based management (e.g. ~/.codex/prompts.json).
    • Future option: sync via cloud or account (if supported).

Example Workflow

/prompt add react_component "Write a React component with TailwindCSS and TypeScript."
/prompt use react_component

Codex CLI would auto-fill the input with:

"Write a React component with TailwindCSS and TypeScript."

And then I can edit it before sending.

Benefits

  • Greatly improves productivity by avoiding repetitive typing.
  • Provides a "personal prompt library" for different projects.
  • Fits naturally into CLI workflow (similar to /config or /mcp).

Possible Implementation

  • Store prompts in a JSON or TOML file under ~/.codex/.
  • Provide CRUD commands under /prompt.
  • Optional: support cloud sync in the future.

🔗 Environment

  • Codex CLI version: [0.41.0]
  • OS: [Windows]

Would you accept a PR for this feature if I (or community) draft one?


Are you interested in implementing this feature?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    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