Skip to content

Add /custom-commands feature to execute prompts defined in Markdown files #1216

Closed as duplicate

Description

@amannhq

Feature Request: /custom-commands CLI Integration

Background

Many projects document common terminal workflows in Markdown, but users still have to copy and paste. This feature will allow contributors to define custom commands directly inside a .md file (e.g. COMMANDS.md) and invoke them from the terminal like this:

./my-cli /custom-hello

This would look up the hello command in the documentation and run the corresponding prompt or script automatically.

Proposed Solution

  1. Markdown Parsing

    • Parse configured .md files (e.g. COMMANDS.md) for fenced code blocks or specially formatted comments labeled as /custom-<name>.
  2. Command Registry

    • Map each /custom-<name> to its associated prompt or script snippet, stored in memory at runtime.
  3. CLI Integration

    • Extend the CLI to recognize and route /custom-<name> arguments.
    • On invocation, retrieve and execute the matching command prompt from the Markdown source.
  4. Help & Validation

    • ./my-cli /custom-commands --list should display all available custom commands.
    • Provide clear error messages for undefined or improperly formatted commands.
    • Fallback to --help when no valid /custom- argument is provided.

Acceptance Criteria

  • Custom commands are defined in Markdown and are discoverable via --list.
  • Running ./my-cli /custom-<name> executes the correct snippet.
  • Error handling for undefined or malformed command blocks is in place.
  • The feature is documented with examples in README.md.

Additional Context

This feature will:

  • Make common workflows easier to discover and use
  • Reduce copy-paste from documentation
  • Keep project documentation executable and in sync with real behavior

Activity

  1. self-assigned this
    on Jul 22, 2025
  2. x123 commented on Aug 3, 2025

    @x123

    👍 for custom commands. (i.e., similar to https://docs.anthropic.com/en/docs/claude-code/slash-commands or https://docs.roocode.com/features/slash-commands)

    In workflows where you have very common patterns of spec'ing a feature requirements, planning the implementation, and then implementing it's really inefficient to constantly type it all out when you can just make a custom prompt commands and use /spec ARGUMENTS, /plan @docs/spec-somespec.md, and /implement Epic 43.

    I think this is a good addition to any agentic tool.

  3. amannhq commented on Aug 3, 2025

    @amannhq
    Author

    @thdxr I would love to work on this feature

  4. jessevdp commented on Aug 8, 2025

    @jessevdp
    Contributor

    Is this a duplicate of #299?

  5. x123 commented on Aug 8, 2025

    @x123

    Is this a duplicate of #299?

    Kinda looks like it and that one has more traction.

  6. jayair commented on Aug 8, 2025

    @jayair
    Contributor

    I'll close in favour of that one then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions