---
description: "When user asks to generate context from a repository, call the extract_repo_content.py script to convert code repositories to text"
globs: ["**/*.py", "**/*.js", "**/*.ts", "**/*.java", "**/*.jsx", "**/*.tsx", "**/*.html", "**/*.css", "**/*.scss"]
---
# Code Repository Context Generation
This module handles transforming source code repositories into text format for processing using repopack-py.
## Command Definition
```
GENERATE_CONTEXT repo_path=/path/to/repo output=/path/to/output [line_numbers=true|false] [style=plain|xml]
```
## Usage Examples
```
GENERATE_CONTEXT repo_path=/Users/jlcases/projects/my-repo
GENERATE_CONTEXT repo_path=../my-project output=project_context.txt line_numbers=true
```
## Command Process
When executed, this command:
1. Validates the repository path exists
2. Sets up a Python virtual environment if needed
3. Installs repopack and dependencies
4. Calls extract_repo_content.py to process the repository
5. Generates a text file with the repository content
## Integration with PAELLADOC
This command is used before analyzing code or generating documentation from existing code, allowing PAELLADOC to understand the codebase structure and content.
## Implementation Details
This command uses the `extract_repo_content.py` script to:
- Set up a virtual environment
- Install the repopack library
- Process the repository
- Generate a text file with all code content
The script can be called with the following parameters:
- `repo_path`: The path to the repository to process (required)
- `output`: The name of the output file (optional)
- `line_numbers`: Whether to show line numbers in the output file (optional)
- `style`: The output style - plain or xml (optional)
- `ignore`: Additional patterns to ignore (optional)