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.
PasteMax is a simple desktop app built for developers using AI coding assistants. It makes sharing your code with LLMs easy, thanks to a smart file explorer with token counting, file filtering, quick copy, and a previewer. Select the files you need, skip binaries and junk, and get clean, formatted snippets ready for your LLM.
- 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
- File Previewer: View file contents in a dedicated preview pane
- 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
- File Change Watcher: Automatically updates the files whenever changes are detected
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 package
Note: If you encounter issues with npm run package
, you can try the platform-specific command:
npm run package:win
npm run package:mac
npm run package:linux
After successful build, you'll find the executable files inside the release-builds
directory:
Windows:
PasteMax Setup 1.0.0.exe
- Installer versionPasteMax 1.0.0.exe
- Portable version
Mac:
PasteMax 1.0.0.dmg
- Installer versionPasteMax 1.0.0.zip
- Portable version
Linx:
PasteMax 1.0.0.deb
- Installer version (Deb package)PasteMax 1.0.0.rpm
- Installer version (RPM package)PasteMax 1.0.0.AppImage
- Portable version
- Node.js (v14 or higher)
- npm or yarn
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 package
src/
- React application source codecomponents/
- React componentscontext/
- React context providershooks/
- Custom React hookstypes/
- TypeScript type definitionsutils/
- Utility functionsstyles/
- CSS stylesassets/
- Static assets like images
electron/
- Electron-related filesmain.js
- Electron main processpreload.js
- Preload script for secure IPCrenderer.js
- Renderer process utilitiesbuild.js
- Build script for productionexcluded-files.js
- Configuration for files to exclude by default
public/
- Public assets (favicon, etc.)scripts/
- Utility scripts for building and testingdocs/
- Documentation
- 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
- chokidar - File Watcher
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 package
-
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