A modern file viewer application for developers to easily navigate, search, and copy code from repositories. Ideal for pasting into ChatGPT or your LLM of choice. Built with Electron, React, and TypeScript.
- File Tree Navigation: Browse directories and files with an expandable tree view
- Token Counting: View the approximate token count for each file (useful for LLM context limits)
- Search Capabilities: Quickly find files by name or content
- Selection Management: Select multiple files and copy their contents together
- Sorting Options: Sort files by name, size, or token count
- Dark Mode: Toggle between light and dark themes for comfortable viewing in any environment
- Binary File Detection: Automatic detection and exclusion of binary files
- Smart File Exclusion: Automatically excludes common files like package-lock.json, binary files, and more by default
Download the latest version from the releases page.
- Clone the repository:
git clone https://github.com/kleneway/pastemax.git
cd pastemax
- Install dependencies:
npm install
- Build the app:
npm run build-electron
npm run dist
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository
- Install dependencies:
npm install
To run the application in development mode:
# Start the Vite dev server
npm run dev
# In a separate terminal, start Electron
npm run dev:electron
To build the application for production:
# Build the React app with Vite and update paths for Electron
npm run build-electron
# Create platform-specific distributables
npm run dist
src/
- React application source codecomponents/
- React componentstypes/
- TypeScript type definitionsstyles/
- CSS styles
main.js
- Electron main processbuild.js
- Build script for productionexcluded-files.js
- Configuration for files to exclude by defaultdocs/
- Documentationexcluded-files.md
- Documentation for the file exclusion feature
- Electron - Desktop application framework
- React - UI library
- TypeScript - Type safety
- Vite - Build tool and development server
- tiktoken - Token counting for LLM context estimation
- ignore - .gitignore-style pattern matching for file exclusions
You can customize which files are excluded by default by editing the excluded-files.js
file. See the excluded files documentation for more details.
If you encounter this error when running the packaged application:
Error: Cannot find module 'ignore'
Require stack:
- /Applications/PasteMax.app/Contents/Resources/app.asar/main.js
This is caused by dependencies not being properly included in the package. To fix it:
-
Run the dependency fixer script:
node fix-dependencies.js
-
Rebuild the application:
npm run build-electron && npm run dist
-
Install the new version
If you encounter other issues, please report them on GitHub.
MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request