Code Combiner is a Unity Editor tool designed to combine and copy code files to the clipboard. It allows you to select multiple code files within your project, merge their contents, and copy the merged content to the clipboard for easy use—especially handy for pasting into tools like ChatGPT and other LLMs!
CodeCombinerDemo.mp4
- Select multiple code files from your Unity project.
- Combine selected files into a single content.
- Copy the combined content to the clipboard with a single click.
- Adds the file names as comments at the top of each merged file.
To install the Code Combiner tool using Unity Package Manager, follow these steps:
-
Open your Unity project.
-
In the menu bar, go to
Window > Package Manager
. -
Click the
+
button in the top left corner of the Package Manager window. -
Select
Add package from git URL...
. -
Enter the following URL and click
Add
:https://github.com/cihanozcelik/CodeCombiner.git
Alternatively, you can add the package directly to your manifest.json
file located in the Packages
folder of your Unity project:
{
"dependencies": {
"com.nopnag.codecombiner": "https://github.com/cihanozcelik/CodeCombiner.git"
}
}
- After installing the package, open the Code Combiner tool by going to
Tools > CodeCombiner
in the Unity menu bar. - The Code Combiner window will open, displaying a list of folders and files in your project.
- Navigate through the folders and select the code files you want to combine by checking the boxes next to the file names.
- The total number of selected files and lines will be displayed at the bottom of the window.
- Click the
Combine and Copy to Clipboard
button to merge the selected files and copy the combined content to the clipboard. - Paste the combined content wherever you need it.
This tool is not optimized for very large codebases yet. Besides, ChatGPT doesn't accept more than around 4500 lines (100 characters per line cap) in my tests.
This project is licensed under the MIT License - see the LICENSE file for details.
Cihan Özçelik
For more information, visit the repository.