Project-prompt-generator

Latest version: v0.1.7

Safety actively analyzes 722674 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.7

Or install from source
pip install .

For development
pip install -e ".[dev]"


New Features โœจ

- **Clipboard Integration**: ๐Ÿ“Ž Automatically copy output file paths to clipboard on macOS
- **Improved Event Handling**: โšก Refactored event system with dedicated handlers for end events
- **Enhanced Documentation**: ๐Ÿ“š Added important usage notes and deprecation warnings

Improvements ๐Ÿ”ง

- **Build Process**: ๐Ÿงน Added clean step to release process in Makefile
- **Directory Structure**: ๐Ÿ—๏ธ Reorganized code for better maintainability
- **Environment Configuration**: ๐Ÿ”„ Enhanced `.envrc` handling with smarter variable management

Technical Changes ๐Ÿ› ๏ธ

- Added new `osx_clipboard.py` module with Swift-based clipboard functionality
- Refactored event handling in output handlers for better separation of concerns
- Renamed `envrc_handler.py` to `envrc.py` with improved variable management
- Removed deprecated `PPG_OUTPUT_DIR` environment variable
- Added new `PPG_ENABLE_CLIPBOARD` environment variable (default: "false")

Bug Fixes ๐Ÿž

- Fixed duplicate handler calls in event processing system
- Improved file path handling in clipboard integration
- Enhanced environment variable management to avoid duplicates in `.envrc` files

Notes ๐Ÿ“

- **Deprecated**: The `--markdown` output format is now deprecated and will be removed in a future version
- **Important**: While the tool attempts to mask sensitive information, always review generated files before sharing

0.1.6

New Features โœจ

- **JSON Output Format**: ๐Ÿ“Š Generates project data in JSON format, with options for compact or line-split content.
- **Markdown Output**: ๐Ÿ“ Generate structured Markdown documentation, including a table of contents.
- **`.envrc` Integration**: ๐Ÿš€ Simplified configuration with automatic `.envrc` file updates.
- **`last-run` Tool**: ๐Ÿƒโ€โ™‚๏ธ A command-line utility to quickly run recently modified scripts in your Downloads directory.
- **Force Execution**: ๐Ÿ’ช Use the `--force` flag to run ppg outside of a git repository.

Improvements ๐Ÿ”ง

- **Simplified CLI Usage**: Streamlined command-line interface with more intuitive options.
- **JSON Output**: ๐Ÿ“Š Generates structured JSON outputs for ingestion into other tools.
- **Robust Script Detection**: `last-run` uses comprehensive script type detection in clipboard content, especially for macOS users.
- **Enhanced Error Handling**: Improved error messages and graceful exit for various scenarios.
- **Improved Path Handling**: `.envrc` configuration now defaults to use paths in your Downloads folder relative to the current project.

Technical Changes ๐Ÿ› ๏ธ

- Introduced new `cli/last_run.py` and `cli/ppg.py` for handling command-line arguments.
- Created `outputs` package for managing different output formats (JSON and Markdown).
- Refactored file processing and output generation with event-based architecture.
- Improved language mapping and sensitive data masking.
- Moved utility functions into a `utils` package for better organization.

Bug Fixes ๐Ÿž

- Resolved issues related to git repository detection.
- Enhanced handling of file paths and directory creation.
- Improved reliability of sensitive data masking.
- Addressed miscellaneous issues for more consistent operation.

0.1.5

New Features โœจ

- **Event-Based Architecture**: Completely refactored to use an event system for file processing and output generation ๐Ÿ“ก
- **Simplified Command Interface**: Default command now generates a single all-in-one file, with `--split` option for individual files ๐Ÿงฉ
- **Enhanced File Walking**: New dedicated `FileWalker` class for improved directory traversal and file filtering ๐Ÿ”
- **Custom Ignore Files**: Support for custom ignore files via `PPG_IGNORE_FILES` environment variable ๐Ÿ› ๏ธ
- **PowerShell Secure String Detection**: Improved sensitive data masking for PowerShell secure strings ๐Ÿ”’
- **Advanced Test Cases**: Added test cases for complex password patterns and secure string variations โœ…

Improvements ๐Ÿ”ง

- **Simplified Usage**: The default `ppg` command now generates an all-in-one file without requiring subcommands ๐Ÿš€
- **Cleaner Error Handling**: Better error management in file processing and improved feedback during processing ๐Ÿ“Š
- **More Flexible Ignore Rules**: Enhanced ignore rules that respect both `.gitignore` and custom patterns ๐Ÿ›ก๏ธ
- **Modular Components**: Split functionality into focused modules for better code organization ๐Ÿ“

