CodeCopy
CodeCopy is a Visual Studio Code extension designed to help you consolidate and analyze your codebase, with a focus on integration with Large Language Models (LLMs). This utility generates a comprehensive overview of your project, including file contents, structure (using tree formatting), and line numbers, making it easier for LLMs to provide insightful analysis and assistance.
Features
- Codebase Analysis: Analyzes your entire codebase quickly and efficiently.
- Directory Structure: Generates a tree-formatted directory structure for easy visualization.
- File Content Extraction: Extracts and consolidates the content of relevant files.
- Line Counting: Counts total lines of code across your project.
- Clipboard Integration: Automatically copies the analysis output to your clipboard.
- File Saving: Saves a copy of the analysis output as a file in a 'codecopy' subdirectory.
- Customizable Configuration: Allows you to specify which files and directories to include or exclude from the analysis.
- Logging: Logs codecopy activity to our backend to improve user experience. All data collected is anonymized and does not include any personally identifiable information.
Data Collection Notice
To improve your experience with CodeCopy, we collect anonymized data about the codebase structure and usage patterns. This data helps us analyze usage and enhance the functionality of the extension.
- Data Collected: Directory structure, file names, and code content. All data is anonymized.
- Purpose: To improve user experience and enhance extension functionality.
- Privacy: We do not collect any personally identifiable information. All data is stored securely and used solely for improving the extension.
- Opt-Out: If you prefer not to share this data, you can disable data collection in the extension settings.
By using CodeCopy, you consent to this data collection. For more details, please read our Privacy Policy.
Installation
- Open Visual Studio Code.
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
- Search for "CodeCopy".
- Click Install.
Alternatively, you can install it from the Visual Studio Code Marketplace.
Usage
- Open a project in VS Code.
- Click on the "Run CodeCopy" button in the status bar (bottom-right corner of VS Code).
- Alternatively, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and search for "Run CodeCopy".
- Wait for the analysis to complete.
- The results will be automatically copied to your clipboard and saved as a file in the 'codecopy' subdirectory of your project.
Configuration
CodeCopy uses a configuration file to customize which files and directories are included in the analysis.
Config File Creation and Location
The config file is automatically created when the extension is first activated in a workspace. It is stored at:
<workspace_root>/codecopy/config/codecopy-config.json
Where <workspace_root>
is the root directory of your currently open project in VS Code.
You'll see a notification when the config file is created. If you have multiple workspaces open, a config file will be created for each workspace.
Editing the Config File
You can edit the config file in two ways:
- Use the "Edit CodeCopy Configuration" command from the Command Palette for easy access.
- Navigate to the file location and edit it directly.
Config File Structure
{
"ignoredDirectories": ["node_modules", "build", "dist", ".git"],
"ignoredFiles": [".DS_Store", ".gitignore", "package-lock.json", "yarn.lock"],
"includedExtensions": [
".js",
".jsx",
".ts",
".tsx",
".py",
".css",
".html",
".md",
".json"
]
}
Modify these arrays to customize which files and directories are included in the CodeCopy analysis.
Resetting the Config File
If you need to reset the config file to its default values, you can delete the existing file and restart VS Code. The extension will create a new config file with default settings on the next activation.
Integration with LLMs
CodeCopy is particularly useful when working with Large Language Models for code analysis and generation. Here's how it can enhance your workflow:
- Comprehensive Codebase Overview: Provides a complete summary of your project structure and file contents, which can be easily fed into an LLM.
- Context for Code Generation: By pasting the CodeCopy output into an LLM prompt, you give the AI model full context of your project, enabling more accurate and relevant code suggestions.
- Efficient Code Review: LLMs can quickly analyze the entire codebase summary to identify patterns, potential issues, or areas for improvement.
- Streamlined Documentation: Use the codebase summary as a basis for generating comprehensive documentation or explaining your project structure to team members or AI assistants.
Requirements
- Visual Studio Code version 1.60.0 or higher
Release Notes
1.0.0
Initial release of CodeCopy
1.1.0
- Added automatic config file creation
- Improved error handling and user notifications
1.1.1
- Added automatic config file creation
- Improved error handling and user notifications
- Added logging to improve user experience by analyzing how the extension is used
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This extension is released under the MIT License.
Privacy Policy
Data Collection and Usage
We collect anonymized data to improve the functionality and user experience of CodeCopy. The types of data collected include:
- Directory Structure: Information about the structure of directories within your project.
- File Names and Content: The names and content of files within your project. All content is anonymized.
- Usage Patterns: How the extension is used to identify areas for improvement.
Data Protection
- Anonymization: All data collected is anonymized to ensure privacy.
- Secure Storage: Data is stored securely and is only accessible by authorized personnel.
- No Personally Identifiable Information (PII): We do not collect or store any PII.
User Control
- Opt-Out: Users can disable data collection at any time by editing the
codecopy-config.json
file in the codecopy/config
directory of the extension configuration.
By using CodeCopy, you consent to the collection and use of anonymized data as described in this privacy policy. For any questions or concerns, please contact us.
Enjoy using CodeCopy!