A control plane for composable AI prompting
Overview Β· Quick Install Β· Usage Examples Β· Variables Β· Sources Β· Save Β· Tasks Β· Tutorials Β· References Β· Packs Β· Integrations Β· Contributing Β· License
Create ready-to-use, high-quality prompts with a single command π
PromptNG is a modular CLI for composing, managing, and orchestrating reusable AI prompt components.
Instead of storing static snippets, PromptNG treats prompts as structured building blocks β roles, tasks, content, reasoning patterns, and controls β that can be assembled, parameterized, and reused across projects.
Designed for users who think in systems, not snippets.
β¨ Why PromptNG?
- π§± Modular prompt components
- π€ Agent presets
- π§© Variable injection
- π Fine-grained controls
- π» CLI workflow
- π‘π Integrations: Agentic AI systems, pipelines, Bash, Python & more
π Built For
- Developers and AI engineers building system-driven prompting workflows instead of ad-hoc prompt strings
- Prompt engineers designing composable architectures using roles, tasks, patterns, and control layers
- DevOps and automation engineers embedding prompt generation into pipelines, scripts, and terminal-native processes
- Technical teams standardizing and versioning prompt logic as reusable, evolvable components
- Power users treating prompts as programmable interfaces rather than static text
- Students and educators learning how structured prompting enables more reliable and controllable AI behavior
π‘ Why It Matters
PromptNG turns prompting into a structured, scalable system:
- Reduce costs & token usage
Avoid inefficient prompts and unnecessary API calls - Improve output quality
Generate consistent, reliable AI responses - Work faster
Build prompts instantly instead of starting from scratch - Eliminate repetition
Reuse prompt logic across projects - Scale without chaos
Grow from a few prompts to many while keeping everything organized - Standardize AI interactions
Ensure consistent behavior across teams and environments - Think in systems, not strings
Move from ad-hoc prompts to structured, intentional design - Treat prompts like code
Versioned, reusable, and maintainable assets
pip install --upgrade promptng # or pip3 or pip3.exe depending on your system
pp --helpThis option requires pip already installed on your machine.
# 1. Install uv (if not installed)
# Linux / macOS
curl -Ls https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# 2. Clone the repository
git clone https://github.com/estebantechdev/prompt-ng.git
# 3. Enter the project directory
cd prompt-ng
# 4. (Optional) Let uv install a compatible Python version automatically
# This will install and use a supported version (e.g., 3.11 or 3.12)
uv python install
# 5. Sync dependencies (creates .venv and installs everything)
uv sync
# If your virtual environment is not activated, run:
# Linux / macOS
source .venv/bin/activate
# Windows (PowerShell)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
.venv\Scripts\Activate.ps1
# 6. Run PromptNG
uv run pp --help
# Example usage
uv run pp list roles
# Optional: install as a global CLI tool
uv tool install .
# Then you can run:
pp --help
Important
If you encounter: "env: 'python3': No such file or directory", ensure the first line of main.py is:
#!/usr/bin/env pythonImportant
π Clipboard features on Linux require external tools.
Install xsel or xclip using your system package manager.
On Wayland-based systems, you may need wl-clipboard.
π More Installation Options
List available roles:
pp list rolesFilter results using a single pattern:
# Linux / macOS
pp list roles | grep exe
# Windows (PowerShell)
pp list roles | findstr exeFilter results using multiple patterns (te or utor):
# Linux / macOS
pp list roles | grep -E 'te|utor'
# Windows (PowerShell)
pp list roles | Select-String -Pattern "te|utor"Example output:
executor
technical_instructor
tutor
Note
The list command may also be used with the following parameters: agents, content, controls, pattern_groups, patterns, projects, skills, tasks.
Note
The search command lets you quickly find built-in and custom prompt components in the prompts library.
Examples
# List all matches for βroleβ
pp search roleThis will return ranked results containing any items related to βroleβ, including filenames and content matches.
For a full list of available CLI commands, refer to the official π PromptNG Commands documentation.
PromptNG supports two workflows:
-
buildgenerates a prompt using a predefined agent preset. -
composegenerates a prompt by manually combining role, task, and pattern components.
controls and content are optional components and can be included as neededβthey are not required.
Create a prompt using a predefined agent:
pp build math_tutor --var input="Explain recursion"Copy the generated prompt directly to the clipboard:
pp build math_tutor --var input="Explain recursion" --copyCompose a prompt by combining a role, task, and pattern:
pp compose \
--role tutor \
--task explain \
--pattern step_by_step \
--var input="Boolean algebra simplification"Including multiple patterns and variables:
pp compose \
--role tutor \
--task explain \
--pattern socratic \
--pattern step_by_step \
--var input="Gravity" \
--var theorist="Albert Einstein"Note
The explanation response from the AI model used will vary depending on the selected theorist. With Albert Einstein will frame "gravity" as the curvature of spacetime; with Isaac Newton will describe gravity as a force acting between masses.
The variable theorist does not exist in the built-in version of the task explain. It has been introduced intentionally for this example to demonstrate how custom variables can modify and enrich a promptβs behavior.
Tip
If you do not need to create additional --var variables such as theorist, you can embed the context directly in the input parameter:
pp compose --role tutor --task explain --pattern socratic --pattern step_by_step --var input="Gravity, by Isaac Newton" --copyTo inject dynamic values into your prompt, the template must reference them using Jinja syntax.
Your task file (inside tasks/) must include at least one variable placeholder. For example:
{{ input }}The variable name in the template must match the key used in the command line.
For example, {{ input }} in the template corresponds to the input variable passed via the CLI.
Note
If you omit the --var parameter, the prompt will be generated without injected values. This allows you to preview, copy, or reuse the base prompt structure independently.
PromptNG supports three types of variable sources:
Use --var to pass simple key-value pairs directly from the command line.
pp compose \
--role tutor \
--task explain \
--pattern socratic \
--var input="Random text"Note
- Format must be key=value
- Values are treated as plain text
- Best suited for short inputs or dynamic values
Use --var-file to load the value of a variable from a file instead of passing it inline.
The entire file content is injected as the variable value, making this ideal for larger inputs such as articles, datasets, or structured prompts.
Example
pp compose \
--role tutor \
--task explain \
--pattern socratic \
--var-file input=content/puzzle.mdNote
Supported file formats include .md, .txt, and extensionless (plain text) files.
Only .md files are listed when using pp list.
You can omit the extension:
--var-file input=content/<category>/<file>Tip
Store your files under content/ to reference them by name without specifying full paths and keep all your prompt components in one place.
Path resolution
--var-file resolves file paths by first checking the provided path as-is relative to the current working directory, automatically trying .md and .txt extensions if none are specified; if not found, it attempts to resolve the path relative to the project root (BASE_DIR) using the same extension fallback; finally, it performs a recursive search within the content/ directory, matching files by exact name or by name without extension (limited to .md, .txt, or no extension).
Use --var-dir to load and combine the contents of all files in a directory.
All files are read recursively and concatenated into a single variable.
Example
pp compose \
--role tutor \
--task explain \
--pattern socratic \
--var-dir input=content \
--copyCaution
Using --var-dir on very large directories can produce a combined variable that exceeds your AI model's context window, which may cause truncation or errors. Consider limiting the number or size of files loaded.
--var-dir input=content/<category>/<sub-category>/Tip
Store your files under content/ to reference them by name without specifying full paths and keep all your prompt components in one place.
File filtering
Only .md and .txt files are included when loading directory contents. Hidden files (such as .DS_Store) and any unsupported file types are ignored during the process.
Path resolution
--var-dir resolves directory paths by first checking the provided path as-is relative to the current working directory; if not found, it attempts to resolve the path relative to the project root (BASE_DIR). Once resolved, it recursively loads all .md and .txt files within the directory (ignoring hidden files) and concatenates their contents into a single value separated by blank lines. No additional recursive lookup is performed if the directory is not found.
You can combine multiple variable sources in the same command:
pp compose \
--role tutor \
--task explain \
--pattern didactic \
--var input="Random text" \
--var-file input2=./content/puzzle.md \
--var-dir input3=./content \
--copyThis allows complex prompt construction from multiple sources.
Note
The variables input2 and input3 don't exist in the built-in version of the task explain.
Important
If the same variable name is used multiple times, the last processed value overrides previous ones.
- Processing order:
--varβ--var-fileβ--var-dir
Example
pp compose \
--role tutor \
--task explain \
--pattern didactic \
--var input="Random text" \
--var-file input=./content/puzzle.md \
--var-dir input=./content \
--copyTip
β Use unique variable names whenever possible.
β Declare expected variables clearly in your task templates.
β Reuse variable names only when intentional overwriting is desired.
You can redirect the output of the command to an external file if you want to save or reuse the generated prompt.
Examples
pp build math_tutor --var input="Explain recursion" > my_prompt.txtpp compose \
--role tutor \
--task explain \
--pattern didactic \
--var input="Random text" \
--var-file input=./content/puzzle.md \
--var-dir input=./content \
> my_prompt.txtView the saved prompt:
cat /path/to/my_prompt.txtPromptNG provides two built-in, generic task types: explain and action, which together cover most AIβhuman interaction scenarios.
π¬ Explain β Describe the reasoning without performing any tasks.
We introduced the explain task in the previous examples. Now it's time to look at a couple of examples using the action task.
To create an action prompt with build, you must use the built-in action_agent agent and pass a single variable named action as a command parameter. This variable maps directly to the built-in task action. The entire action content must be provided as the value of action after the = sign.
Example
pp build action_agent --var action="Make a shopping list"Tip
Quickly filter the list of available agents:
pp list agents | grep actionTip
View the full definition of a specific agent:
pp show agents/action_agentTip
Start from the action_agent file when creating new action agents, such as software_tester.
See later sections for advanced usage.
To create an action prompt with compose, you must use the built-in executor role and pass a single task named compose_action in the command parameters. The action content must be defined through the action variable, while context and examples remain optional but are strongly recommended to improve output quality.
The following example demonstrates how context and examples can guide an AI language model to better understand the request and generate more accurate, reliable results:
pp compose \
--role executor \
--task compose_action \
--pattern verify_before_execute \
--pattern plan_execute \
--pattern structured_output \
--var action="Make a shopping list" \
--var context="I am at the computer store" \
--var examples="|Item |Brand |Price | |Mouse |Genius |$45.75 |"Tip
List available categories and components:
# List main categories
pp show prompts
# List a category
# pp list <category>
pp list roles
# List a subcategory
# pp list <category>/<subcategory>
pp list content/devTip
View the full definition of a specific component:
# pp show <category>/<component>
pp show roles/executor
pp list content/dev/testingTip
Use the provided example as a starting point when creating new action prompts with compose.
See later sections for advanced features, such as using controls.
Want a step-by-step guide to creating new agents, roles, tasks, and patterns?
π Creating And Using New Prompt Components
Complete tutorial on how to create and use a pattern group.
π Creating And Using Pattern Groups
Understand how PromptNG separates execution control from output behavior:
Understanding how to use prompt controls in agentic systems.
π Prompt Controls In Agentic Systems
Learn how to integrate PromptNG with external AI systems and codebases by centralizing agents, skills, commands, and other AI interaction logic in a shared prompts/ directory.
This guide covers how to structure global and project-level AI components, avoid duplication across repositories, and connect external projects using symbolic links for a clean, scalable architecture.
π AI Systems Integration Guide
The prompts directory contains the core building blocks for creating prompts in PromptNG, organized into subdirectories that represent specific component types such as roles, tasks, patterns, and agent presets.
π Prompt Components Reference
Learn how to define agent presets and pattern groups using YAML files, including syntax, structure, and best practices.
For a complete list of available commands and quick CLI examples:
π Command Usage
Understanding modern prompting frameworks helps you use PromptNG more effectively.
A quick reference for key terminology used across PromptNG.
π Glossary Of Terms
Component Packs are curated collections of prompt components designed to work together as cohesive, reusable building blocks.
Adding a single component helpsβbut Packs unlock much more:
-
Designed To Work Together
Components are built to integrate seamlessly. -
Opinionated By Design
Built-in best practices, not guesswork. -
Faster Implementation
Activate full workflows instantly. -
Versioned & Evolvable
Easy to improve and maintain over time. -
Team Standardization
Consistent results across projects. -
Shareable Ecosystems
Package and reuse complete solutions.
One of the most powerful aspects of PromptNG is that anyone can create their own Pack.
If youβve developed a useful combination of components, you can:
- Package it into a reusable system
- Share it with your team or the community
- Continuously improve it through versions
- Contribute to a growing ecosystem of domain-specific Packs
Users can explore guidelines and published Packs here: π PromptNG Packs Repository.
-
π¬ Software Testing Pack
Includes test generation tasks, edge-case patterns, QA roles, and validation controls -
π Data Analysis Pack
Provides analyst roles, structured output patterns, and transformation tasks -
π Education Pack
Combines tutor roles, explanation tasks, and step-by-step reasoning patterns -
βΎοΈ DevOps Pack
Includes automation roles, action tasks, and execution/verification patterns
Once added, all components in a Pack become available through the CLIβgiving you a complete, ready-to-use prompting system in seconds.
PromptNG outputs plain text, which means it integrates naturally with the Unix philosophy of small tools connected by pipes.
This allows prompts to flow directly into other programs such as AI models, speech engines, desktop tools, APIs, and automation scripts.
Example
pp build math_tutor --var input="Explain recursion" \
| ollama run llama3 \
| espeak-ngPipeline flow:
- PromptNG β LLM β speech synthesis
For more examples and integrations with tools such as curl, pandoc, zenity, and netcat, see: π Prompt Pipelines.
PromptNG integrates easily with shell scripts and command-line automation.
Because Bash expands variables before executing a command, you can dynamically construct prompts using variables or command outputs.
Example
topic="recursion"
language="Python"
pp build math_tutor --var input="Explain ${topic} in ${language}"PromptNG can also consume values from other commands or scripts, making it ideal for automation pipelines.
For more examples using Bash variables, command substitution, and scripting patterns, see: π Using Bash Variables With PromptNG.
PromptNG can be used seamlessly inside Python scripts, enabling automation, testing, and integration with larger applications.
Example
import subprocess
def test_pp_list_roles():
result = subprocess.run(
["pp", "list", "roles"],
capture_output=True,
text=True
)
assert result.returncode == 0, "Command failed"
assert result.stdout.strip() != "", "No output returned"
print(result.stdout)
if __name__ == "__main__":
test_pp_list_roles()To run the script:
python test.pyπ More Examples With Python.
Contributions are always welcome in the PromptNG ecosystem.
Whether you're fixing a small issue or introducing a complete Component Pack, your work helps expand what others can build.
If youβve built something reusable, open a pull request and help grow the ecosystem.
You can contribute in several ways:
-
π¦ Create New Component Packs
Design Packs for specific domains, workflows, or industries and share them with the community. -
π§± Add or Improve Components
Enhance existing components or introduce reusable ones. -
π Report Bugs & Suggest Features
Help improve stability and propose new ideas. -
π Improve Documentation
Add examples, clarify concepts, and expand guides.
This project is licensed under the GPL-3.0 - see the LICENSE file for details.
