A CLI tool that generates dynamic prompts from templates using variable substitution, perfect for AI assistants and repeatable workflows.
npm install mkprompt
A CLI tool that generates dynamic prompts from templates using variable substitution, perfect for AI assistants and repeatable workflows.
- š Interactive CLI - Select prompts and fill variables interactively
- š Dynamic Variables - Use syntax for templating
- āļø Configurable - Customize paths, comments, and output settings
- šÆ AI-Friendly - Generate prompts ready for ChatGPT, Claude, and others
- š§ Zero Dependencies - Pure Node.js, no external dependencies
- š Organized Output - Timestamped files for easy tracking
- šØ Beautiful CLI - Colorful and intuitive interface
``bash`
npm install -g mkprompt
`bash`
mkprompt config
This creates:
- mkprompt.config.json - Configuration fileprompts/
- - Directory for your prompt templatesmkprompt/
- - Output directory (added to .gitignore)
- An example prompt template
`bash`
mkprompt
1. Run mkprompt in your project directory
2. Select a prompt from your templates
3. Fill in the variables when prompted
4. Get your generated prompt in the mkprompt/ directory
`
$ mkprompt
š Available Prompts
1) code-review.txt
2) documentation.txt
3) refactor.txt
? Select a prompt (1-3): 1
ā Selected: code-review.txt
ā¹ Found 3 variable(s): language, framework, focus_area
š Fill in the variables
? language: TypeScript
? framework: NestJS
? focus_area: performance optimization
⨠Prompt generated successfully!
ā Output: mkprompt/code-review_2025-01-15_14-30-45.txt
`
Use in your prompt templates:
`
You are an expert in .
The project is called and uses .
Please help with:
Focus on:
-
-
`
- Use underscores for multi-word variables: user name
- Variables are displayed with spaces:
- Same variable can appear multiple times (only asked once)
The mkprompt.config.json file:
`json`
{
"prompts_path": "./prompts",
"first_comment": "/ Prompt Generated by mkprompt /",
"last_comment": "/ End of Prompt /"
}
| Option | Description | Default |
| --------------- | ------------------------------------- | -------------------------------------- |
| prompts_path | Directory containing prompt templates | "./prompts" |first_comment
| | Comment added at the beginning | "/ Prompt Generated by mkprompt /" |last_comment
| | Comment added at the end | "/ End of Prompt /" |
Generated prompts are saved as:
``
mkprompt/
āāā promptname_YYYY-MM-DD_HH-MM-SS.txt
Example output:
`
/ Prompt Generated by mkprompt /
You are an expert in TypeScript.
The project is called MyApp and uses NestJS.
Please help with:
Optimize database queries for better performance
Focus on:
- Query efficiency
- Caching strategies
/ End of Prompt /
`
`
You are a senior developer reviewing code.
Project:
Framework:
Review the following code focusing on:
-
- Best practices
- Potential bugs
Code to review:
`
`
Generate documentation for a in .
Component name:
Purpose:
Include:
- Description
- Parameters/Props
- Usage examples
-
`
`
Refactor the following code.
Current implementation:
Goals:
-
-
Constraints:
- Maintain backward compatibility with
- Follow guidelines
`
| Command | Description |
| -------------------- | ------------------------------------ |
| mkprompt | Interactive prompt generation |mkprompt config
| | Create configuration and directories |mkprompt help
| | Show help message |mkprompt --version
| | Show version |
After running mkprompt config:
``
your-project/
āāā mkprompt.config.json # Configuration
āāā prompts/ # Your prompt templates
ā āāā example.txt # Example template
āāā mkprompt/ # Generated outputs (gitignored)
ā āāā example_2025-01-15_14-30-45.txt
āāā .gitignore # Updated with mkprompt/
- AI Pair Programming - Generate consistent prompts for code assistance
- Documentation - Create templated requests for doc generation
- Code Reviews - Standardize review request prompts
- Onboarding - Create repeatable prompts for common tasks
- Team Workflows - Share prompt templates across your team
- ā
Windows - Full support
- ā
macOS - Full support
- ā
Linux - Full support
- Node.js 14.0+
- npm (for installation)
1. Ensure npm global bin is in your PATH
2. Try: npm bin -g to see installation location
3. Restart your terminal
`bash``
sudo npm install -g mkprompt
Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors
Contributions are welcome! Please feel free to submit pull requests or open issues.
MIT License - see LICENSE file for details.
David200197 - GitHub
- mkctx - Generate markdown context from your codebase