pdd-cli 0.0.4__py3-none-any.whl → 0.0.6__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/cli.py +9 -124
- pdd/code_generator.py +10 -5
- pdd/code_generator_main.py +65 -7
- pdd/context_generator.py +1 -1
- pdd/crash_main.py +10 -6
- pdd/data/llm_model.csv +16 -14
- pdd/generate_test.py +2 -2
- pdd/get_jwt_token.py +290 -0
- pdd/install_completion.py +136 -0
- pdd/llm_invoke.py +237 -184
- pdd/pdd_completion.sh +1 -1
- pdd/prompts/extract_code_LLM.prompt +1 -1
- pdd/prompts/generate_test_LLM.prompt +1 -0
- pdd/split.py +16 -13
- pdd/split_main.py +6 -4
- pdd_cli-0.0.6.dist-info/METADATA +231 -0
- {pdd_cli-0.0.4.dist-info → pdd_cli-0.0.6.dist-info}/RECORD +21 -19
- {pdd_cli-0.0.4.dist-info → pdd_cli-0.0.6.dist-info}/WHEEL +1 -1
- pdd_cli-0.0.4.dist-info/METADATA +0 -225
- {pdd_cli-0.0.4.dist-info → pdd_cli-0.0.6.dist-info}/LICENSE +0 -0
- {pdd_cli-0.0.4.dist-info → pdd_cli-0.0.6.dist-info}/entry_points.txt +0 -0
- {pdd_cli-0.0.4.dist-info → pdd_cli-0.0.6.dist-info}/top_level.txt +0 -0
pdd/split_main.py
CHANGED
|
@@ -13,7 +13,7 @@ def split_main(
|
|
|
13
13
|
example_code_file: str,
|
|
14
14
|
output_sub: Optional[str],
|
|
15
15
|
output_modified: Optional[str]
|
|
16
|
-
) -> Tuple[str, str, float]:
|
|
16
|
+
) -> Tuple[str, str, str, float]:
|
|
17
17
|
"""
|
|
18
18
|
CLI wrapper for splitting a prompt into a sub_prompt and modified_prompt.
|
|
19
19
|
|
|
@@ -30,6 +30,7 @@ def split_main(
|
|
|
30
30
|
- str: The sub-prompt content
|
|
31
31
|
- str: The modified prompt content
|
|
32
32
|
- float: The total cost of the operation
|
|
33
|
+
- str: The model name used (second to last element)
|
|
33
34
|
|
|
34
35
|
Raises:
|
|
35
36
|
SystemExit: If any error occurs during execution.
|
|
@@ -59,8 +60,8 @@ def split_main(
|
|
|
59
60
|
strength = ctx.obj.get('strength', 0.5)
|
|
60
61
|
temperature = ctx.obj.get('temperature', 0)
|
|
61
62
|
|
|
62
|
-
# Call the split function
|
|
63
|
-
sub_prompt, modified_prompt, total_cost = split(
|
|
63
|
+
# Call the split function and unpack the new tuple signature
|
|
64
|
+
sub_prompt, modified_prompt, model_name, total_cost = split(
|
|
64
65
|
input_prompt=input_strings["input_prompt"],
|
|
65
66
|
input_code=input_strings["input_code"],
|
|
66
67
|
example_code=input_strings["example_code"],
|
|
@@ -83,9 +84,10 @@ def split_main(
|
|
|
83
84
|
rprint("[bold green]Successfully split the prompt![/bold green]")
|
|
84
85
|
rprint(f"[bold]Sub-prompt saved to:[/bold] {output_file_paths['output_sub']}")
|
|
85
86
|
rprint(f"[bold]Modified prompt saved to:[/bold] {output_file_paths['output_modified']}")
|
|
87
|
+
rprint(f"[bold]Model used:[/bold] {model_name}")
|
|
86
88
|
rprint(f"[bold]Total cost:[/bold] ${total_cost:.6f}")
|
|
87
89
|
|
|
88
|
-
return sub_prompt, modified_prompt, total_cost
|
|
90
|
+
return sub_prompt, modified_prompt, total_cost, model_name
|
|
89
91
|
|
|
90
92
|
except Exception as e:
|
|
91
93
|
# Handle errors and provide appropriate feedback
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pdd-cli
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: PDD (Prompt-Driven Development) Command Line Interface
|
|
5
|
+
Author: Greg Tanaka
|
|
6
|
+
Author-email: glt@alumni.caltech.edu
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/gltanaka/pdd
|
|
9
|
+
Project-URL: Repository, https://github.com/gltanaka/pdd.git
|
|
10
|
+
Project-URL: Issue-Tracker, https://github.com/gltanaka/pdd/issues
|
|
11
|
+
Keywords: prompt-driven development,code generation,AI,LLM,unit testing,software development
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Description-Content-Type: text/x-rst
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: GitPython==3.1.44
|
|
22
|
+
Requires-Dist: Requests==2.32.3
|
|
23
|
+
Requires-Dist: click==8.1.7
|
|
24
|
+
Requires-Dist: keyring==24.3.1
|
|
25
|
+
Requires-Dist: langchain==0.3.18
|
|
26
|
+
Requires-Dist: langchain_anthropic==0.3.7
|
|
27
|
+
Requires-Dist: langchain_community==0.3.17
|
|
28
|
+
Requires-Dist: langchain_core==0.3.34
|
|
29
|
+
Requires-Dist: langchain_fireworks==0.2.7
|
|
30
|
+
Requires-Dist: langchain_google_genai==2.0.9
|
|
31
|
+
Requires-Dist: langchain_google_vertexai==2.0.13
|
|
32
|
+
Requires-Dist: langchain_groq==0.2.4
|
|
33
|
+
Requires-Dist: langchain_ollama==0.2.3
|
|
34
|
+
Requires-Dist: langchain_openai==0.3.4
|
|
35
|
+
Requires-Dist: langchain_together==0.3.0
|
|
36
|
+
Requires-Dist: pandas==2.2.3
|
|
37
|
+
Requires-Dist: pydantic==2.10.6
|
|
38
|
+
Requires-Dist: rich==13.9.4
|
|
39
|
+
Requires-Dist: semver==3.0.2
|
|
40
|
+
Requires-Dist: setuptools==75.1.0
|
|
41
|
+
Requires-Dist: python-Levenshtein
|
|
42
|
+
|
|
43
|
+
PDD (Prompt-Driven Development) Command Line Interface
|
|
44
|
+
======================================================
|
|
45
|
+
|
|
46
|
+
PDD (Prompt-Driven Development) is a command-line interface that harnesses AI models to generate and maintain code from prompt files. Whether you want to create new features, fix bugs, enhance unit tests, or manage complex prompt structures, pdd-cli streamlines your workflow through an intuitive interface and powerful automation.
|
|
47
|
+
.. image:: https://img.shields.io/badge/pdd--cli-v0.0.6-blue
|
|
48
|
+
:alt: PDD-CLI Version
|
|
49
|
+
|
|
50
|
+
Key Features
|
|
51
|
+
------------
|
|
52
|
+
|
|
53
|
+
- Cloud or Local Execution
|
|
54
|
+
• Run in the cloud (default) with no need to manage API keys.
|
|
55
|
+
• Switch to local mode with the ``--local`` flag for full control using your own API keys.
|
|
56
|
+
|
|
57
|
+
- GitHub Single Sign-On
|
|
58
|
+
• Secure authentication with GitHub SSO in cloud mode.
|
|
59
|
+
• Automatic token handling so you can focus on coding.
|
|
60
|
+
|
|
61
|
+
- Comprehensive Command Suite
|
|
62
|
+
• Generate: Create runnable code from prompt files.
|
|
63
|
+
• Example: Build examples that showcase generated code usage.
|
|
64
|
+
• Test: Produce or improve unit tests based on coverage goals.
|
|
65
|
+
• Fix & Crash: Automatically identify and correct errors, iterating if necessary.
|
|
66
|
+
• Update & Change: Keep your prompt files in sync with evolving codebases.
|
|
67
|
+
• Split & Detect: Manage and analyze complex prompts at scale.
|
|
68
|
+
• …and more!
|
|
69
|
+
|
|
70
|
+
- Automated Testing & Cost Tracking
|
|
71
|
+
• Generate coverage reports and additional test cases on the fly.
|
|
72
|
+
• Optional cost-tracking (CSV) for AI usage.
|
|
73
|
+
|
|
74
|
+
- Rich Configuration & Customization
|
|
75
|
+
• Environment variables to define default output paths and settings.
|
|
76
|
+
• Fine-tune AI model behavior with ``--strength`` and ``--temperature``.
|
|
77
|
+
• Built-in auto-update (configurable via env var).
|
|
78
|
+
|
|
79
|
+
- Cross-Language Support
|
|
80
|
+
• Python, Java, JavaScript, Ruby, Go, C++, and beyond.
|
|
81
|
+
• Prompt naming conventions let PDD infer language automatically.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
Quick Installation
|
|
85
|
+
------------------
|
|
86
|
+
|
|
87
|
+
.. code-block:: console
|
|
88
|
+
|
|
89
|
+
pip install pdd-cli
|
|
90
|
+
|
|
91
|
+
After installation, verify:
|
|
92
|
+
|
|
93
|
+
.. code-block:: console
|
|
94
|
+
|
|
95
|
+
pdd --version
|
|
96
|
+
|
|
97
|
+
You’ll see the current PDD version (e.g., 0.0.6).
|
|
98
|
+
|
|
99
|
+
Advanced Installation Tips
|
|
100
|
+
--------------------------
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
**Virtual Environment**
|
|
104
|
+
|
|
105
|
+
Create and activate a virtual environment, then install pdd-cli:
|
|
106
|
+
|
|
107
|
+
.. code-block:: console
|
|
108
|
+
|
|
109
|
+
python -m venv pdd-env
|
|
110
|
+
|
|
111
|
+
# Activate environment
|
|
112
|
+
# On Windows:
|
|
113
|
+
pdd-env\Scripts\activate
|
|
114
|
+
# On Unix/MacOS:
|
|
115
|
+
source pdd-env/bin/activate
|
|
116
|
+
|
|
117
|
+
# Install PDD
|
|
118
|
+
pip install pdd-cli
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
**Environment Variables**
|
|
122
|
+
|
|
123
|
+
Optionally, add environment variables to your shell startup (e.g., ``.bashrc``, ``.zshrc``):
|
|
124
|
+
|
|
125
|
+
.. code-block:: console
|
|
126
|
+
|
|
127
|
+
export PDD_AUTO_UPDATE=true
|
|
128
|
+
export PDD_GENERATE_OUTPUT_PATH=/path/to/generated/code/
|
|
129
|
+
export PDD_TEST_OUTPUT_PATH=/path/to/tests/
|
|
130
|
+
|
|
131
|
+
Tab Completion
|
|
132
|
+
~~~~~~~~~~~~~~
|
|
133
|
+
Enable shell completion:
|
|
134
|
+
|
|
135
|
+
.. code-block:: console
|
|
136
|
+
|
|
137
|
+
pdd install_completion
|
|
138
|
+
|
|
139
|
+
Cloud vs Local
|
|
140
|
+
--------------
|
|
141
|
+
|
|
142
|
+
By default, PDD runs in cloud mode, using GitHub SSO for secure access to AI models—no local API keys needed. If you want or need to run locally:
|
|
143
|
+
|
|
144
|
+
.. code-block:: console
|
|
145
|
+
|
|
146
|
+
pdd --local generate my_prompt_python.prompt
|
|
147
|
+
|
|
148
|
+
Be sure to configure API keys in your environment ahead of time:
|
|
149
|
+
|
|
150
|
+
.. code-block:: console
|
|
151
|
+
|
|
152
|
+
export OPENAI_API_KEY=your_api_key_here
|
|
153
|
+
export ANTHROPIC_API_KEY=your_api_key_here
|
|
154
|
+
# etc.
|
|
155
|
+
|
|
156
|
+
Basic Usage
|
|
157
|
+
-----------
|
|
158
|
+
|
|
159
|
+
All commands follow a standard pattern:
|
|
160
|
+
|
|
161
|
+
.. code-block:: console
|
|
162
|
+
|
|
163
|
+
pdd [GLOBAL OPTIONS] COMMAND [COMMAND OPTIONS] [ARGS]...
|
|
164
|
+
|
|
165
|
+
**Example – Generate Code**
|
|
166
|
+
|
|
167
|
+
Generate Python code from a prompt:
|
|
168
|
+
|
|
169
|
+
.. code-block:: console
|
|
170
|
+
|
|
171
|
+
pdd generate factorial_calculator_python.prompt
|
|
172
|
+
|
|
173
|
+
In cloud mode (no local keys required). Or locally if you prefer:
|
|
174
|
+
|
|
175
|
+
.. code-block:: console
|
|
176
|
+
|
|
177
|
+
pdd --local generate factorial_calculator_python.prompt
|
|
178
|
+
|
|
179
|
+
**Example – Test**
|
|
180
|
+
|
|
181
|
+
Automatically create or enhance tests:
|
|
182
|
+
|
|
183
|
+
.. code-block:: console
|
|
184
|
+
|
|
185
|
+
pdd test factorial_calculator_python.prompt src/factorial_calculator.py
|
|
186
|
+
|
|
187
|
+
Use coverage analysis:
|
|
188
|
+
|
|
189
|
+
.. code-block:: console
|
|
190
|
+
|
|
191
|
+
pdd test --coverage-report coverage.xml --existing-tests tests/test_factorial.py \
|
|
192
|
+
factorial_prompt.prompt src/factorial.py
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
**Example – Fix Iteratively**
|
|
196
|
+
|
|
197
|
+
Attempt to fix failing code or tests in multiple loops:
|
|
198
|
+
|
|
199
|
+
.. code-block:: console
|
|
200
|
+
|
|
201
|
+
pdd fix --loop \
|
|
202
|
+
factorial_calculator_python.prompt src/factorial_calculator.py tests/test_factorial.py errors.log
|
|
203
|
+
|
|
204
|
+
PDD will keep trying (with a budget limit configurable by ``--budget``) until tests pass or attempts are exhausted.
|
|
205
|
+
|
|
206
|
+
Why Prompt-Driven Development?
|
|
207
|
+
------------------------------
|
|
208
|
+
|
|
209
|
+
* **Increased Productivity:** Automate tedious tasks and focus on higher-level design.
|
|
210
|
+
* **Improved Code Quality:** Leverage AI to generate well-structured and tested code.
|
|
211
|
+
* **Faster Development Cycles:** Rapidly prototype and iterate on your ideas.
|
|
212
|
+
* **Reduced Errors:** Automatically identify and fix errors in your code.
|
|
213
|
+
* **Enhanced Collaboration:** Work seamlessly with prompt files as a shared source of truth.
|
|
214
|
+
|
|
215
|
+
Getting Help
|
|
216
|
+
------------
|
|
217
|
+
|
|
218
|
+
Use inline help to discover commands and options:
|
|
219
|
+
|
|
220
|
+
.. code-block:: console
|
|
221
|
+
|
|
222
|
+
pdd --help
|
|
223
|
+
pdd generate --help
|
|
224
|
+
pdd fix --help
|
|
225
|
+
...
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
Report issues or contribute at https://github.com/promptdriven/pdd-cli.
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
Happy Prompt-Driven Coding!
|
|
@@ -6,18 +6,18 @@ pdd/bug_main.py,sha256=myKU9--QWdkV4Wf3mD2PoLPJFNgRjwf4z8s7TC28G_s,3720
|
|
|
6
6
|
pdd/bug_to_unit_test.py,sha256=o9bW065UxjvGAn9u8UIwYbIM6R-WcGB2YWuOSXAD484,5569
|
|
7
7
|
pdd/change.py,sha256=JvHPxK9FfnuGJsEkzTpzWI4tg24OJahK0qTLDZSyNPg,4985
|
|
8
8
|
pdd/change_main.py,sha256=yL_i1Ws5vt4vAkWiC826csNi2cHP6wKbwe_PfMqbbPY,11407
|
|
9
|
-
pdd/cli.py,sha256=
|
|
9
|
+
pdd/cli.py,sha256=NoWJoQvklsjJP2RJBmwcA6JJPsi36xTsxDT-1S2Boq4,16592
|
|
10
10
|
pdd/cmd_test_main.py,sha256=aSCxRnSurg15AvPcJDAPp9xy8p_qqnjU1oV14Hi2R54,5301
|
|
11
|
-
pdd/code_generator.py,sha256=
|
|
12
|
-
pdd/code_generator_main.py,sha256=
|
|
11
|
+
pdd/code_generator.py,sha256=_b5t9cZ6pExHKKAE2ulfdvfLfbsQj-uwrbk520n-R-Q,4375
|
|
12
|
+
pdd/code_generator_main.py,sha256=G2eRBPXc1cGszkk0PbIPmJZHPaf_dw5d2yZbsvQZA3c,4793
|
|
13
13
|
pdd/comment_line.py,sha256=sX2hf4bG1fILi_rvI9MkkwCZ2IitgKkW7nOiw8aQKPY,1845
|
|
14
14
|
pdd/conflicts_in_prompts.py,sha256=PyasqXGA92JkroXv8b4-B_fYYC4cDYTsGEl9fj01rlc,4654
|
|
15
15
|
pdd/conflicts_main.py,sha256=O87s9baSa9DJMndxPIdsnYO_spoajcv9jii3XYt_-fM,3473
|
|
16
16
|
pdd/construct_paths.py,sha256=8hxkTI_AF5XNpGR4JqCsF4olDBtL8NslXdOZGQt78WM,10039
|
|
17
|
-
pdd/context_generator.py,sha256=
|
|
17
|
+
pdd/context_generator.py,sha256=KEMitvUSMfmSYyyfvIkDpi6dTXED04Zi2-Qm2SVME10,5516
|
|
18
18
|
pdd/context_generator_main.py,sha256=TtsY3jHictdEjmB4cHyNwXmZW_LfHJp3KW3UXyzR2cU,2735
|
|
19
19
|
pdd/continue_generation.py,sha256=hAVySc6oEsM_Zpj5AWBKEZqMWgoLlQBHcFtkAZ9sZ0E,5192
|
|
20
|
-
pdd/crash_main.py,sha256=
|
|
20
|
+
pdd/crash_main.py,sha256=YngROG62ORLGm-IORLq1vlVVidBGc9g2k0GAmq1jFNM,5287
|
|
21
21
|
pdd/detect_change.py,sha256=8AcFkT_CvaNDX7jL6FRrlD89TFXV62_8n2GO4fWIC2c,5261
|
|
22
22
|
pdd/detect_change_main.py,sha256=1Z4ymhjJaVr2aliGyqkqeqSmQ7QMgcl23p0wdsmBas0,3653
|
|
23
23
|
pdd/find_section.py,sha256=lz_FPY4KDCRAGlL1pWVZiutUNv7E4KsDFK-ymDWA_Ec,962
|
|
@@ -27,25 +27,27 @@ pdd/fix_error_loop.py,sha256=6Vy8e9IfM4cnOaL0bUqT-KnaOMQlDggy9v2Vf_8sSqE,8958
|
|
|
27
27
|
pdd/fix_errors_from_unit_tests.py,sha256=vul8X9S2U_dr9dbfjwy0x4K8jIX2B810KLOOhboyySQ,8935
|
|
28
28
|
pdd/fix_main.py,sha256=02OIViH12BcsykpDp4Osxw2ndEeThnNakMFkzdpYr48,5333
|
|
29
29
|
pdd/generate_output_paths.py,sha256=zz42GTx9eGyWIYSl3jcWvtJRGnieC3eoPM6DIVcWz2k,7219
|
|
30
|
-
pdd/generate_test.py,sha256=
|
|
30
|
+
pdd/generate_test.py,sha256=wvriQR2dLib-cwVg_BkUpUKGsQTmnSDmyC2Ok8NLdJw,4792
|
|
31
31
|
pdd/get_comment.py,sha256=yuRtk68-SDkMaGzOSyIFdldRoymJBRSKjOYkr0narVc,2627
|
|
32
32
|
pdd/get_extension.py,sha256=ZSsbi7n-tFw-7RQX7c3pV1qWsRt72qS_3AlAYjV53jA,2393
|
|
33
|
+
pdd/get_jwt_token.py,sha256=BGxqMh7qf2mG-TFw7JlV941O9XtrW22L_dRoS_UZNjM,11560
|
|
33
34
|
pdd/get_language.py,sha256=yxyQqVEb5H3ep3Hc6XgAl3vMLTHD5OIs8ZSekB493GA,1438
|
|
34
35
|
pdd/git_update.py,sha256=Ya7eI7YFtGIpT7FdziFJfnFkiZlj8I9Lh98lqtXfClc,2855
|
|
35
36
|
pdd/increase_tests.py,sha256=sqlfkx4v84Zx22wW6_qwIsupbpLgy6IyPwp-11B22bs,3243
|
|
36
37
|
pdd/insert_includes.py,sha256=bocHBAzs4MAudtIw-JjyHO0kYajwlOLS9jBzV33_LRU,5224
|
|
37
|
-
pdd/
|
|
38
|
+
pdd/install_completion.py,sha256=joTIKRkx0e6kRrXj9NXtMODnIG-G0Twt7wBmj8TirmE,5102
|
|
39
|
+
pdd/llm_invoke.py,sha256=iYdBPVg1duhmG4d6a1Mbp4sLag-nI5Q3uWQPkmDVUW0,16300
|
|
38
40
|
pdd/load_prompt_template.py,sha256=4NH8_t5eon_vcyTznqtemJ_yAPkTJm_hSdTRgzj3qEQ,1907
|
|
39
41
|
pdd/pdd_completion.fish,sha256=rs-43fa3kcDBN1uy4oxiofLAWmaqW0U2j5Mu4wCHh5M,6121
|
|
40
|
-
pdd/pdd_completion.sh,sha256=
|
|
42
|
+
pdd/pdd_completion.sh,sha256=qurWrEksqptjryBZszxHv6i0MqgnIqJenMBDrzMgI98,4535
|
|
41
43
|
pdd/pdd_completion.zsh,sha256=gav5kYLizpMLe9H_MK34sisgFx6LFDgfBW49nsg-5P0,12304
|
|
42
44
|
pdd/postprocess.py,sha256=7Dt4C7hZZbqCpYK0LG2Ui_vIUYw9UTN3w5Wgd_JZYBs,4021
|
|
43
45
|
pdd/postprocess_0.py,sha256=OW17GyCFLYErCyWh2tL4syuho3q2yFf2wyekQ4BLdPM,2168
|
|
44
46
|
pdd/preprocess.py,sha256=7_mkREBFlWjIUIyZsYBlnCvIGtpVgPeToHUpaq_ZHC0,8177
|
|
45
47
|
pdd/preprocess_main.py,sha256=dAgFGmjuJB1taZl31c1sY2jMGtQgjnWLbpeB7EFtojY,2977
|
|
46
48
|
pdd/process_csv_change.py,sha256=10XTzVFQ0rE4lPSF93yhIW7VJmxmfe-hk1B7ui_qxJI,8415
|
|
47
|
-
pdd/split.py,sha256=
|
|
48
|
-
pdd/split_main.py,sha256=
|
|
49
|
+
pdd/split.py,sha256=M4OGBgC9D0bfY1RhArfGphbmbEGX_U8f2LksGaL_Hnw,4692
|
|
50
|
+
pdd/split_main.py,sha256=dV9G2YJDp12ik6x1a_dgBtyu27BSt4Fyd2trgxL7qFI,4123
|
|
49
51
|
pdd/summarize_directory.py,sha256=3KUOP30RgkBXpz0_btmpubnO1vWAQ3tKyVI84Zp-E9Q,9041
|
|
50
52
|
pdd/trace.py,sha256=DMgL8cEk8gwdpyOumEi3am8wTq68e4OJzoc61H0vLAA,5011
|
|
51
53
|
pdd/trace_main.py,sha256=3gpd8DsdPfRpq4tjZ2rwC-7Juz90DTVubwsW3LXl8CE,4429
|
|
@@ -55,7 +57,7 @@ pdd/update_main.py,sha256=5a4nsOOaAXULdk0BS9pj4blZ_QHBFeET37uaAqoJI2g,3912
|
|
|
55
57
|
pdd/update_prompt.py,sha256=OdPRIAMu7OBx7E4SOU95hWgdtBY4oO8XOe1dvPChMlU,4351
|
|
56
58
|
pdd/xml_tagger.py,sha256=LADAXgw15O0Jh6IxdKrbKIpL76QbEZB1mdq5BvuMmsY,4241
|
|
57
59
|
pdd/data/language_format.csv,sha256=xUTmFHXSBVBRfPV-NKG3oWo5_ped5ukP-ekFcIlVzJk,877
|
|
58
|
-
pdd/data/llm_model.csv,sha256
|
|
60
|
+
pdd/data/llm_model.csv,sha256=t5ASN-7kTKizb2ocmKnv8gsyPqDCB2yz4KtYr98vKWI,1647
|
|
59
61
|
pdd/prompts/auto_include_LLM.prompt,sha256=0t-Jmm5o6vVTmqsISTUiewqPT8bB389UZnJoHZvgtu4,13967
|
|
60
62
|
pdd/prompts/bug_to_unit_test_LLM.prompt,sha256=--ysObDv9WzOEyJMuaKEdDHkRrR_1j0dmOtlAFr4YRg,1205
|
|
61
63
|
pdd/prompts/change_LLM.prompt,sha256=W3sE6XZ2fb35XdqOykK1hDPtqkHSv9MZGD3sT8B8WjY,2083
|
|
@@ -64,7 +66,7 @@ pdd/prompts/continue_generation_LLM.prompt,sha256=Jsd3eeu23heqw2frfOLzZ5c9dn0QZr
|
|
|
64
66
|
pdd/prompts/detect_change_LLM.prompt,sha256=-q8VqXAv6ufEE193DNbTcgpbxiKISR5-5j3M0TTqa8s,4522
|
|
65
67
|
pdd/prompts/example_generator_LLM.prompt,sha256=48mUvjEYxQYf_HhDLP6RGOz6_d_go6JNExZ9g8aicCg,610
|
|
66
68
|
pdd/prompts/extract_auto_include_LLM.prompt,sha256=BamIIt8qrML2ZtNe3D4K30iMobJ4URtkyomHCDaf0iw,313
|
|
67
|
-
pdd/prompts/extract_code_LLM.prompt,sha256=
|
|
69
|
+
pdd/prompts/extract_code_LLM.prompt,sha256=rRql9Dv2Rn01F2hFeaGzfh9apxCkjY7WzAG0SAvIe8M,2470
|
|
68
70
|
pdd/prompts/extract_conflict_LLM.prompt,sha256=V_xXdU7V4IZK9SVFxJtXKRn_wFkP3zp4FJrxeNM9XYc,1023
|
|
69
71
|
pdd/prompts/extract_detect_change_LLM.prompt,sha256=2HXSb9bGjHZsKrUGvfBdBAAcGBCrQ2AxC8vUJRAfB1U,1003
|
|
70
72
|
pdd/prompts/extract_program_code_fix_LLM.prompt,sha256=ra_aDz2x8MfOa5dh7JCtxjoUFa4dWeKPJOpLohMnrig,1137
|
|
@@ -76,7 +78,7 @@ pdd/prompts/extract_unit_code_fix_LLM.prompt,sha256=1gWS0-Qs6vMynNNqp1Xc-2hcsyH_
|
|
|
76
78
|
pdd/prompts/extract_xml_LLM.prompt,sha256=eRcHaL-khShpb7C1_b7wmBJHfo2Kh1Wvjo_aOcWZovU,561
|
|
77
79
|
pdd/prompts/fix_code_module_errors_LLM.prompt,sha256=m-oqZ3cOkWbqke_l9z0Nmunf7NsnR9JWTNVVlfcteAY,1405
|
|
78
80
|
pdd/prompts/fix_errors_from_unit_tests_LLM.prompt,sha256=TedT4AhgFXkuAmXt07Q2sTij90n8El3nfOzPPXr8_Ws,4679
|
|
79
|
-
pdd/prompts/generate_test_LLM.prompt,sha256=
|
|
81
|
+
pdd/prompts/generate_test_LLM.prompt,sha256=y9SZ40zrRDOdp9DJnqq5_IMpsTORhAOphlo3QZlq7Ac,895
|
|
80
82
|
pdd/prompts/increase_tests_LLM.prompt,sha256=rekFzLRuZy99KifEKNlmPYoQdl8wa04112mtCdIY6S8,955
|
|
81
83
|
pdd/prompts/insert_includes_LLM.prompt,sha256=g-p2gXKENsqvfK5Q9FYbqFsIJ5CP7rbxmd4rROA-W80,1453
|
|
82
84
|
pdd/prompts/split_LLM.prompt,sha256=vhDLSqrfftvbDRagb0IfQpotnC-2z-xwKxGRsppkpDM,6135
|
|
@@ -87,9 +89,9 @@ pdd/prompts/trim_results_start_LLM.prompt,sha256=WwFlOHha4wzMLtRHDMI6GtcNdl2toE8
|
|
|
87
89
|
pdd/prompts/unfinished_prompt_LLM.prompt,sha256=-JgBpiPTQZdWOAwOG1XpfpD9waynFTAT3Jo84eQ4bTw,1543
|
|
88
90
|
pdd/prompts/update_prompt_LLM.prompt,sha256=_lGaxeVP4oF8yGqiN6yj6UE0j79lxfGdjsYr5w5KSYk,1261
|
|
89
91
|
pdd/prompts/xml_convertor_LLM.prompt,sha256=YGRGXJeg6EhM9690f-SKqQrKqSJjLFD51UrPOlO0Frg,2786
|
|
90
|
-
pdd_cli-0.0.
|
|
91
|
-
pdd_cli-0.0.
|
|
92
|
-
pdd_cli-0.0.
|
|
93
|
-
pdd_cli-0.0.
|
|
94
|
-
pdd_cli-0.0.
|
|
95
|
-
pdd_cli-0.0.
|
|
92
|
+
pdd_cli-0.0.6.dist-info/LICENSE,sha256=-1bjYH-CEjGEQ8VixtnRYuu37kN6F9NxmZSDkBuUQ9o,1062
|
|
93
|
+
pdd_cli-0.0.6.dist-info/METADATA,sha256=FSMAn1C8NhhdDSfcoaXW8Y5vy4efs0mP_EU0zhqpmUc,6913
|
|
94
|
+
pdd_cli-0.0.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
95
|
+
pdd_cli-0.0.6.dist-info/entry_points.txt,sha256=Kr8HtNVb8uHZtQJNH4DnF8j7WNgWQbb7_Pw5hECSR-I,36
|
|
96
|
+
pdd_cli-0.0.6.dist-info/top_level.txt,sha256=xjnhIACeMcMeDfVNREgQZl4EbTni2T11QkL5r7E-sbE,4
|
|
97
|
+
pdd_cli-0.0.6.dist-info/RECORD,,
|
pdd_cli-0.0.4.dist-info/METADATA
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: pdd-cli
|
|
3
|
-
Version: 0.0.4
|
|
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
|
-
Requires-Dist: semver
|
|
44
|
-
|
|
45
|
-
PDD (Prompt-Driven Development) Command Line Interface
|
|
46
|
-
======================================================
|
|
47
|
-
|
|
48
|
-
.. image:: https://img.shields.io/badge/pdd--cli-v0.0.4-blue
|
|
49
|
-
:alt: PDD-CLI Version
|
|
50
|
-
|
|
51
|
-
**Unlock the power of prompt-driven development with the PDD-CLI!**
|
|
52
|
-
|
|
53
|
-
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.
|
|
54
|
-
|
|
55
|
-
Key Features
|
|
56
|
-
------------
|
|
57
|
-
|
|
58
|
-
* **Code Generation:** Effortlessly generate runnable code from natural language prompts using the `generate` command.
|
|
59
|
-
* **Example Creation:** Automatically create example files from existing code and prompts with the `example` command.
|
|
60
|
-
* **Automated Testing:** Generate and enhance unit tests with the `test` command, including coverage analysis and improvement.
|
|
61
|
-
* **Prompt Management:** Preprocess, split, change, and update prompt files using commands like `preprocess`, `split`, `change`, and `update`.
|
|
62
|
-
* **Error Fixing:** Automatically fix errors in code and unit tests with the `fix` command, featuring iterative fixing and budget control.
|
|
63
|
-
* **Conflict Resolution:** Analyze and resolve conflicts between prompts using the `conflicts` command.
|
|
64
|
-
* **Crash Recovery:** Fix errors that caused a program to crash with the `crash` command, featuring iterative fixing and budget control.
|
|
65
|
-
* **Trace Analysis:** Find the associated line number between a prompt file and the generated code with the `trace` command.
|
|
66
|
-
* **Bug Reproduction:** Generate a unit test based on observed and desired outputs with the `bug` command.
|
|
67
|
-
* **Dependency Management:** Automatically analyze and insert dependencies into prompts with the `auto-deps` command.
|
|
68
|
-
* **Multi-Language Support:** Work with a wide range of programming languages, including Python, JavaScript, Java, C++, Ruby, and Go.
|
|
69
|
-
* **AI Model Control:** Fine-tune the AI model's output with options like `--strength` and `--temperature`.
|
|
70
|
-
* **Cost Tracking:** Monitor and report the cost of operations with the `--output-cost` option.
|
|
71
|
-
* **Example Review:** Review and control the use of few-shot examples with the `--review-examples` option.
|
|
72
|
-
* **Automatic Example Submission:** Automatically submit successful fixes to the PDD Cloud platform with the `--auto-submit` option.
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|