Skip to main content

Export your codebase for AI consumption - CLI and Web Interface

Project description

FilesToAI

Instantly export your codebase to AI. Smart filtering, one-click copy, global hotkey.

Now available as both a CLI tool and Web Interface!

FilesToAI Screenshot


🚀 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-gi for gitignore, --size for limits, -i for custom patterns
  • 📋 Auto Copy — Output goes straight to clipboard
  • 📁 File Output — Save to file with -o filename.txt
  • 🔍 Preview Mode--list-files to 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 HotkeyCtrl+Shift+Space copies 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 structure
  • POST /api/select — File selection
  • POST /api/generate — Generate output
  • POST /api/global_trigger_generate_and_copy — Hotkey endpoint

See app.py for full docs.

Global Hotkey (Web Only)

Press anywhere with app running:

  1. Reads filestoai_config.json
  2. Generates output from last selected files
  3. Falls back to all files if none selected
  4. Copies to clipboard instantly

🛠️ Tech Stack

FlaskBootstrapjQueryPython 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

⭐ Star this repo🐛 Report Bug💡 Request Feature

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filestoai-1.0.0.tar.gz (241.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filestoai-1.0.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file filestoai-1.0.0.tar.gz.

File metadata

  • Download URL: filestoai-1.0.0.tar.gz
  • Upload date:
  • Size: 241.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for filestoai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bb7441d7386697828eb19f1ed03d9e40a2f1e2b1501a017c3ab71dc394582666
MD5 4ab034fcc0719c80a27dde02117eef16
BLAKE2b-256 3ad4c7555716492667f12afa24f8944813784602219307a104c174bbbb5954c4

See more details on using hashes here.

File details

Details for the file filestoai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: filestoai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for filestoai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcaef67d6c0f832e7d6318ed1a5f7ffc4dc6486150d78f33cd2497dc638c0198
MD5 59370ca18515e0d7a86c87467603144a
BLAKE2b-256 be2c732f94cb6d1999fd55948218b9436450e0adedcdf4d6016572c2c4368272

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page