pdd-cli 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pdd-cli might be problematic. Click here for more details.
- pdd/__init__.py +0 -0
- pdd/auto_deps_main.py +98 -0
- pdd/auto_include.py +175 -0
- pdd/auto_update.py +73 -0
- pdd/bug_main.py +99 -0
- pdd/bug_to_unit_test.py +159 -0
- pdd/change.py +141 -0
- pdd/change_main.py +240 -0
- pdd/cli.py +607 -0
- pdd/cmd_test_main.py +155 -0
- pdd/code_generator.py +117 -0
- pdd/code_generator_main.py +66 -0
- pdd/comment_line.py +35 -0
- pdd/conflicts_in_prompts.py +143 -0
- pdd/conflicts_main.py +90 -0
- pdd/construct_paths.py +251 -0
- pdd/context_generator.py +133 -0
- pdd/context_generator_main.py +73 -0
- pdd/continue_generation.py +140 -0
- pdd/crash_main.py +127 -0
- pdd/data/language_format.csv +61 -0
- pdd/data/llm_model.csv +15 -0
- pdd/detect_change.py +142 -0
- pdd/detect_change_main.py +100 -0
- pdd/find_section.py +28 -0
- pdd/fix_code_loop.py +212 -0
- pdd/fix_code_module_errors.py +143 -0
- pdd/fix_error_loop.py +216 -0
- pdd/fix_errors_from_unit_tests.py +240 -0
- pdd/fix_main.py +138 -0
- pdd/generate_output_paths.py +194 -0
- pdd/generate_test.py +140 -0
- pdd/get_comment.py +55 -0
- pdd/get_extension.py +52 -0
- pdd/get_language.py +41 -0
- pdd/git_update.py +84 -0
- pdd/increase_tests.py +93 -0
- pdd/insert_includes.py +150 -0
- pdd/llm_invoke.py +304 -0
- pdd/load_prompt_template.py +59 -0
- pdd/pdd_completion.fish +72 -0
- pdd/pdd_completion.sh +141 -0
- pdd/pdd_completion.zsh +418 -0
- pdd/postprocess.py +121 -0
- pdd/postprocess_0.py +52 -0
- pdd/preprocess.py +199 -0
- pdd/preprocess_main.py +72 -0
- pdd/process_csv_change.py +182 -0
- pdd/prompts/auto_include_LLM.prompt +230 -0
- pdd/prompts/bug_to_unit_test_LLM.prompt +17 -0
- pdd/prompts/change_LLM.prompt +34 -0
- pdd/prompts/conflict_LLM.prompt +23 -0
- pdd/prompts/continue_generation_LLM.prompt +3 -0
- pdd/prompts/detect_change_LLM.prompt +65 -0
- pdd/prompts/example_generator_LLM.prompt +10 -0
- pdd/prompts/extract_auto_include_LLM.prompt +6 -0
- pdd/prompts/extract_code_LLM.prompt +22 -0
- pdd/prompts/extract_conflict_LLM.prompt +19 -0
- pdd/prompts/extract_detect_change_LLM.prompt +19 -0
- pdd/prompts/extract_program_code_fix_LLM.prompt +16 -0
- pdd/prompts/extract_prompt_change_LLM.prompt +7 -0
- pdd/prompts/extract_prompt_split_LLM.prompt +9 -0
- pdd/prompts/extract_prompt_update_LLM.prompt +8 -0
- pdd/prompts/extract_promptline_LLM.prompt +11 -0
- pdd/prompts/extract_unit_code_fix_LLM.prompt +332 -0
- pdd/prompts/extract_xml_LLM.prompt +7 -0
- pdd/prompts/fix_code_module_errors_LLM.prompt +17 -0
- pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +62 -0
- pdd/prompts/generate_test_LLM.prompt +12 -0
- pdd/prompts/increase_tests_LLM.prompt +16 -0
- pdd/prompts/insert_includes_LLM.prompt +30 -0
- pdd/prompts/split_LLM.prompt +94 -0
- pdd/prompts/summarize_file_LLM.prompt +11 -0
- pdd/prompts/trace_LLM.prompt +30 -0
- pdd/prompts/trim_results_LLM.prompt +83 -0
- pdd/prompts/trim_results_start_LLM.prompt +45 -0
- pdd/prompts/unfinished_prompt_LLM.prompt +18 -0
- pdd/prompts/update_prompt_LLM.prompt +19 -0
- pdd/prompts/xml_convertor_LLM.prompt +54 -0
- pdd/split.py +119 -0
- pdd/split_main.py +103 -0
- pdd/summarize_directory.py +212 -0
- pdd/trace.py +135 -0
- pdd/trace_main.py +108 -0
- pdd/track_cost.py +102 -0
- pdd/unfinished_prompt.py +114 -0
- pdd/update_main.py +96 -0
- pdd/update_prompt.py +115 -0
- pdd/xml_tagger.py +122 -0
- pdd_cli-0.0.2.dist-info/LICENSE +7 -0
- pdd_cli-0.0.2.dist-info/METADATA +225 -0
- pdd_cli-0.0.2.dist-info/RECORD +95 -0
- pdd_cli-0.0.2.dist-info/WHEEL +5 -0
- pdd_cli-0.0.2.dist-info/entry_points.txt +2 -0
- pdd_cli-0.0.2.dist-info/top_level.txt +1 -0
pdd/xml_tagger.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
from typing import Tuple
|
|
2
|
+
from rich import print as rprint
|
|
3
|
+
from rich.markdown import Markdown
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
|
+
from .load_prompt_template import load_prompt_template
|
|
6
|
+
from .llm_invoke import llm_invoke
|
|
7
|
+
|
|
8
|
+
class XMLOutput(BaseModel):
|
|
9
|
+
xml_tagged: str = Field(description="The XML-tagged version of the prompt")
|
|
10
|
+
|
|
11
|
+
def xml_tagger(
|
|
12
|
+
raw_prompt: str,
|
|
13
|
+
strength: float,
|
|
14
|
+
temperature: float,
|
|
15
|
+
verbose: bool = False
|
|
16
|
+
) -> Tuple[str, float, str]:
|
|
17
|
+
"""
|
|
18
|
+
Enhance a given LLM prompt by adding XML tags to improve its structure and readability.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
raw_prompt (str): The prompt that needs XML tagging
|
|
22
|
+
strength (float): The strength parameter for the LLM model (0-1)
|
|
23
|
+
temperature (float): The temperature parameter for the LLM model (0-1)
|
|
24
|
+
verbose (bool): Whether to print detailed information
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
Tuple[str, float, str]: (xml_tagged, total_cost, model_name)
|
|
28
|
+
"""
|
|
29
|
+
try:
|
|
30
|
+
# Input validation
|
|
31
|
+
if not raw_prompt or not isinstance(raw_prompt, str):
|
|
32
|
+
raise ValueError("raw_prompt must be a non-empty string")
|
|
33
|
+
if not 0 <= strength <= 1:
|
|
34
|
+
raise ValueError("strength must be between 0 and 1")
|
|
35
|
+
if not 0 <= temperature <= 1:
|
|
36
|
+
raise ValueError("temperature must be between 0 and 1")
|
|
37
|
+
|
|
38
|
+
total_cost = 0.0
|
|
39
|
+
model_name = ""
|
|
40
|
+
|
|
41
|
+
# Step 1: Load prompt templates
|
|
42
|
+
xml_converter_prompt = load_prompt_template("xml_convertor_LLM")
|
|
43
|
+
extract_xml_prompt = load_prompt_template("extract_xml_LLM")
|
|
44
|
+
|
|
45
|
+
if not xml_converter_prompt or not extract_xml_prompt:
|
|
46
|
+
raise ValueError("Failed to load prompt templates")
|
|
47
|
+
|
|
48
|
+
# Step 2: First LLM invoke for XML conversion
|
|
49
|
+
if verbose:
|
|
50
|
+
rprint("[blue]Running XML conversion...[/blue]")
|
|
51
|
+
|
|
52
|
+
conversion_response = llm_invoke(
|
|
53
|
+
prompt=xml_converter_prompt,
|
|
54
|
+
input_json={"raw_prompt": raw_prompt},
|
|
55
|
+
strength=strength,
|
|
56
|
+
temperature=temperature,
|
|
57
|
+
verbose=verbose
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
xml_generated_analysis = conversion_response.get('result', '')
|
|
61
|
+
total_cost += conversion_response.get('cost', 0.0)
|
|
62
|
+
model_name = conversion_response.get('model_name', '')
|
|
63
|
+
|
|
64
|
+
if verbose:
|
|
65
|
+
rprint("[green]Intermediate XML result:[/green]")
|
|
66
|
+
rprint(Markdown(xml_generated_analysis))
|
|
67
|
+
|
|
68
|
+
# Step 3: Second LLM invoke for XML extraction
|
|
69
|
+
if verbose:
|
|
70
|
+
rprint("[blue]Extracting final XML structure...[/blue]")
|
|
71
|
+
|
|
72
|
+
extraction_response = llm_invoke(
|
|
73
|
+
prompt=extract_xml_prompt,
|
|
74
|
+
input_json={"xml_generated_analysis": xml_generated_analysis},
|
|
75
|
+
strength=0.89, # Fixed strength as specified
|
|
76
|
+
temperature=temperature,
|
|
77
|
+
verbose=verbose,
|
|
78
|
+
output_pydantic=XMLOutput
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
result: XMLOutput = extraction_response.get('result')
|
|
82
|
+
total_cost += extraction_response.get('cost', 0.0)
|
|
83
|
+
|
|
84
|
+
# Step 4: Print results if verbose
|
|
85
|
+
if verbose:
|
|
86
|
+
rprint("[green]Final XML-tagged prompt:[/green]")
|
|
87
|
+
rprint(Markdown(result.xml_tagged))
|
|
88
|
+
rprint(f"[yellow]Total cost: ${total_cost:.6f}[/yellow]")
|
|
89
|
+
rprint(f"[yellow]Model used: {model_name}[/yellow]")
|
|
90
|
+
|
|
91
|
+
# Step 5 & 6: Return results
|
|
92
|
+
return result.xml_tagged, total_cost, model_name
|
|
93
|
+
|
|
94
|
+
except Exception as e:
|
|
95
|
+
rprint(f"[red]Error in xml_tagger: {str(e)}[/red]")
|
|
96
|
+
raise
|
|
97
|
+
|
|
98
|
+
def main():
|
|
99
|
+
"""Example usage of the xml_tagger function"""
|
|
100
|
+
try:
|
|
101
|
+
sample_prompt = """
|
|
102
|
+
Write a function that calculates the factorial of a number.
|
|
103
|
+
The function should handle negative numbers and return appropriate error messages.
|
|
104
|
+
Include examples of usage and error cases.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
xml_tagged, cost, model = xml_tagger(
|
|
108
|
+
raw_prompt=sample_prompt,
|
|
109
|
+
strength=0.7,
|
|
110
|
+
temperature=0.8,
|
|
111
|
+
verbose=True
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
rprint("[blue]XML Tagging Complete[/blue]")
|
|
115
|
+
rprint(f"Total Cost: ${cost:.6f}")
|
|
116
|
+
rprint(f"Model Used: {model}")
|
|
117
|
+
|
|
118
|
+
except Exception as e:
|
|
119
|
+
rprint(f"[red]Error in main: {str(e)}[/red]")
|
|
120
|
+
|
|
121
|
+
if __name__ == "__main__":
|
|
122
|
+
main()
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Greg Lin Tanaka
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pdd-cli
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: PDD (Prompt-Driven Development) Command Line Interface
|
|
5
|
+
Author-email: Greg Tanaka <glt@alumni.caltech.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/gltanaka/pdd
|
|
8
|
+
Project-URL: Repository, https://github.com/gltanaka/pdd.git
|
|
9
|
+
Project-URL: Issue-Tracker, https://github.com/gltanaka/pdd/issues
|
|
10
|
+
Keywords: prompt-driven development,code generation,AI,LLM,unit testing,software development
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/x-rst
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: GitPython==3.1.43
|
|
21
|
+
Requires-Dist: anthropic==0.34.2
|
|
22
|
+
Requires-Dist: click==8.1.7
|
|
23
|
+
Requires-Dist: fuzzywuzzy==0.18.0
|
|
24
|
+
Requires-Dist: langchain==0.3.1
|
|
25
|
+
Requires-Dist: langchain_anthropic==0.2.1
|
|
26
|
+
Requires-Dist: langchain_community==0.3.1
|
|
27
|
+
Requires-Dist: langchain_core==0.3.7
|
|
28
|
+
Requires-Dist: langchain_fireworks==0.2.0
|
|
29
|
+
Requires-Dist: langchain_google_genai==2.0.0
|
|
30
|
+
Requires-Dist: langchain_groq==0.2.0
|
|
31
|
+
Requires-Dist: langchain_openai==0.2.1
|
|
32
|
+
Requires-Dist: langchain_together==0.2.0
|
|
33
|
+
Requires-Dist: pandas==2.2.3
|
|
34
|
+
Requires-Dist: pydantic==2.9.2
|
|
35
|
+
Requires-Dist: pytest==8.3.2
|
|
36
|
+
Requires-Dist: rich==13.9.1
|
|
37
|
+
Requires-Dist: tiktoken==0.7.0
|
|
38
|
+
Requires-Dist: build
|
|
39
|
+
Requires-Dist: python-Levenshtein
|
|
40
|
+
Requires-Dist: pytest-cov
|
|
41
|
+
Requires-Dist: langchain_ollama
|
|
42
|
+
Requires-Dist: langchain-google-vertexai
|
|
43
|
+
|
|
44
|
+
PDD (Prompt-Driven Development) Command Line Interface
|
|
45
|
+
======================================================
|
|
46
|
+
|
|
47
|
+
.. image:: https://img.shields.io/badge/pdd--cli-v0.0.2-blue
|
|
48
|
+
:alt: PDD-CLI Version
|
|
49
|
+
|
|
50
|
+
**Unlock the power of prompt-driven development with the PDD-CLI!**
|
|
51
|
+
|
|
52
|
+
PDD (Prompt-Driven Development) is a revolutionary approach to software development that leverages the power of AI to streamline your workflow. The `pdd-cli` package provides a powerful command-line interface to interact with the PDD ecosystem, allowing you to generate code, create examples, run tests, and manage prompt files with ease.
|
|
53
|
+
|
|
54
|
+
Key Features
|
|
55
|
+
------------
|
|
56
|
+
|
|
57
|
+
* **Code Generation:** Effortlessly generate runnable code from natural language prompts using the `generate` command.
|
|
58
|
+
* **Example Creation:** Automatically create example files from existing code and prompts with the `example` command.
|
|
59
|
+
* **Automated Testing:** Generate and enhance unit tests with the `test` command, including coverage analysis and improvement.
|
|
60
|
+
* **Prompt Management:** Preprocess, split, change, and update prompt files using commands like `preprocess`, `split`, `change`, and `update`.
|
|
61
|
+
* **Error Fixing:** Automatically fix errors in code and unit tests with the `fix` command, featuring iterative fixing and budget control.
|
|
62
|
+
* **Conflict Resolution:** Analyze and resolve conflicts between prompts using the `conflicts` command.
|
|
63
|
+
* **Crash Recovery:** Fix errors that caused a program to crash with the `crash` command, featuring iterative fixing and budget control.
|
|
64
|
+
* **Trace Analysis:** Find the associated line number between a prompt file and the generated code with the `trace` command.
|
|
65
|
+
* **Bug Reproduction:** Generate a unit test based on observed and desired outputs with the `bug` command.
|
|
66
|
+
* **Dependency Management:** Automatically analyze and insert dependencies into prompts with the `auto-deps` command.
|
|
67
|
+
* **Multi-Language Support:** Work with a wide range of programming languages, including Python, JavaScript, Java, C++, Ruby, and Go.
|
|
68
|
+
* **AI Model Control:** Fine-tune the AI model's output with options like `--strength` and `--temperature`.
|
|
69
|
+
* **Cost Tracking:** Monitor and report the cost of operations with the `--output-cost` option.
|
|
70
|
+
* **Example Review:** Review and control the use of few-shot examples with the `--review-examples` option.
|
|
71
|
+
* **Automatic Example Submission:** Automatically submit successful fixes to the PDD Cloud platform with the `--auto-submit` option.
|
|
72
|
+
* **Multi-Command Chaining:** Execute multiple PDD commands in a single line for efficient workflows.
|
|
73
|
+
* **Environment Variable Configuration:** Customize output locations and other settings using environment variables.
|
|
74
|
+
* **Git Integration:** Use git history to find the original code file with the `--git` option in the `update` command.
|
|
75
|
+
* **Auto-Update:** Stay up-to-date with the latest features and security patches (controllable via environment variable).
|
|
76
|
+
* **Comprehensive Help:** Access detailed help for all commands and options.
|
|
77
|
+
* **Tab Completion:** Enjoy tab completion for commands and options in compatible shells.
|
|
78
|
+
* **Colorized Output:** Benefit from colorized output for improved readability.
|
|
79
|
+
|
|
80
|
+
Installation
|
|
81
|
+
------------
|
|
82
|
+
|
|
83
|
+
Install `pdd-cli` using pip:
|
|
84
|
+
|
|
85
|
+
.. code-block:: bash
|
|
86
|
+
|
|
87
|
+
pip install pdd-cli
|
|
88
|
+
|
|
89
|
+
Verify the installation:
|
|
90
|
+
|
|
91
|
+
.. code-block:: bash
|
|
92
|
+
|
|
93
|
+
pdd --version
|
|
94
|
+
|
|
95
|
+
Advanced Installation
|
|
96
|
+
---------------------
|
|
97
|
+
|
|
98
|
+
For more control, you can install `pdd-cli` in a virtual environment:
|
|
99
|
+
|
|
100
|
+
.. code-block:: bash
|
|
101
|
+
|
|
102
|
+
# Create virtual environment
|
|
103
|
+
python -m venv pdd-env
|
|
104
|
+
|
|
105
|
+
# Activate environment
|
|
106
|
+
# On Windows:
|
|
107
|
+
pdd-env\Scripts\activate
|
|
108
|
+
# On Unix/MacOS:
|
|
109
|
+
source pdd-env/bin/activate
|
|
110
|
+
|
|
111
|
+
# Install PDD
|
|
112
|
+
pip install pdd-cli
|
|
113
|
+
|
|
114
|
+
API Key Setup
|
|
115
|
+
-------------
|
|
116
|
+
|
|
117
|
+
`pdd-cli` requires an API key for the language model. Set up your environment variable:
|
|
118
|
+
|
|
119
|
+
.. code-block:: bash
|
|
120
|
+
|
|
121
|
+
# For OpenAI
|
|
122
|
+
export OPENAI_API_KEY=your_api_key_here
|
|
123
|
+
|
|
124
|
+
# For Anthropic
|
|
125
|
+
export ANTHROPIC_API_KEY=your_api_key_here
|
|
126
|
+
|
|
127
|
+
# For other supported providers
|
|
128
|
+
export PROVIDER_API_KEY=your_api_key_here
|
|
129
|
+
|
|
130
|
+
Add these to your `.bashrc`, `.zshrc`, or equivalent for persistence.
|
|
131
|
+
|
|
132
|
+
Post-Installation Setup
|
|
133
|
+
------------------------
|
|
134
|
+
|
|
135
|
+
1. Enable tab completion:
|
|
136
|
+
|
|
137
|
+
.. code-block:: bash
|
|
138
|
+
|
|
139
|
+
pdd install_completion
|
|
140
|
+
|
|
141
|
+
2. Configure environment variables (optional):
|
|
142
|
+
|
|
143
|
+
.. code-block:: bash
|
|
144
|
+
|
|
145
|
+
# Add to .bashrc, .zshrc, or equivalent
|
|
146
|
+
export PDD_AUTO_UPDATE=true
|
|
147
|
+
export PDD_GENERATE_OUTPUT_PATH=/path/to/generated/code/
|
|
148
|
+
export PDD_TEST_OUTPUT_PATH=/path/to/tests/
|
|
149
|
+
|
|
150
|
+
Basic Usage
|
|
151
|
+
-----------
|
|
152
|
+
|
|
153
|
+
.. code-block:: bash
|
|
154
|
+
|
|
155
|
+
pdd [GLOBAL OPTIONS] COMMAND [OPTIONS] [ARGS]...
|
|
156
|
+
|
|
157
|
+
Global Options
|
|
158
|
+
--------------
|
|
159
|
+
|
|
160
|
+
* `--force`: Overwrite existing files without asking.
|
|
161
|
+
* `--strength FLOAT`: Set the AI model strength (0.0 to 1.0, default 0.5).
|
|
162
|
+
* `--temperature FLOAT`: Set the AI model temperature (default 0.0).
|
|
163
|
+
* `--verbose`: Increase output verbosity.
|
|
164
|
+
* `--quiet`: Decrease output verbosity.
|
|
165
|
+
* `--output-cost PATH_TO_CSV_FILE`: Enable cost tracking.
|
|
166
|
+
* `--review-examples`: Review and optionally exclude few-shot examples.
|
|
167
|
+
|
|
168
|
+
Commands
|
|
169
|
+
--------
|
|
170
|
+
|
|
171
|
+
Here's a quick overview of the core commands. Use `pdd COMMAND --help` for detailed information on each command.
|
|
172
|
+
|
|
173
|
+
1. **generate**: Create code from a prompt file.
|
|
174
|
+
2. **example**: Create an example file from code and its prompt.
|
|
175
|
+
3. **test**: Generate or enhance unit tests.
|
|
176
|
+
4. **preprocess**: Preprocess prompt files.
|
|
177
|
+
5. **fix**: Fix errors in code and unit tests.
|
|
178
|
+
6. **split**: Split large prompt files.
|
|
179
|
+
7. **change**: Modify a prompt based on a change prompt.
|
|
180
|
+
8. **update**: Update a prompt based on modified code.
|
|
181
|
+
9. **detect**: Determine which prompts need changes.
|
|
182
|
+
10. **conflicts**: Find conflicts between prompts.
|
|
183
|
+
11. **crash**: Fix errors that caused a program to crash.
|
|
184
|
+
12. **trace**: Find the associated line number between a prompt file and the generated code.
|
|
185
|
+
13. **bug**: Generate a unit test based on observed and desired outputs.
|
|
186
|
+
14. **auto-deps**: Analyze and insert dependencies into prompts.
|
|
187
|
+
|
|
188
|
+
Example Workflow
|
|
189
|
+
----------------
|
|
190
|
+
|
|
191
|
+
Here's a simple example of generating code and tests:
|
|
192
|
+
|
|
193
|
+
.. code-block:: bash
|
|
194
|
+
|
|
195
|
+
# Generate code
|
|
196
|
+
pdd generate --output src/factorial.py factorial_python.prompt
|
|
197
|
+
|
|
198
|
+
# Generate tests
|
|
199
|
+
pdd test --output tests/test_factorial.py factorial_python.prompt src/factorial.py
|
|
200
|
+
|
|
201
|
+
Multi-Command Chaining Example
|
|
202
|
+
------------------------------
|
|
203
|
+
|
|
204
|
+
You can chain multiple commands for complex workflows:
|
|
205
|
+
|
|
206
|
+
.. code-block:: bash
|
|
207
|
+
|
|
208
|
+
pdd generate --output src/calculator.py calculator_python.prompt test --output tests/test_calculator.py calculator_python.prompt src/calculator.py test --coverage-report coverage.xml --existing-tests tests/test_calculator.py --merge --target-coverage 95.0 calculator_python.prompt src/calculator.py
|
|
209
|
+
|
|
210
|
+
Why Choose PDD-CLI?
|
|
211
|
+
-------------------
|
|
212
|
+
|
|
213
|
+
* **Increased Productivity:** Automate tedious tasks and focus on higher-level design.
|
|
214
|
+
* **Improved Code Quality:** Leverage AI to generate well-structured and tested code.
|
|
215
|
+
* **Faster Development Cycles:** Rapidly prototype and iterate on your ideas.
|
|
216
|
+
* **Reduced Errors:** Automatically identify and fix errors in your code.
|
|
217
|
+
* **Enhanced Collaboration:** Work seamlessly with prompt files as a shared source of truth.
|
|
218
|
+
* **Cost-Effective:** Track and optimize your AI model usage.
|
|
219
|
+
|
|
220
|
+
Get Started Today!
|
|
221
|
+
------------------
|
|
222
|
+
|
|
223
|
+
Install `pdd-cli` and revolutionize your development workflow with the power of prompt-driven development. Explore the comprehensive documentation and examples to unlock the full potential of PDD.
|
|
224
|
+
|
|
225
|
+
For more information, visit the `pdd-cli` repository: [https://github.com/gltanaka/pdd](https://github.com/gltanaka/pdd)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
pdd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pdd/auto_deps_main.py,sha256=2lZ-8WqzrPVMnzuVC-O7y1gazRLbY66fbmOdKnkYKNg,3630
|
|
3
|
+
pdd/auto_include.py,sha256=aCa2QXDlOdKbh4vS3uDjWptkHB_Qv3QBNCbZe6mGWoo,6074
|
|
4
|
+
pdd/auto_update.py,sha256=IFqHx19GvUY3RTdd-AX3fj9RPigZflizbAzzfF3HixQ,2891
|
|
5
|
+
pdd/bug_main.py,sha256=myKU9--QWdkV4Wf3mD2PoLPJFNgRjwf4z8s7TC28G_s,3720
|
|
6
|
+
pdd/bug_to_unit_test.py,sha256=o9bW065UxjvGAn9u8UIwYbIM6R-WcGB2YWuOSXAD484,5569
|
|
7
|
+
pdd/change.py,sha256=JvHPxK9FfnuGJsEkzTpzWI4tg24OJahK0qTLDZSyNPg,4985
|
|
8
|
+
pdd/change_main.py,sha256=yL_i1Ws5vt4vAkWiC826csNi2cHP6wKbwe_PfMqbbPY,11407
|
|
9
|
+
pdd/cli.py,sha256=0wVpYiQztgkfd-lSCXjqOXtR62-vZ_r97B0KzCLPOn4,21011
|
|
10
|
+
pdd/cmd_test_main.py,sha256=aSCxRnSurg15AvPcJDAPp9xy8p_qqnjU1oV14Hi2R54,5301
|
|
11
|
+
pdd/code_generator.py,sha256=drfDqaRJcHumuOYuObQ0Fp__qV1mD46_7Dn1QiChSHs,4244
|
|
12
|
+
pdd/code_generator_main.py,sha256=MZ1ONZb4Nxg_9Yljj-ash_GAuV18CVa_qfPHfnh6sN0,2338
|
|
13
|
+
pdd/comment_line.py,sha256=sX2hf4bG1fILi_rvI9MkkwCZ2IitgKkW7nOiw8aQKPY,1845
|
|
14
|
+
pdd/conflicts_in_prompts.py,sha256=PyasqXGA92JkroXv8b4-B_fYYC4cDYTsGEl9fj01rlc,4654
|
|
15
|
+
pdd/conflicts_main.py,sha256=O87s9baSa9DJMndxPIdsnYO_spoajcv9jii3XYt_-fM,3473
|
|
16
|
+
pdd/construct_paths.py,sha256=8hxkTI_AF5XNpGR4JqCsF4olDBtL8NslXdOZGQt78WM,10039
|
|
17
|
+
pdd/context_generator.py,sha256=WF3HDoYALAZ86rIfJPxHlf34IWANUd6IoYL1XqI-CpM,5515
|
|
18
|
+
pdd/context_generator_main.py,sha256=TtsY3jHictdEjmB4cHyNwXmZW_LfHJp3KW3UXyzR2cU,2735
|
|
19
|
+
pdd/continue_generation.py,sha256=hAVySc6oEsM_Zpj5AWBKEZqMWgoLlQBHcFtkAZ9sZ0E,5192
|
|
20
|
+
pdd/crash_main.py,sha256=QpJj4WJhLl2DJsvPao6GjC93_nKkdbk6EPvEsSWovo8,5012
|
|
21
|
+
pdd/detect_change.py,sha256=8AcFkT_CvaNDX7jL6FRrlD89TFXV62_8n2GO4fWIC2c,5261
|
|
22
|
+
pdd/detect_change_main.py,sha256=1Z4ymhjJaVr2aliGyqkqeqSmQ7QMgcl23p0wdsmBas0,3653
|
|
23
|
+
pdd/find_section.py,sha256=lz_FPY4KDCRAGlL1pWVZiutUNv7E4KsDFK-ymDWA_Ec,962
|
|
24
|
+
pdd/fix_code_loop.py,sha256=L0yxq2yAziPIyFGb8lIP2mvufu8a_gtc5nnN2LuMuKs,8596
|
|
25
|
+
pdd/fix_code_module_errors.py,sha256=BAQ8UtJ61wCEaIwK3MvBVJsaOTDgCCQlFES1u47CVao,4625
|
|
26
|
+
pdd/fix_error_loop.py,sha256=6Vy8e9IfM4cnOaL0bUqT-KnaOMQlDggy9v2Vf_8sSqE,8958
|
|
27
|
+
pdd/fix_errors_from_unit_tests.py,sha256=vul8X9S2U_dr9dbfjwy0x4K8jIX2B810KLOOhboyySQ,8935
|
|
28
|
+
pdd/fix_main.py,sha256=02OIViH12BcsykpDp4Osxw2ndEeThnNakMFkzdpYr48,5333
|
|
29
|
+
pdd/generate_output_paths.py,sha256=zz42GTx9eGyWIYSl3jcWvtJRGnieC3eoPM6DIVcWz2k,7219
|
|
30
|
+
pdd/generate_test.py,sha256=1vTMhZTpdGCkIAYy-BWhu_OmNggRx5UddT7OVGhPIiA,4794
|
|
31
|
+
pdd/get_comment.py,sha256=yuRtk68-SDkMaGzOSyIFdldRoymJBRSKjOYkr0narVc,2627
|
|
32
|
+
pdd/get_extension.py,sha256=ZSsbi7n-tFw-7RQX7c3pV1qWsRt72qS_3AlAYjV53jA,2393
|
|
33
|
+
pdd/get_language.py,sha256=yxyQqVEb5H3ep3Hc6XgAl3vMLTHD5OIs8ZSekB493GA,1438
|
|
34
|
+
pdd/git_update.py,sha256=Ya7eI7YFtGIpT7FdziFJfnFkiZlj8I9Lh98lqtXfClc,2855
|
|
35
|
+
pdd/increase_tests.py,sha256=sqlfkx4v84Zx22wW6_qwIsupbpLgy6IyPwp-11B22bs,3243
|
|
36
|
+
pdd/insert_includes.py,sha256=bocHBAzs4MAudtIw-JjyHO0kYajwlOLS9jBzV33_LRU,5224
|
|
37
|
+
pdd/llm_invoke.py,sha256=4pqOnYksDnrvRT2yBlPXBrGrPPjE5u6QEmg15HB6zys,12346
|
|
38
|
+
pdd/load_prompt_template.py,sha256=4NH8_t5eon_vcyTznqtemJ_yAPkTJm_hSdTRgzj3qEQ,1907
|
|
39
|
+
pdd/pdd_completion.fish,sha256=rs-43fa3kcDBN1uy4oxiofLAWmaqW0U2j5Mu4wCHh5M,6121
|
|
40
|
+
pdd/pdd_completion.sh,sha256=TfinvSlK3AVxjOFZv-l6LYrs2H652Oi5P43l8F30ctE,4535
|
|
41
|
+
pdd/pdd_completion.zsh,sha256=gav5kYLizpMLe9H_MK34sisgFx6LFDgfBW49nsg-5P0,12304
|
|
42
|
+
pdd/postprocess.py,sha256=7Dt4C7hZZbqCpYK0LG2Ui_vIUYw9UTN3w5Wgd_JZYBs,4021
|
|
43
|
+
pdd/postprocess_0.py,sha256=OW17GyCFLYErCyWh2tL4syuho3q2yFf2wyekQ4BLdPM,2168
|
|
44
|
+
pdd/preprocess.py,sha256=7_mkREBFlWjIUIyZsYBlnCvIGtpVgPeToHUpaq_ZHC0,8177
|
|
45
|
+
pdd/preprocess_main.py,sha256=dAgFGmjuJB1taZl31c1sY2jMGtQgjnWLbpeB7EFtojY,2977
|
|
46
|
+
pdd/process_csv_change.py,sha256=10XTzVFQ0rE4lPSF93yhIW7VJmxmfe-hk1B7ui_qxJI,8415
|
|
47
|
+
pdd/split.py,sha256=a1xy6PcuIkhQQEZ_X_1wyngDftlhpH4kCLMTb2u5MrY,4271
|
|
48
|
+
pdd/split_main.py,sha256=6wPPGEOK8GQBWt93Weem3yKqzZeVGHKyosNruQx432g,3934
|
|
49
|
+
pdd/summarize_directory.py,sha256=3KUOP30RgkBXpz0_btmpubnO1vWAQ3tKyVI84Zp-E9Q,9041
|
|
50
|
+
pdd/trace.py,sha256=DMgL8cEk8gwdpyOumEi3am8wTq68e4OJzoc61H0vLAA,5011
|
|
51
|
+
pdd/trace_main.py,sha256=3gpd8DsdPfRpq4tjZ2rwC-7Juz90DTVubwsW3LXl8CE,4429
|
|
52
|
+
pdd/track_cost.py,sha256=VIrHYh4i2G5T5Dq1plxwuzsG4OrHQgO0GPgFckgsQ_4,3266
|
|
53
|
+
pdd/unfinished_prompt.py,sha256=Oql2c4EgdOe7BVofM0gVs8aN5EQnLuoO-FLibjamE3A,4076
|
|
54
|
+
pdd/update_main.py,sha256=5a4nsOOaAXULdk0BS9pj4blZ_QHBFeET37uaAqoJI2g,3912
|
|
55
|
+
pdd/update_prompt.py,sha256=OdPRIAMu7OBx7E4SOU95hWgdtBY4oO8XOe1dvPChMlU,4351
|
|
56
|
+
pdd/xml_tagger.py,sha256=LADAXgw15O0Jh6IxdKrbKIpL76QbEZB1mdq5BvuMmsY,4241
|
|
57
|
+
pdd/data/language_format.csv,sha256=xUTmFHXSBVBRfPV-NKG3oWo5_ped5ukP-ekFcIlVzJk,877
|
|
58
|
+
pdd/data/llm_model.csv,sha256=-m1DoDr_PJ5OUyB155oP3RFzPAh3G_xph1BeaymoKUs,1268
|
|
59
|
+
pdd/prompts/auto_include_LLM.prompt,sha256=0t-Jmm5o6vVTmqsISTUiewqPT8bB389UZnJoHZvgtu4,13967
|
|
60
|
+
pdd/prompts/bug_to_unit_test_LLM.prompt,sha256=--ysObDv9WzOEyJMuaKEdDHkRrR_1j0dmOtlAFr4YRg,1205
|
|
61
|
+
pdd/prompts/change_LLM.prompt,sha256=W3sE6XZ2fb35XdqOykK1hDPtqkHSv9MZGD3sT8B8WjY,2083
|
|
62
|
+
pdd/prompts/conflict_LLM.prompt,sha256=46DB_qOCtsfVsj6y8E8grI0izxAk_-ixoENUUHQAkHc,1593
|
|
63
|
+
pdd/prompts/continue_generation_LLM.prompt,sha256=Jsd3eeu23heqw2frfOLzZ5c9dn0QZrfWGratfyWV-ac,111
|
|
64
|
+
pdd/prompts/detect_change_LLM.prompt,sha256=-q8VqXAv6ufEE193DNbTcgpbxiKISR5-5j3M0TTqa8s,4522
|
|
65
|
+
pdd/prompts/example_generator_LLM.prompt,sha256=48mUvjEYxQYf_HhDLP6RGOz6_d_go6JNExZ9g8aicCg,610
|
|
66
|
+
pdd/prompts/extract_auto_include_LLM.prompt,sha256=BamIIt8qrML2ZtNe3D4K30iMobJ4URtkyomHCDaf0iw,313
|
|
67
|
+
pdd/prompts/extract_code_LLM.prompt,sha256=aq3a9WTcGvlBQLHgLQhQpCA-V0KPvX9h2htZ--UmjPI,2450
|
|
68
|
+
pdd/prompts/extract_conflict_LLM.prompt,sha256=V_xXdU7V4IZK9SVFxJtXKRn_wFkP3zp4FJrxeNM9XYc,1023
|
|
69
|
+
pdd/prompts/extract_detect_change_LLM.prompt,sha256=2HXSb9bGjHZsKrUGvfBdBAAcGBCrQ2AxC8vUJRAfB1U,1003
|
|
70
|
+
pdd/prompts/extract_program_code_fix_LLM.prompt,sha256=ra_aDz2x8MfOa5dh7JCtxjoUFa4dWeKPJOpLohMnrig,1137
|
|
71
|
+
pdd/prompts/extract_prompt_change_LLM.prompt,sha256=1e3AxcVpZ85t7pVvXqCpBUJzGI995MIimXicClagSvw,366
|
|
72
|
+
pdd/prompts/extract_prompt_split_LLM.prompt,sha256=CZU4KhMUgkSxhFs0dIqbsNMrybzrNQMTZva9V-IM-1A,970
|
|
73
|
+
pdd/prompts/extract_prompt_update_LLM.prompt,sha256=U9QsacZ9OcT-CVPYkWN5eXZMDGIOy2r2C3OFtZ61tew,365
|
|
74
|
+
pdd/prompts/extract_promptline_LLM.prompt,sha256=owIBRaF2bWwg3S64uyMKzOFMdvvmI_EEGoF97Pa9118,813
|
|
75
|
+
pdd/prompts/extract_unit_code_fix_LLM.prompt,sha256=1gWS0-Qs6vMynNNqp1Xc-2hcsyH_NTLZPB1-lvyprm8,14143
|
|
76
|
+
pdd/prompts/extract_xml_LLM.prompt,sha256=eRcHaL-khShpb7C1_b7wmBJHfo2Kh1Wvjo_aOcWZovU,561
|
|
77
|
+
pdd/prompts/fix_code_module_errors_LLM.prompt,sha256=m-oqZ3cOkWbqke_l9z0Nmunf7NsnR9JWTNVVlfcteAY,1405
|
|
78
|
+
pdd/prompts/fix_errors_from_unit_tests_LLM.prompt,sha256=TedT4AhgFXkuAmXt07Q2sTij90n8El3nfOzPPXr8_Ws,4679
|
|
79
|
+
pdd/prompts/generate_test_LLM.prompt,sha256=sp1favU-GJenqKlqDU4t9qZ0blQ5HagwfRGW90J4V_Y,764
|
|
80
|
+
pdd/prompts/increase_tests_LLM.prompt,sha256=rekFzLRuZy99KifEKNlmPYoQdl8wa04112mtCdIY6S8,955
|
|
81
|
+
pdd/prompts/insert_includes_LLM.prompt,sha256=g-p2gXKENsqvfK5Q9FYbqFsIJ5CP7rbxmd4rROA-W80,1453
|
|
82
|
+
pdd/prompts/split_LLM.prompt,sha256=vhDLSqrfftvbDRagb0IfQpotnC-2z-xwKxGRsppkpDM,6135
|
|
83
|
+
pdd/prompts/summarize_file_LLM.prompt,sha256=qb9K61XMVFy7hgGITglI37Xg7yLPAGQBm0rUBEqRnEc,387
|
|
84
|
+
pdd/prompts/trace_LLM.prompt,sha256=XTPoQQpKrF7BtWkCJPIrinn448VyBGXJieibMsMP-y0,1231
|
|
85
|
+
pdd/prompts/trim_results_LLM.prompt,sha256=w4aL0S7v7fPSi3L9XeQR3mUOgNv3hpTDqi4rOtu7L7I,4033
|
|
86
|
+
pdd/prompts/trim_results_start_LLM.prompt,sha256=WwFlOHha4wzMLtRHDMI6GtcNdl2toE8gbixQeUwkS4g,2165
|
|
87
|
+
pdd/prompts/unfinished_prompt_LLM.prompt,sha256=-JgBpiPTQZdWOAwOG1XpfpD9waynFTAT3Jo84eQ4bTw,1543
|
|
88
|
+
pdd/prompts/update_prompt_LLM.prompt,sha256=_lGaxeVP4oF8yGqiN6yj6UE0j79lxfGdjsYr5w5KSYk,1261
|
|
89
|
+
pdd/prompts/xml_convertor_LLM.prompt,sha256=YGRGXJeg6EhM9690f-SKqQrKqSJjLFD51UrPOlO0Frg,2786
|
|
90
|
+
pdd_cli-0.0.2.dist-info/LICENSE,sha256=-1bjYH-CEjGEQ8VixtnRYuu37kN6F9NxmZSDkBuUQ9o,1062
|
|
91
|
+
pdd_cli-0.0.2.dist-info/METADATA,sha256=C36wSqDuWiiUFVujNDNe-Vfyr1hzJUfejyv2BiEp9q8,9357
|
|
92
|
+
pdd_cli-0.0.2.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
|
93
|
+
pdd_cli-0.0.2.dist-info/entry_points.txt,sha256=Kr8HtNVb8uHZtQJNH4DnF8j7WNgWQbb7_Pw5hECSR-I,36
|
|
94
|
+
pdd_cli-0.0.2.dist-info/top_level.txt,sha256=xjnhIACeMcMeDfVNREgQZl4EbTni2T11QkL5r7E-sbE,4
|
|
95
|
+
pdd_cli-0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pdd
|