The best tool to generate AI prompts from code projects and make any AI understand a whole project!
Project description
PTAP - Project To AI Prompt 🤖
Give Your AI the Full Picture: Instantly Generate Perfect Prompts from Your Entire Codebase!
🤔 The Problem: AI Needs Context!
Large Language Models (LLMs) are incredible tools for code analysis, debugging, documentation, and more. But to give you useful answers, they need context. Explaining your project's structure and providing all the relevant code snippets manually is:
- Time-Consuming: Copying and pasting file structures and code takes forever.
- Error-Prone: It's easy to miss files or format the prompt incorrectly.
- Frustrating: You spend more time preparing the prompt than getting insights.
✨ The Solution: PTAP!
PTAP (Project To AI Prompt) automates this entire process! It scans your project directory, intelligently gathers the file structure and code content, and generates a single, comprehensive, well-formatted prompt ready to be pasted into your favorite AI chat.
Stop wasting time manually crafting prompts. Let PTAP give your AI the context it needs in seconds!
🚀 Key Features
- ✅ Automated Prompt Generation: Scans your project and builds the prompt for you. Saves massive amounts of time.
- 🌲 Clear Project Structure: Includes a JSON representation of your directory tree, so the AI understands file relationships.
- 📄 Complete Code Context: Embeds the content of your relevant source files directly into the prompt.
- ⚙️ Highly Customizable:
- Exclude specific folders (like
.git,node_modules,venv). - Customize the introductory text.
- Show or hide file titles in the output.
- Define which file types to include.
- Exclude specific folders (like
- 🔒 Private & Secure: Runs 100% locally. Your code never leaves your machine.
- 📋 Flexible Output: Copies the prompt directly to your clipboard or saves it to a text file.
- 🐙 GitHub Repository Support: Analyze public GitHub repositories directly by providing a URL.
🎬 Demo
PTAP streamlines the process of getting your project information to an AI. You point PTAP at your code (either a local folder or a GitHub repository), it generates a detailed prompt including the file structure and code, and then you can easily copy this prompt (or save it to a file) to use with AI models like ChatGPT, Claude, etc.
(A GIF/video demo might be added here in the future!)
🛠️ Prerequisites
Before you install PTAP, make sure you have the following essentials installed on your system:
-
Python: Version 3.7 or higher.
- How to check: Open your terminal or command prompt and type
python --versionorpython3 --version. - How to install: Download from python.org. Installation usually includes
pip.
- How to check: Open your terminal or command prompt and type
-
Pip: Python's package installer (usually comes with Python).
- How to check: Type
pip --versionorpip3 --version. - How to upgrade (optional but recommended): python -m pip install --upgrade pip
- How to check: Type
-
Git: (Required only if you want to use the GitHub repository feature (
-gflag)).- How to check: Type
git --version. - How to install:
- Windows: Download from git-scm.com.
- macOS: Easiest way is often via Homebrew:
brew install git. Or download from git-scm.com. - Linux (Debian/Ubuntu): sudo apt update && sudo apt install git
- Linux (Fedora/CentOS/RHEL): sudo dnf install git or sudo yum install git
- How to check: Type
💾 Installation
Install PTAP easily using pip:
pip install ptap
⚙️ Usage
PTAP is a command-line tool. Here’s how to use it:
1. Analyze Current Directory (Output to Clipboard): Navigate to your project's root directory in your terminal and run:
ptap
(This is the simplest use case. The AI prompt is copied to your clipboard.)
2. Analyze a Specific Project Path:
ptap /path/to/your/project
3. Save Prompt to a Text File:
Creates a .txt file in the analyzed project's root directory.
ptap -t my_project_prompt
(This will create my_project_prompt.txt)
4. Analyze a Public GitHub Repository: (Requires Git to be installed!)
ptap -g https://github.com/user/repository-name
(PTAP will clone the repo temporarily, generate the prompt, and then clean up.)
5. Customize Output (Hide Elements):
-
Hide the default introduction text:
ptap -hd intro
-
Hide the
--- File: path/to/file.py ---titles (Not Recommended - can confuse AI):ptap -hd title
-
Hide both:
ptap -hd intro,title
6. Configure PTAP:
-
Open the configuration file (
config.json) for editing:ptap -c
(This opens the file in your default editor. The file is located at
~/.ptap/config.json) -
Reset the configuration file to its default settings:
ptap -r
🔧 Configuration (~/.ptap/config.json)
You can customize PTAP's behavior by editing its configuration file (use ptap -c to open it). Key options include:
intro_text: The default text prepended to every prompt. Modify it to suit your needs!show_intro:trueorfalseto always show/hide the intro text by default.title_text: The format string for file titles (e.g.,--- File: {file} ---).{file}is the placeholder for the relative path.show_title:trueorfalseto always show/hide file titles by default.skipped_folders: A list of folder names to completely ignore during scanning (e.g.,.git,__pycache__,node_modules).- (Note: The list of allowed file extensions is currently managed within
ptap/file_reader.pybut may move to config in the future.)
⚠️ Limitations
- AI Input Limits: Very large projects might generate prompts exceeding the maximum input length of some AI models.
- File Types: Primarily designed for text-based source code files. Binary files or unusual encodings might not be processed correctly.
- AI Interpretation: The AI's understanding still depends on its own capabilities.
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or submit a pull request.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Developed by Far3k
- GitHub: Far3000-YT
- Email: far3000yt@gmail.com
- Discord: @far3000
- X (Twitter): @0xFar3000
Unlock the full potential of AI for your code. Give PTAP a try!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ptap-1.2.1.tar.gz.
File metadata
- Download URL: ptap-1.2.1.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
044df8e0dabd9e1973909429697792d2c704a25ac65fd48c17856a098df79932
|
|
| MD5 |
2e1ffda2859ef624ef18b68abc55933f
|
|
| BLAKE2b-256 |
dd0a9afa6a734b35d881718e1e45d3ca15566a233ce63ecc2fcbbec46628fdb3
|
File details
Details for the file ptap-1.2.1-py3-none-any.whl.
File metadata
- Download URL: ptap-1.2.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de074cb68039b59712636168dae7e91180fd8f77efaecf8d09b1e8898b615b8c
|
|
| MD5 |
eb561578796e7bdb2c431df2a3423378
|
|
| BLAKE2b-256 |
33f3955b545504ee9c810755cb06990f17522c58c09ce93fdfa6b024f6657a3f
|