This repository automatically generates new single-file apps (either HTML or Python) every day using the Perplexity AI API, powered by GitHub Actions automation.
Each run creates a new prompt, builds a working app, and commits the results back to the repository for version tracking.
The system works in two main stages:
- Prompt Generation – A creative, structured product specification is generated using Perplexity.
- App Generation – Based on the prompt, Perplexity builds a complete single-file application that can be an HTML app (with inline CSS and JavaScript) or a pure Python script.
All results are automatically saved in organized folders under dist/:
dist/prompts/– versioned prompt text files describing each generated appdist/apps/– versioned generated applications (.htmlor.py)dist/latest/– the most recent prompt and app for quick accessdist/log.txt– log of all runs with timestamps and statuses
automation/ │ ├── generate.py → Main script that handles prompt generation and app creation │ .github/ │ └── workflows/ └── daily-perplexity.yml → GitHub Actions workflow that automates daily code generation │ dist/ │ ├── apps/ → Generated applications (HTML or Python) ├── prompts/ → Generated prompt specifications ├── latest/ → Latest generated prompt and app for quick access └── log.txt → Log file containing timestamps and status of each run
- API Endpoint: https://api.perplexity.ai/chat/completions
- Model:
sonar(can be overridden via workflow environment variable) - Automation: GitHub Actions runs once per day at 13:00 UTC (≈ 9 AM US Eastern)
- Retries: The workflow automatically retries failed API calls up to three times, with exponential backoff.
- Timeouts: Each API call allows up to 420 seconds for a response.
- Logging: Every success or failure is appended to
dist/log.txtfor easy debugging.
- GitHub Action triggers daily (or manually via Run workflow).
- The Python script
generate.pyruns and:- Generates a creative prompt for a new single-file app.
- Builds the complete app (HTML or Python) based on that prompt.
- Generated files are versioned (no overwrites). If a filename already exists, it’s automatically saved as
-2,-3, etc. - All new files are committed and pushed back to the repository with the message “automation using Perplexity AI.”
- Clone or fork this repository.
- In your repository settings, go to Settings → Secrets and variables → Actions → New repository secret.
- Add a secret named
PPLX_API_KEYwith your Perplexity API key. - Commit your workflow YAML file (
.github/workflows/daily-perplexity.yml). - Run the workflow manually once to verify the setup.