Quick Start Guide¶
This guide will help you get up and running with ProjectLens quickly. We'll cover basic usage patterns for both the command-line interface and Python API.
Basic CLI Usage¶
The simplest way to use ProjectLens is through its command-line interface:
Where:
- <folder_path> is the path to your project directory
- -x <extensions> specifies which file extensions to include (required)
Example: Basic Scanning¶
Scan a project for Python, Markdown, and TOML files:
This will:
1. Scan all files with .py, .md, and .toml extensions
2. Generate a tree structure of your project
3. Create an output file named myproject_YYYYMMDD_HHMM.txt
Example: Including Specific Files¶
Include additional files regardless of their extension:
Example: Excluding Patterns¶
Exclude specific directories or file patterns:
Example: Custom Output File¶
Specify your own output filename:
Example: Verbose Mode¶
Get detailed information about what's being processed:
Basic Python API Usage¶
You can also use ProjectLens programmatically in your Python scripts:
from projectlens import ProjectLens
# Initialize the scanner
lens = ProjectLens(
extensions=["py", "md", "yml"],
include=["Dockerfile", ".gitignore"],
exclude=["tests", "build", "*cache*"],
max_file_size=500 # in KB
)
# Scan and export project
lens.export_project(
folder_path="/path/to/project",
output="project_snapshot.txt" # Optional
)
# Access metadata about the scan
print(f"Files scanned: {len(lens.metadata.scanned_files)}")
print(f"Directories skipped: {len(lens.metadata.skipped_dirs)}")
Understanding the Output¶
ProjectLens generates a single text file containing:
- Header information:
- Generation timestamp
- Source directory
- Included file extensions
-
Exclude patterns
-
Project tree structure:
-
Visual representation of your project's directory hierarchy
-
File contents:
- Each file's content with clear separation and formatting
- Consistent headers and separators for easy parsing
Using Output with LLMs¶
The output is specifically formatted to be easily parsed by Large Language Models (LLMs). To use it:
- Upload the generated file into your LLM chat (ChatGPT, ClaudeAI, etc.)
- Ask questions about your project structure, code patterns, or request improvements
For example, you might prompt the LLM with: - "Analyze this project's structure and suggest improvements" - "How can I improve the modularization of this project adopting best practices?" - "How can I optimize file/function X?" - "Write numpy-style docstring for all functions from Y" - "Help me understand the flow of data in this application" - "Generate comprehensive documentation for this project"
Next Steps¶
- Explore CLI Options for more advanced usage
- Learn about the Python API for programmatic control
- See Configuration for customizing ProjectLens behavior
- Check out Use Cases for practical applications