Metadata-Version: 2.4
Name: pdd-cli
Version: 0.0.34
Summary: PDD (Prompt-Driven Development) Command Line Interface
Author: Greg Tanaka
Author-email: glt@alumni.caltech.edu
License: MIT
Project-URL: Homepage, https://github.com/promptdriven/pdd.git
Project-URL: Repository, https://github.com/promptdriven/pdd.git
Project-URL: Issue-Tracker, https://github.com/promptdriven/pdd/issues
Keywords: prompt-driven development,code generation,AI,LLM,unit testing,software development
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: GitPython==3.1.44
Requires-Dist: Requests==2.32.3
Requires-Dist: aiofiles==24.1.0
Requires-Dist: click==8.1.7
Requires-Dist: firecrawl-py
Requires-Dist: firebase_admin==6.6.0
Requires-Dist: keyring==25.6.0
Requires-Dist: langchain_core==0.3.56
Requires-Dist: nest_asyncio==1.6.0
Requires-Dist: pandas==2.2.3
Requires-Dist: psutil==5.9.0
Requires-Dist: pydantic==2.11.2
Requires-Dist: litellm
Requires-Dist: rich==14.0.0
Requires-Dist: semver==3.0.2
Requires-Dist: setuptools
Requires-Dist: boto3==1.35.99
Requires-Dist: python-Levenshtein
Provides-Extra: dev
Requires-Dist: commitizen; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: z3-solver; extra == "dev"
Dynamic: license-file

.. image:: https://img.shields.io/badge/pdd--cli-v0.0.34-blue
   :alt: PDD-CLI Version

.. image:: https://img.shields.io/badge/Discord-join%20chat-7289DA.svg?logo=discord&logoColor=white&link=https://discord.gg/Yp4RTh8bG7
   :alt: Join us on Discord
   :target: https://discord.gg/Yp4RTh8bG7

PDD (Prompt-Driven Development) Command Line Interface
======================================================

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.

Key Features
------------

- Cloud or Local Execution

  • Run in the cloud (default) with no need to manage API keys.
  • Switch to local mode with the ``--local`` flag for full control using your own API keys.

- GitHub Single Sign-On

  • Secure authentication with GitHub SSO in cloud mode.
  • Automatic token handling so you can focus on coding.

- Comprehensive Command Suite

  • Generate: Create runnable code from prompt files.
  • Example: Build examples that showcase generated code usage.
  • Test: Produce or improve unit tests based on coverage goals.
  • Fix & Crash: Automatically identify and correct errors, iterating if necessary.
  • Update & Change: Keep your prompt files in sync with evolving codebases.
  • Split & Detect: Manage and analyze complex prompts at scale.
  • …and more!

- Automated Testing & Cost Tracking

  • Generate coverage reports and additional test cases on the fly.
  • Optional cost-tracking (CSV) for AI usage.

- Rich Configuration & Customization

  • Environment variables to define default output paths and settings.
  • Fine-tune AI model behavior with ``--strength`` and ``--temperature``.
  • Built-in auto-update (configurable via env var).

- Cross-Language Support

  • Python, Java, JavaScript, Ruby, Go, C++, and beyond.
  • Prompt naming conventions let PDD infer language automatically.


Quick Installation
------------------

**Recommended: Using uv (Faster & Better Dependency Management)**

We recommend installing PDD using the `uv <https://github.com/astral-sh/uv>`_ package manager for better dependency management and automatic environment configuration:

.. code-block:: console

   # Install uv if you haven't already
   curl -sSf https://astral.sh/uv/install.sh | sh

   # Install PDD using uv tool install
   uv tool install pdd-cli

This installation method ensures:

- Faster installations with optimized dependency resolution
- Automatic environment setup without manual configuration
- Proper handling of the PDD_PATH environment variable
- Better isolation from other Python packages

**Alternative: Using pip**

If you prefer, you can install with pip:

.. code-block:: console

   pip install pdd-cli

After installation, verify:

.. code-block:: console

   pdd --version

You'll see the current PDD version (e.g., 0.0.34).

Advanced Installation Tips
--------------------------


**Virtual Environment**

Create and activate a virtual environment, then install pdd-cli:

.. code-block:: console

   python -m venv pdd-env

    # Activate environment
    # On Windows:
   pdd-env\Scripts\activate
    # On Unix/MacOS:
   source pdd-env/bin/activate

    # Install PDD (with uv - recommended)
   uv tool install pdd-cli
    # OR with pip
   pip install pdd-cli


**Environment Variables**

Optionally, add environment variables to your shell startup (e.g., ``.bashrc``, ``.zshrc``):

.. code-block:: console

   export PDD_AUTO_UPDATE=true
   export PDD_GENERATE_OUTPUT_PATH=/path/to/generated/code/
   export PDD_TEST_OUTPUT_PATH=/path/to/tests/

Tab Completion
~~~~~~~~~~~~~~
Enable shell completion:

.. code-block:: console

   pdd install_completion

Cloud vs Local
--------------

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:

.. code-block:: console

   pdd --local generate my_prompt_python.prompt

Be sure to configure API keys in your environment ahead of time:

.. code-block:: console

   export OPENAI_API_KEY=your_api_key_here
   export ANTHROPIC_API_KEY=your_api_key_here
   # etc.

Basic Usage
-----------

All commands follow a standard pattern:

.. code-block:: console

   pdd [GLOBAL OPTIONS] COMMAND [COMMAND OPTIONS] [ARGS]...

**Example – Generate Code**

Generate Python code from a prompt:

.. code-block:: console

   pdd generate factorial_calculator_python.prompt

In cloud mode (no local keys required). Or locally if you prefer:

.. code-block:: console

   pdd --local generate factorial_calculator_python.prompt

**Example – Test**

Automatically create or enhance tests:

.. code-block:: console

   pdd test factorial_calculator_python.prompt src/factorial_calculator.py

Use coverage analysis:

.. code-block:: console

   pdd test --coverage-report coverage.xml --existing-tests tests/test_factorial.py \
       factorial_prompt.prompt src/factorial.py


**Example – Fix Iteratively**

Attempt to fix failing code or tests in multiple loops:

.. code-block:: console

   pdd fix --loop \
       factorial_calculator_python.prompt src/factorial_calculator.py tests/test_factorial.py errors.log

PDD will keep trying (with a budget limit configurable by ``--budget``) until tests pass or attempts are exhausted.

Why Prompt-Driven Development?
------------------------------

*   **Increased Productivity:** Automate tedious tasks and focus on higher-level design.
*   **Improved Code Quality:** Leverage AI to generate well-structured and tested code.
*   **Faster Development Cycles:** Rapidly prototype and iterate on your ideas.
*   **Reduced Errors:** Automatically identify and fix errors in your code.
*   **Enhanced Collaboration:** Work seamlessly with prompt files as a shared source of truth.

Getting Help
------------

Use inline help to discover commands and options:

.. code-block:: console

   pdd --help
   pdd generate --help
   pdd fix --help
   ...

Happy Prompt-Driven Coding!
