This example shows you how to set up Prompt-Driven Development (PDD) with a free Gemini API key and run the built-in Hello example.
Goal: By the end, you’ll have PDD installed, Gemini configured, and
pdd generaterunning on the Hello example.
PDD works best in an isolated environment. You can pick one of these methods:
macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install pdd-cli
pdd --versionWindows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
uv tool install pdd-cli
pdd --versionpython -m pip install --user pipx
python -m pipx ensurepath
pipx install pdd-cli
pdd --versionpython -m venv ~/.venvs/pdd
source ~/.venvs/pdd/bin/activate # Windows: %USERPROFILE%\venvs\pdd\Scripts\activate
pip install --upgrade pip
pip install pdd-cli
pdd --version✅ If you see pdd, version X.Y.Z, installation worked.
pdd isn’t found, try ~/.local/bin/pdd --version once, then add ~/.local/bin to your PATH.
Right after installation, let PDD bootstrap its configuration:
pdd setupDuring the wizard:
- Choose Install tab completion if you want shell helpers.
- Pick Google Gemini when asked which providers to configure.
- Paste your Gemini API key when prompted (you can create it in the next step if you haven’t already).
The wizard writes your credentials to ~/.pdd/api-env, seeds ~/.pdd/llm_model.csv with Gemini entries, and reminds you to reload your shell (source ~/.zshrc, etc.) so completion and env hooks load.
If you prefer to configure everything manually—or you’re on an offline machine—skip the wizard and follow the manual instructions below.
git clone https://github.com/promptdriven/pdd.git
cd pdd/examples/helloIf you already pasted the key into pdd setup, you can skip this section. Otherwise:
- Go to Google AI Studio.
- Log in with your Google account.
- Click Create API key.
- Copy the key.
macOS/Linux (bash/zsh)
export GEMINI_API_KEY="PASTE_YOUR_KEY_HERE"Windows (PowerShell)
setx GEMINI_API_KEY "PASTE_YOUR_KEY_HERE"Then close and reopen your terminal.
Check:
echo $GEMINI_API_KEY # macOS/Linux
echo $Env:GEMINI_API_KEY # WindowsThe setup wizard already adds a Gemini row. Only follow this step if you skipped the wizard or want to edit the file by hand. Add Gemini rows so PDD knows how to call the Google AI Studio models:
provider,model,input,output,coding_arena_elo,base_url,api_key,max_reasoning_tokens,structured_output,reasoning_type
gemini,gemini/gemini-2.5-pro,0,0,0,,GEMINI_API_KEY,0,True,noneMake sure the file exists:
head -2 ~/.pdd/llm_model.csvBy default, PDD writes generated files next to your source code.
To keep repos tidy, set these environment variables once (e.g., in ~/.zshrc or ~/.bashrc):
export PDD_TEST_OUTPUT_PATH=tests
export PDD_EXAMPLE_OUTPUT_PATH=examplesWith these set, PDD will place outputs like so:
- Examples →
examples/<module>/... - Tests →
tests/<module>/...
From pdd/examples/hello:
# generate code from the prompt
pdd generate hello_python.prompt
# run the generated example if it has a main block
python examples/hello/hello.pyIf the generated hello.py is minimal (no __main__ block), run it interactively:
python -i examples/hello/hello.py
>>> hello()
helloAfter you’ve confirmed generate works:
pdd --force sync helloSometimes the generated file only defines the function (e.g., def hello(): print("hello")) but doesn’t include the standard Python entry point:
if __name__ == "__main__":
hello()In that case you have two options:
python -i examples/hello/hello.py
>>> hello()
helloAppend this to the bottom of the file:
if __name__ == "__main__":
hello()Then re-run:
python examples/hello/hello.py
# output:
hello✅ That’s it! You’ve installed PDD, configured Gemini, set up the model CSV, and generated your first working example.