FilesToAI
Instantly export your codebase to AI. Smart filtering, one-click copy, global hotkey.
Now available as both a CLI tool and Web Interface!
🚀 Quick Start
Option 1: Command Line (Instant)
# Install as a package
pip install -e .
# Use anywhere
filestoai . # Export current directory
filestoai /path/to/project -gi # With gitignore
filestoai . --size 200 # Custom size limit (200 KB)
filestoai --server # Start web interface
Option 2: Web Interface
git clone https://github.com/mystxcal/FilesToAI
cd FilesToAI
pip install -e .
# Start server (choose one):
filestoai --server # Via CLI
# OR
pip install -r requirements.txt
python app.py # Direct method
→ Open http://127.0.0.1:5023
💡 What It Does
CLI: Run filestoai . in any directory → Output copied to clipboard instantly
Web: Select files from your project → Generate AI-ready output → Copy with Ctrl+Shift+Space
Perfect for feeding context to ChatGPT, Claude, and other LLMs.
✨ Features
CLI Mode
- ⚡ Lightning Fast — Run
filestoai .and get instant output - 🎯 Flexible Flags —
-gifor gitignore,--sizefor limits,-ifor custom patterns - 📋 Auto Copy — Output goes straight to clipboard
- 📁 File Output — Save to file with
-o filename.txt - 🔍 Preview Mode —
--list-filesto see what will be exported
Web Interface
- ✓
.gitignore+ custom patterns (with live testing) - ✓ Quick-select by extension
- ✓ Hide unwanted files (images, logs, minified)
- ✓ File size limits + real-time stats
- 🔥 Global Hotkey —
Ctrl+Shift+Spacecopies from anywhere - 🌓 Dark/Light Mode — Automatically themed
- 📜 Path History — Recent projects saved
- 💾 Persistent Config — Settings survive restarts
Both Modes
- files.txt — File contents concatenated
- project_map.txt — Directory structure
- Smart Filtering — Respect gitignore, size limits, custom patterns
🔜 Coming Soon
- 🐙 GitHub Integration — Export directly from GitHub repositories
📖 How To Use
CLI Mode
# Basic usage
filestoai . # Export current directory
filestoai /path/to/project # Export specific directory
# With options
filestoai . -gi # Respect .gitignore
filestoai . --size 200 # Max file size limit (200 KB)
filestoai . -i "*.log,node_modules/" # Custom ignore patterns
filestoai . -o output.txt # Save to file
filestoai . --list-files # Preview files
# Combined
filestoai . -gi --size 150 -i "dist/,*.min.js" -v
# Start web interface
filestoai --server # Default port 5023
filestoai --server --port 8000 # Custom port
See CLI_USAGE.md for all CLI options and examples.
Web Interface
Start the server:
filestoai --server # Via CLI (recommended)
# OR
python app.py # Direct method
| Step | Action |
|---|---|
| 1 | Enter project path → Click Load |
| 2 | Configure filters & ignore patterns |
| 3 | Check files/folders in tree view |
| 4 | Click Generate Output or press Ctrl+Shift+Space |
| 5 | Copy or download results |
Pro Tip: Keep the app running in the background and use Ctrl+Shift+Space to instantly copy your last selection from any window.
🔧 Advanced
CLI Options
-gi, --gitignore # Respect .gitignore files
-s, --size KB # Max file size in KB (default: 100)
-i, --ignore PATTERNS # Custom ignore patterns (comma-separated)
-o, --output FILE # Save to file instead of clipboard
--no-copy # Don't copy to clipboard
--include-binary # Include binary files as placeholders
--project-map-only # Only generate project structure
--files-only # Only generate file contents
--list-files # List files without generating output
-v, --verbose # Enable verbose logging
Full CLI documentation: CLI_USAGE.md
Custom Ignore Patterns
Use .gitignore syntax for fine control:
node_modules/
*.log
__pycache__/
dist/**/*.map
CLI: filestoai . -i "node_modules/,*.log"
Web: Test patterns in-app before applying
API Endpoints
RESTful API for automation:
GET /api/browse— Directory structurePOST /api/select— File selectionPOST /api/generate— Generate outputPOST /api/global_trigger_generate_and_copy— Hotkey endpoint
See app.py for full docs.
Global Hotkey (Web Only)
Press anywhere with app running:
- Reads
filestoai_config.json - Generates output from last selected files
- Falls back to all files if none selected
- Copies to clipboard instantly
🛠️ Tech Stack
Flask • Bootstrap • jQuery • Python 3.8+
📦 Dependencies
Flask>=2.3.0
keyboard>=0.13.5
pyperclip>=1.8.2
requests>=2.31.0
📄 License
MIT License
🤝 Contributing
PRs welcome! Open an issue for major changes.
Made for developers who ship with AI ⚡
Metadata
Release files for filestoai 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| filestoai-1.0.0.tar.gz | 241.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| filestoai-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 264.3 kB
Release files / filestoai-1.0.0.tar.gz
| Download URL | filestoai-1.0.0.tar.gz |
|---|---|
| Size | 241.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb7441d7386697828eb19f1ed03d9e40a2f1e2b1501a017c3ab71dc394582666
|
|
BLAKE2b-256 checksum How to use checksums |
3ad4c7555716492667f12afa24f8944813784602219307a104c174bbbb5954c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Release files / filestoai-1.0.0-py3-none-any.whl
| Download URL | filestoai-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcaef67d6c0f832e7d6318ed1a5f7ffc4dc6486150d78f33cd2497dc638c0198
|
|
BLAKE2b-256 checksum How to use checksums |
be2c732f94cb6d1999fd55948218b9436450e0adedcdf4d6016572c2c4368272
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|