Copy AI
Introduction
CopyAI enhances your productivity by enabling you to quickly copy the content of all open files, a specific file, or even the entire workspace into your clipboard, making it easier to interact with Language Models (LLMs).
Features
- One-Click Copy: With just one click, CopyAI copies the content of all open files, a specific file, or the entire workspace.
- Minification & Comment Removal: Automatically removes unnecessary whitespace, newlines, and comments to condense your code, optimizing token consumption.
- Template System: Create and manage reusable templates with custom preprompts and postprompts to enhance your interaction with LLMs.
- Context-Based Copying: Define specific contexts in a configuration file to copy only relevant files matching certain patterns.
Requirements
CopyAI requires Visual Studio Code version 1.67.0 or newer due to its reliance on the Tab API for accessing open files.
Using Copy Context Feature
The Copy Context feature allows you to define specific groups of files (contexts) that you want to copy together, making it easier to provide relevant code to LLMs.
Setting up contexts
- Create a
copyai.json
file in the root of your workspace with the following structure:
{
"contexts": [
{
"name": "Frontend Components",
"description": "React components and related utilities",
"files": [
"src/components/**/*.jsx",
"src/utils/component-helpers.js"
]
},
{
"name": "API Layer",
"description": "Backend API endpoints and services",
"files": [
"src/api/**/*.js",
"src/services/**/*.js"
]
}
]
}
- Each context requires:
name
: A unique identifier for the context
description
: (Optional) A brief description of what this context contains
files
: An array of glob patterns matching the files you want to include
Using the feature
- Once you've set up your
copyai.json
file, a "Copy context" button will appear in the status bar.
- Click the button to see a list of your defined contexts.
- Select a context from the dropdown menu.
- Optionally select a template to apply to the copied content.
- The content of all files matching the patterns in your selected context will be copied to your clipboard, ready to paste into your LLM conversation.
Thank you for using CopyAI!