context_generator/readme.md

81 lines
2.4 KiB
Markdown

# File Tree Selector
A desktop GUI tool for browsing a directory tree, selecting files/folders, and exporting their contents as a single concatenated text block — useful for feeding code into LLMs.
![screenshot](screenshot.jpg)
## What it does
- Displays a navigable file tree for any directory you specify
- Green checkbox = include in output, red = exclude
- Selection cascades: mark a folder green and all its children are included unless individually excluded
- Unreadable/permission-denied files are shown with strikethrough and cannot be selected
- "Generate" concatenates all selected files into a preview pane; "Copy All" puts it on your clipboard
## Requirements
- Python 3.8+
- `pywebview` and its platform dependencies (see below)
### Linux (additional system packages required)
pywebview on Linux requires GTK and WebKit2 — these cannot be installed via pip:
```bash
# Ubuntu/Debian
sudo apt install python3-gi python3-gi-cairo gir1.2-webkit2-4.0
# If on a newer distro (Ubuntu 24+), try:
sudo apt install python3-gi python3-gi-cairo gir1.2-webkit2-4.1
```
### Windows
No additional system packages required. pywebview uses the built-in WebView2 runtime (included with Windows 10/11).
### macOS
No additional system packages required. pywebview uses the built-in WebKit.
## Running the app
### Linux / macOS
```bash
bash run.sh
```
The script will create a `.venv`, install Python dependencies, and launch the app. On Linux, it checks for GTK dependencies first and exits with instructions if they're missing.
### Windows
```powershell
.\run.ps1
```
Run from PowerShell. If you get an execution policy error:
```powershell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
```
## Project structure
```
.
├── alpha.py # Main application (latest version)
├── run.sh # Setup + launch script for Linux/macOS
├── run.ps1 # Setup + launch script for Windows
├── requirements.txt # Python dependencies
└── README.md
```
## Usage
1. Launch the app
2. Type (or paste) an absolute path into the path bar and press Enter
3. The left panel shows the folder tree; click a folder to view its contents on the right
4. Click a checkbox to toggle include/exclude — red = excluded, green = included
5. Use the root folder checkbox to include/exclude everything at once, then carve out exceptions
6. Click **Generate** to preview the output, then **Copy All** to copy to clipboard