A macOS app for building context files for LLMs built in python. This tool allows you to visually select files from your projects and generate formatted context documents suitable for prompting large language models. Largely inspired by Simon Willison's files-to-prompt project
- File explorer with checkboxes for easy selection
- Support for different output formats (Plain text, XML, Markdown)
- Live preview with token counting
- Smart file filtering (respects .gitignore, filters by extension)
- Line number option
- Copy to clipboard and save to file functionality
- Clone the repository:
git clone https://github.com/pachev/context-builder
cd context-builder
- Install using UV:
uv sync
- Install the package in development mode:
uv pip install -e .
Open the GUI for the current directory:
ctx-builder .
Or specify a different directory:
ctx-builder /path/to/project
- Open the application
- Use the "Open Folder" button to select a project directory
- Check the files you want to include in your context
- Select your preferred output format (XML, Markdown)
- Optionally enable line numbers
- Use "Copy to Clipboard" or "Save to File" to export your context
- Default: Simple format with file paths and content separated by dashes
- XML: XML-ish format
- Markdown: GitHub-flavored markdown with fenced code blocks
- Python 3.10+
- PyQt6
- Click
Apache License 2.0