This is a tool to export data for AI processing into services like ChatGPT or Claude.ai. Just export, drag and drop to the context.
- Open Command Prompt (CMD)
- Type this command to check if Python is installed:
You should see something like
python --version
Python 3.10.x
-
Clone the repository:
git clone https://github.com/KindEmily/export-for-ai.git cd export-for-ai
-
Install in development mode:
python -m pip install -e .
-
Verify the installation:
python -m pip show export-for-ai
You should see the package information including the version number.
Try running:
export-for-ai --help
When a new version is released, follow these steps:
-
Go to the package directory:
cd export-for-ai
-
Get the latest code:
git pull origin main
-
Reinstall the package:
python -m pip install -e .
-
Verify the update:
python -m pip show export-for-ai
Check that the version number matches the latest version.
If you see an old version after updating:
- Close all Command Prompt windows
- Open a new Command Prompt
- Check the version again:
python -m pip show export-for-ai
If you have multiple Python versions installed and want to make sure you're using the right one:
- Find your Python installation:
where python
- Use the full path to Python:
C:\Users\YourUsername\AppData\Local\Programs\Python\Python310\python.exe -m pip install -e .
export-for-ai <directory_path>
Example:
export-for-ai C:\Users\username\MyProject
This will create a new directory named "exported-from-MyProject" containing:
- project.md with your project's structure and contents
- A comprehensive tree view of your project
- Properly formatted and minified code
The export-for-ai
tool allows you to export your project's structure and content while excluding specific files and directories using an .exportignore
file. This file functions similarly to a .gitignore
file, enabling you to define patterns for items you want to exclude from the export.
-
Create the
.exportignore
File: In the root directory of your project (the directory you will pass toexport-for-ai
), create a file named.exportignore
. -
Define Ignore Patterns: Inside
.exportignore
, list the files and directories you wish to exclude. Each pattern should be on a new line. You can use standard glob patterns (e.g.,*.log
to exclude all.log
files).Example
.exportignore
file:# Exclude lock files poetry.lock package-lock.json # Exclude compiled Python files __pycache__/ *.py[cod] # Exclude environment directories .env/ venv/ env/ # Exclude documentation and logs *.md *.txt *.log
-
Run
export-for-ai
: Execute the tool by pointing it to your project's root directory.export-for-ai /path/to/your/project
Below are some examples of how to specify patterns in your .exportignore
file to exclude certain files and directories:
To exclude a folder and all its contents, add the folder name followed by a slash:
node_modules/
This pattern will exclude the node_modules
directory and everything inside it from the export.
To exclude a specific file, simply write its relative path:
config/settings.py
This will exclude the settings.py
file located in the config
directory.
You can use glob patterns to match multiple files or directories:
-
Exclude all folders starting with
exported-from-
:exported-from-*/
This pattern matches any directory whose name starts with
exported-from-
, excluding them and their contents. -
Exclude all files ending with
.bak
:*.bak
This will exclude all files with the
.bak
extension. -
Exclude all log files in any directory:
**/*.log
This pattern excludes all
.log
files in any subdirectory.
-
Pattern Syntax: The patterns in
.exportignore
are relative to the root directory of your project. Use glob patterns for flexible matching.folder/
ignores a directory namedfolder
and all its contents.*.ext
ignores all files with the.ext
extension.!important.txt
includesimportant.txt
even if it was excluded by a previous pattern.
-
Verification: To ensure your patterns are working as intended, you can check the log output. The tool will inform you which files and directories are being excluded based on your
.exportignore
settings. -
Default Exclusions: If no
.exportignore
file is found,export-for-ai
uses a set of default patterns to exclude common unnecessary files (e.g.,__pycache__
,.git
directories).
By customizing the .exportignore
file, you can control precisely what content is included in your export, ensuring that only relevant files are processed and shared.