Technical Changes ๐Ÿ› ๏ธ

- Added new modules: `events.py`, `file_walker.py`, `ignore_handler.py`, `language_mapping.py`, `options.py`, and `output_handler.py` for better code organization โš™๏ธ
- Completely refactored `generator.py` to use the event system architecture ๐Ÿ”„
- Modified command-line interface in `cli.py` to simplify usage patterns ๐Ÿ–ฅ๏ธ
- Replaced direct file output with handlers for different output formats ๐Ÿ“
- Added `FileEntry` data class for consistent file metadata handling ๐Ÿ“„

Bug Fixes ๐Ÿž

- Fixed sensitive data masking to properly handle PowerShell secure strings with different parameter formats ๐Ÿ› ๏ธ
- Fixed path handling for files with special characters ๐Ÿ”ง
- Improved UTF-8 handling for file content processing ๐Ÿ“„

Dependency Updates โฌ†๏ธ

- No changes to external dependencies in this version โœ“

0.1.4

New Features โœจ

- **Environment Variable Configuration**: Customize output locations using `PPG_OUTPUT_DIR` and `PPG_OUTPUT_FILE` ๐ŸŒ
- **Flexible CLI**: Uses `argparse` for enhanced command-line argument parsing ๐Ÿš€
- **Test Coverage**: Added `coverage` target to Makefile for test coverage reporting ๐Ÿงช
- **Test Cases**: Added test cases for masking API keys, passwords, and handling text without sensitive data โœ…
- **Ignore .pytest_cache**: The `.pytest_cache` directory is now ignored by default ๐Ÿ›ก๏ธ

Improvements ๐Ÿ”ง

- **Enhanced README**: Improved documentation with comprehensive examples and environment variable details ๐Ÿ“š
- **Robust Path Handling**: Handles environment variables, "~", and absolute paths in output directory and file configurations ๐Ÿ“

Technical Changes ๐Ÿ› ๏ธ

- Migrated from `click` to `argparse` in `cli.py` for argument parsing โš™๏ธ
- Added `expand_path_variables` in `prompts/generator.py` for path handling ๐ŸŒ
- Modified `get_files_to_process` in `prompts/file_processor.py` to skip output file and `.pytest_cache` ๐Ÿ“
- Improved sensitive data masking regex and handling in `prompts/sensitive_masker.py` ๐Ÿ”’

Bug Fixes ๐Ÿž

- Fixed sensitive data masking to correctly handle different quote characters in PowerShell secure strings and other scenarios ๐Ÿ› ๏ธ

Dependency Updates โฌ†๏ธ

- Removed `click` dependency ๐Ÿšซ
- Added `pytest` and `pytest-cov` as development dependencies โœ…

0.1.2

New Features โœจ

- **Modular Architecture**: Completely refactored the codebase into a modular structure with dedicated modules for different functionality ๐Ÿ”„
- **Command Flexibility**: Split the functionality into two separate commands:
- `generate` (aliases: `g`, `gen`): Creates individual markdown files in a directory ๐Ÿ“„
- `generate_all_in_one` (aliases: `a`, `all`): Creates a single consolidated markdown file ๐Ÿ“‘
- **Simpler Command Names**: Added `ppg` as an alternative to `promg` for easier typing โŒจ๏ธ

Improvements ๐Ÿ”ง

- **Better Code Organization**: Created dedicated modules for file processing, generation, and sensitive data masking ๐Ÿ—‚๏ธ
- **Enhanced Documentation**: Updated README with detailed command documentation and project structure ๐Ÿ“š
- **Cleaner Output Options**: More flexibility in where output files are created:
- Individual files in `ppg_generated/` directory ๐Ÿ—„๏ธ
- Single file as `ppg_created_all.md.txt` in the current directory ๐Ÿ“

Technical Changes ๐Ÿ› ๏ธ

- Moved core functionality from monolithic `cli.py` into separate modules:
- `generator.py`: Handles file generation workflows โš™๏ธ
- `file_processor.py`: Handles file reading and markdown conversion ๐Ÿ“‘
- `sensitive_masker.py`: Manages sensitive data detection and masking ๐Ÿ”’
- Added proper package exports in `__init__.py` ๐Ÿ“ฆ
- Simplified command-line interface with clear command aliases โŒจ๏ธ

Upgrade Notes โš ๏ธ

- The legacy `gen` command has been removed; use `generate` or `generate_all_in_one` instead ๐Ÿšซ
- Command aliases provide convenient shortcuts for frequently used commands ๐Ÿ”„
- The output directory is now called `ppg_generated` (without the dot prefix) ๐Ÿ“

Links

Releases

ยฉ 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.