https://github.com/5h1ngy/cli-py-project-pars3r
A Python CLI tool that transforms entire project structures into a single prompt file, enabling comprehensive and context-rich inputs for LLMs.
https://github.com/5h1ngy/cli-py-project-pars3r
ai-prompt-generation automation cli cli-tool cli-tools developer-tools llm-integration llm-prompt-engineering open-source productivity project-parser prompt-generator python scaffolding
Last synced: 3 months ago
JSON representation
A Python CLI tool that transforms entire project structures into a single prompt file, enabling comprehensive and context-rich inputs for LLMs.
- Host: GitHub
- URL: https://github.com/5h1ngy/cli-py-project-pars3r
- Owner: 5h1ngy
- License: mit
- Created: 2024-12-10T19:18:55.000Z (7 months ago)
- Default Branch: develop
- Last Pushed: 2024-12-27T15:35:59.000Z (7 months ago)
- Last Synced: 2025-02-09T12:26:53.755Z (5 months ago)
- Topics: ai-prompt-generation, automation, cli, cli-tool, cli-tools, developer-tools, llm-integration, llm-prompt-engineering, open-source, productivity, project-parser, prompt-generator, python, scaffolding
- Language: Python
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **cli-py-project-pars3r** π
![]()
[](./LICENSE)
[](#)
A Python CLI tool that not only parses and restores project structures but also simplifies the creation of complex prompts for LLMs. With **cli-py-project-pars3r**, you can bundle an entire projectβits files, directories, and contentsβinto a single `.prompt` file, making it easy to feed complete context to a large language model.
![]()
![]()
## **Table of Contents** π
- [Introduction](#introduction-)
- [Features](#features-)
- [Requirements](#requirements-)
- [Installation & Setup](#installation--setup-)
- [Usage](#usage-)
- [Building & Packaging](#building--packaging-)
- [LLM Integration and Prompt Templates](#llm-integration-and-prompt-templates-)
- [Project Structure](#project-structure-)
- [Testing](#testing-)
- [Contributing](#contributing-)
- [License](#license-)
- [Contact](#contact-)## **Introduction** π
**cli-py-project-pars3r** streamlines two main operations:
1. **Packing**: Parse an entire project into a single `.prompt` file, capturing all files, directories, and content. This file can then be provided to an LLM in one go for a complete context.
2. **Unpacking**: Restore the projectβs structure and files from a `.prompt` file, effectively reconstructing the original project setup.This approach is especially useful for LLM-based development, code reviews, or documentation tasks where the model needs a full view of the project context.
## **Features** β
- **Parse entire projects** into a single `.prompt` file for LLMs.
- **Restore** directory structures and files from a `.prompt` file.
- **Interactive CLI** for selecting folders or prompt files.
- **Flexible and configurable** to support various file types.
- **Ideal for comprehensive LLM inputs**, providing complete project context in one file.
- Compatible with **Python >= 3.6**.## **Requirements** π οΈ
- **Python**: `>= 3.6`
- **pip**: Python package installer## **Installation & Setup** πΎ
### 1. Clone the Repository
```bash
git clone https://github.com/5h1ngy/cli-py-project-pars3r.git
cd cli-py-project-pars3r
```### 2. Set Up the Virtual Environment
Create and activate a virtual environment to isolate your dependencies:
- **On Windows:**
```bash
python -m venv venv
venv\Scripts\activate
```- **On macOS/Linux:**
```bash
python3 -m venv venv
source venv/bin/activate
```### 3. Install Dependencies
If you have a `requirements.txt` (or plan to add one):
- **Install the dependencies:**
```bash
pip install -r requirements.txt
```- **Update `requirements.txt`:**
When you add new dependencies, update the file by running:```bash
pip freeze > requirements.txt
```### 4. Install the Package (Optional)
To conveniently use the CLI command without referencing the source every time, you can install the package. For live development (using source changes directly), install in editable mode:
```bash
pip install -e .
```Test the CLI command:
```bash
pars3r
```## **Usage** βοΈ
### Core Functionalities:
1. **Packing**:
- Run `pars3r` and choose the **pack** mode.
- Select a folder to analyze. The tool then generates a `.prompt` file summarizing its entire contents.
- Use the generated `.prompt` file as input to your LLM for complete project context.```bash
pars3r
```2. **Unpacking**:
- Run `pars3r` and choose the **unpack** mode.
- Select a `.prompt` file. The tool will reconstruct the original directory structure and files.
```bash
pars3r
```## **Building & Packaging** ποΈ
To create a distributable package:
1. **Build the Package:**
First, ensure the `build` package is installed in your virtual environment:```bash
python -m build
```This will generate build files in the `dist/` folder.
2. **Install the Package:**
After building, install the package (if not in editable mode):```bash
pip install dist/cli_py_project_pars3r-0.1.0-py3-none-any.whl
```*Note:* The `.whl` file name might vary depending on the version.
3. **Using VS Code Tasks:**
The tasks defined in `.vscode/tasks.json` are preconfigured for:
- Building the package
- Installing in development mode
- Running the programThese tasks can be executed directly from the VS Code interface.
## **LLM Integration and Prompt Templates** π€
This tool shines when integrated into an LLM workflow. Once you create a `.prompt` file:
- You can feed it directly to your LLM as context.
- The file contains your entire project: code, structure, and documentationβallowing the LLM to fully understand complex architectures and dependencies.### Example Use-Case
**Dynamically populate a README template:**
- **Prompt Suggestion:**
*"Generate a README based on the contents of this .prompt file."*
This tells the LLM to create documentation dynamically using the complete project context.### Additional Prompt Ideas
- **Refactoring Assistance:**
*"Given the .prompt file, suggest improvements for refactoring the codebase to enhance maintainability."*
- **Enhanced Documentation:**
*"From the .prompt file, generate comprehensive documentation and inline code comments."*
- **Testing Strategy:**
*"Using the .prompt file as context, propose a robust testing strategy covering all major components."*## **Project Structure** ποΈ
```plaintext
cli-py-project-pars3r/
βββ bin/
β βββ main.py # Entry point for the CLI
β βββ __init__.py
βββ pars3r/
β βββ parser.py # Logic for parsing and generating the prompt file
β βββ scaffolding.py # Logic for restoring the project structure
β βββ __init__.py
βββ scripts/
β βββ cleanup.sh # Script for cleaning temporary files
βββ .vscode/
β βββ launch.json # Debug configuration settings
β βββ tasks.json # Tasks for building, installing, and running
βββ setup.py # Package configuration for distribution
βββ requirements.txt # (Optional) List of project dependencies
βββ README.md # Project documentation
βββ assets/ # Images and assets for the README
```## **Testing** β
Run automated tests (if available):
```bash
pytest tests/
```## **Contributing** π€
Want to contribute? Follow these steps:
1. **Fork** the repository.
2. Create a branch for your feature:
```bash
git checkout -b feature/your-feature-name
```
3. Make your changes and commit them.
4. Open a **Pull Request** on the original repository.## **License** π
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
## **Contact** βοΈ
- **Repository**: [https://github.com/5h1ngy/cli-py-project-pars3r.git](https://github.com/5h1ngy/cli-py-project-pars3r.git)
- **Author**: [5h1ngy](https://github.com/5h1ngy)