Prompt Extraction CLI Generator

Prompt Extraction CLI Generator

Asks the AI to write a repeatable CLI that walks a folder of markdown files, extracts the prompt section from each and saves it to a new folder without creating duplicates.

Generate the code for a command line interface (CLI) that I can use on my OpenSUSE computer.

The program's function is to recurse through a directory of markdown files.

Its base directory is:

{path}

The program should recurse through that base directory and process every markdown file (.md, .mdx) that it finds within it. It should not process files of any other type.

The program will find markdown files that follow approximately this template:

# Prompt

{Prompt text}

# Output

{Output text}

However, there might be some variation.

The header that denotes the prompt might be written like:


## Prompt
### prompt

The filtering logic should be fuzzy enough that it will recognise these variations as the prompt header (and similarly for outputs).

The program should copy the text of the promp (which is {prompt text} in the example above and is the section that comes after the prompt header and before the next header in order.) And it should write the text to a new markdown file in this directory:

{path 2}

The filename of the prompt which the program creates should be {filename}_prompt.md - where {filename} is the file name of the file the prompt was originally derived from.

Once the program has successfully extracted the prompts, it should display a message:

Success!

{number} prompts succesfully extracted.

Where {number} is the number of prompts that it processed.

The user will run the CLI repeatedly so it is important that it is capable of running repeatedly without creating redundant (duplicate) data.

© Daniel Rosehill · CC BY 4.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 10,789 prompts

More by @OpenSourceBuffGuy

See all
Parameterized PowerShell AD OU Mover prompt image

Parameterized PowerShell AD OU Mover

Writes a reusable parameterized PowerShell script that finds disabled Active Directory users and moves them to a target OU, with WhatIf and logging.

powershell, code-generation, windows, act-as, workflow-automation, sysadmin, structured-output, code, for-developers, for-devops-engineers, guardrails, template, placeholders, scheduling, log-analysis, documentation, security-awareness, advanced, step-by-step-guide, active-directory

Next.js (TanStack Query v5) prompt image

Next.js (TanStack Query v5)

Guides Cursor through Next.js App Router with TanStack Query v5: provider setup, server prefetch with HydrationBoundary, Server Actions as mutations and optimistic updates.

rule-file, cursor, act-as, nextjs, tanstack, react, typescript, frontend, web-development, state-management, best-practices, performance-optimization, software-architecture, for-developers, coding, code-generation, long-form, advanced, structured-output

Beijing 7-Day Travel Itinerary: Illustrated Guide to Landmarks prompt image

Beijing 7-Day Travel Itinerary: Illustrated Guide to Landmarks

Draws a child-like crayon travel journal of any city, with a winding route map, landmarks, foods and playful doodles, filled in from a city name and number of days.

image-prompt, placeholders, template, travel, illustration, doodle, cartoon, whimsical, cozy, vibrant-colors, vertical-format, text-rendering, landmarks, maps, for-travelers, family-friendly, storybook, for-families, china, long-form, cityscape

Reviews

Loading reviews…

Discussion

Loading comments…