Efficiently prepare and copy codebases to LLMs. Copy Me Quick intelligently optimizes your code, minimizing token usage while preserving context for superior AI interactions.
Try it now: copymequick.vercel.app
Copy Me Quick is a web application designed to streamline the process of sharing code with Large Language Models (LLMs). It tackles the challenge of LLM context window limitations by intelligently processing and optimizing your codebase. This ensures that you can effectively leverage the power of AI for code analysis, understanding, and generation, even with large projects.
LLMs have a limited "context window," typically measured in tokens. Feeding them a raw codebase often leads to:
- Input Truncation: The LLM only sees a fraction of your code, resulting in incomplete analysis.
- Exorbitant Costs: Processing more tokens can be significantly more expensive.
- Inefficient Use of Tokens: Non-essential parts of the code waste valuable tokens.
Copy Me Quick solves this by:
- Minifying code: Reducing code size without altering functionality.
- Filtering irrelevant files: Excluding non-essential directories like
node_modulesor build artifacts. - Providing selective copying: Allowing you to choose specific files or folders to focus on.
- Estimating token usage: Giving you a clear picture of your context window consumption.
-
📁 Smart Project Management:
- Interactive File Tree: Easily navigate and select files/folders with a visual, hierarchical representation.
- Framework-Aware Presets: Automatically exclude irrelevant files and folders for popular frameworks like Next.js, React, Vue, Angular, and more.
- Customizable Filters: Fine-tune your selection by adding your own include/exclude patterns.
-
🔢 Token Optimization:
- Real-time Token Estimation: Accurately predict token usage using
tiktoken. - Token Usage Visualization: A progress bar dynamically shows your token consumption relative to the LLM's limit.
- Minification: Reduce code size (and token count) by removing whitespace, comments, and shortening identifiers where possible.
- Real-time Token Estimation: Accurately predict token usage using
-
🎨 Modern & User-Friendly Interface:
- Clean Design: Built with reusable Radix UI components for a consistent and accessible experience.
- Intuitive Interactions: Effortlessly select, include, or exclude files and folders.
- Helpful Feedback: Clear progress indicators, informative tooltips, and error messages guide you.
- Responsive Layout: Adapts seamlessly to different screen sizes thanks to Tailwind CSS.
-
🔄 Advanced Features:
- Backup & Restore: Save and load multiple project states to quickly switch between different analysis scenarios.
- Export/Import: Share your project configurations as JSON files for collaboration or reproducibility.
- GitHub Integration: Connect to your GitHub account to browse and select files directly from your repositories.
- Line Count Display: See the number of lines in each file to help prioritize which files to include.
- AI-Powered File Suggestion: Use AI to suggest which files are most relevant for your context.
-
🔗 GitHub Integration:
- OAuth Authentication: Securely connect to your GitHub account.
- Repository Browser: Browse your repositories and their branches.
- Smart File Fetching: View and select files directly from your GitHub repositories.
- Line Count Analytics: Displays line counts for each file to help you prioritize.
- Batch Content Loading: Efficiently fetch file contents with progress indicators.
-
💪 User Experience Improvements:
- Persistent Tree Expansion: Tree structure maintains its expanded state when selecting files.
- Improved File Filtering: Better performance when searching through large codebases.
- Enhanced File Selection: Select all files, visible files, or use AI to suggest important files.
- Visual Indicators: Files with high line counts are highlighted to identify potential token-heavy files.
-
🔧 Code Refactoring:
- Improved maintainability of the core
FileSelectorcomponent by extracting theFileTreeNodecomponent (FileTreeNode.tsx), utility functions (fileSelectorUtils.ts), and stateful logic into custom React Hooks (useTokenCalculator.ts,useClipboardCopy.ts).
- Improved maintainability of the core
- Next.js 14: React framework for server-side rendering and static site generation.
- React 18: JavaScript library for building user interfaces.
- TypeScript: Adds static typing to JavaScript for better code maintainability.
- Tailwind CSS 3.4: Utility-first CSS framework for rapid UI development.
- Radix UI: Accessible and unstyled component library.
- react-dropzone: Simple React hook for file drops.
- JSZip: Create, read, and edit zip archives.
- tiktoken: Byte pair encoding tokenization library used by OpenAI.
- Vercel Analytics: Track website traffic and performance.
- GitHub API: Integration with GitHub repositories.
- Deployment: Vercel
-
Clone the repository:
git clone https://github.com/MarcusNeufeldt/copy-me-quick.git cd copy-me-quick -
Install dependencies:
npm install # Or yarn install or pnpm install
If your GitHub OAuth app is waiting for organization approval, local development can use your GitHub CLI token instead:
gh auth login
GITHUB_USE_CLI_TOKEN=1 npm run devOn Windows PowerShell:
$env:GITHUB_USE_CLI_TOKEN="1"
npm run devThis is local-only. The server routes ignore GITHUB_USE_CLI_TOKEN in production and on Vercel.
-
Start the development server:
npm run dev # Or yarn dev or pnpm dev -
Open your browser:
Visit
http://localhost:3000
-
Create a production build:
npm run build # Or yarn build or pnpm build -
Start the production server:
npm start # or yarn start or pnpm start
-
Select a Project Type:
- Choose a preset based on your project's framework (Next.js, React, Vue, etc.).
- Select "None" to manually configure filters.
-
Choose Your Source:
- Local Project: Click the "Choose Project Folder" button and select the root directory of your codebase.
- GitHub Repository: Connect to GitHub and select a repository and branch to browse.
-
Fine-Tune Your Selection:
- Use the interactive file tree to include or exclude specific files or folders.
- Expand and collapse folders to navigate the project structure.
- Use file search to quickly find specific files or file types.
- Look at line counts to identify large files that might consume more tokens.
-
Enable Minification (Optional):
- Toggle the "Minify" option to reduce the token count of your code.
-
Copy to Clipboard:
- Click the "Copy" button to copy the processed codebase to your clipboard.
- The copied content will include:
- A structured representation of your project's file tree.
- The minified (if enabled) or original source code of the selected files.
-
Paste into Your LLM:
- Paste the copied content into your favorite LLM interface (e.g., ChatGPT, Claude).
-
Craft Your Prompt:
- Provide clear instructions to the LLM, referencing the copied project structure and code.
- Example:
Here's my project structure:
[Paste Project Structure]
Here's the code for selected files:
[Paste Selected Files]
My goal is to: [Describe your task, e.g., "Refactor this component to use hooks," "Find potential security vulnerabilities," "Generate documentation for this API."]
next.config.js: Configuration for Next.js (server-side rendering, etc.).tailwind.config.ts: Configuration for Tailwind CSS (styling, theming).tsconfig.json: Configuration for TypeScript (type checking, compiler options).components.json: Configuration for UI components (Shadcn/Radix).
This project is licensed under the MIT License.