prompt-flex-cli is a versatile command-line tool designed to generate dynamic prompts for ChatGPT using various input sources. It supports a flexible configuration system, allowing users to fetch inputs from environment variables, command-line arguments, files, and standard input. The tool also allows for customizable output methods, such as printing to the console or writing to a file.
- Flexible Input Sources: Fetch data from environment variables, command-line arguments, files, and standard input.
- Dynamic Prompt Generation: Use templating to create dynamic prompts for ChatGPT.
- Configurable Output: Output results to the console or save to a file.
- Easy Configuration: Define input, prompt, and output settings declaratively using a YAML configuration file.
To install prompt-flex-cli, ensure you have Node.js and npm installed, then clone the repository and install dependencies:
git clone https://github.com/yourusername/promptflexcli.git
cd promptflexcli
npm install && npm build && npm link
prompt-flex-cli allows you to dynamically generate prompts using various plugins configured via a YAML file. To get started, follow these steps:
-
Prepare the Configuration File:
- Copy the example configuration file provided in
./examples/.prompt-flex.yaml
to your home directory as~/.prompt-flex.yaml
. - This file defines the plugins, their descriptions, inputs, and prompt templates.
Example command:
cp ./examples/.prompt-flex.yaml ~/.prompt-flex.yaml
- Copy the example configuration file provided in
To run a specific plugin, use the following command structure:
prompt-flex run <plugin-name> [options]
The anki-generator plugin is designed to generate flashcards in CSV format. Here's how you can use it:
- Prepare Your Input File. Ensure you have a text file (e.g., a.txt) that contains the list of words you want to generate flashcards for.
- Run the Plugin. Use the command below to execute the anki-generator with the specified file:
prompt-flex run anki-generator --file a.txt
- Configuration: Guides users to place the configuration file in the correct location (
~/.prompt-flex.yaml
). - Running Plugins: Provides clear instructions on how to execute specific plugins, using the
anki-generator
andgitignore
as examples. - YAML Structure and Customization: Encourages users to understand and potentially modify the YAML configuration to fit their requirements.