|
| 1 | +<p align="center">English | <a href="README_zh.md">中文</a><p> |
| 2 | + |
| 3 | +# AI Code Context Helper |
| 4 | + |
| 5 | +## 📝 Introduction |
| 6 | + |
| 7 | +AI Code Context Helper is a lightweight desktop application designed for developers collaborating with AI assistants. It provides a visual representation of project structures and enables quick, selective export of file paths and code content to the clipboard, streamlining code communication with ChatGPT, Claude, and other AI assistants. |
| 8 | + |
| 9 | +As a supplementary tool, it doesn't aim to replace existing editors or IDEs but focuses specifically on solving the code context transfer challenge in AI programming collaboration. Compared to integrated AI code editors, it offers advantages in simplicity, low learning curve, independence from specific AI services, and minimal resource usage, integrating seamlessly with various development environments. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +<!-- 👆 Main interface screenshot --> |
| 14 | + |
| 15 | +## ✨ Key Features |
| 16 | + |
| 17 | +### Intelligent File Management |
| 18 | +- **Directory Tree Visualization**: Display project file structure in tree view |
| 19 | +- **File Type Recognition**: Automatically detect text file encodings and distinguish between text and binary files |
| 20 | +- **Advanced Filtering**: Support for regex filtering and directory depth limitation for handling large projects |
| 21 | + |
| 22 | +### Flexible Selection and Export |
| 23 | +- **Multi-selection Support**: Select individual files, multiple files, or entire directories with subdirectories |
| 24 | +- **Batch Export**: Export paths, code, or both for selected content |
| 25 | +- **Context Menu**: Multiple copy options for different development scenarios |
| 26 | + |
| 27 | +### Customization and Ease of Use |
| 28 | +- **Multilingual Support**: Switch between English and Chinese interfaces |
| 29 | +- **Output Format Customization**: Configure prefix and suffix formats for code and paths |
| 30 | +- **Lightweight Implementation**: Low resource consumption, quick startup, seamlessly integrates with existing development workflows |
| 31 | + |
| 32 | +## 💡 Usage Tips |
| 33 | + |
| 34 | +### Best Practice: Combining Project Structure with Code Content |
| 35 | + |
| 36 | +For better AI comprehension of your project, follow these steps: |
| 37 | + |
| 38 | +1. **First Share Project Structure**: |
| 39 | + - Select the root directory and use the "Copy Tree" function |
| 40 | + - Paste the directory tree to the AI to provide overall project architecture |
| 41 | + |
| 42 | +2. **Then Share Key Files**: |
| 43 | + - Select relevant files based on your requirements (multiple files or directories) |
| 44 | + - Use "Copy Path and Code" to provide all necessary files at once |
| 45 | + |
| 46 | +3. **Reference File Paths in Requirements**: |
| 47 | + - Example: "Please modify the `authenticate` method in `models/user.py` to add two-factor authentication" |
| 48 | + - Clear path references help AI locate relevant code accurately |
| 49 | + |
| 50 | +### Module-Level Modifications |
| 51 | + |
| 52 | +When modifying an entire functional module: |
| 53 | + |
| 54 | +1. Select the module directory (e.g., `authentication/` folder) |
| 55 | +2. Right-click and choose "Copy Path and Code" to include all files in the directory |
| 56 | +3. Describe to the AI: "Please analyze this authentication module and suggest improvements" |
| 57 | + |
| 58 | +> For codebases under 5,000 lines, you can copy all code directly to AI assistants like Claude or ChatGPT for code review and get complete modified code. This is essentially pair programming with AI - efficiency improves with your coding and requirements description skills. |
| 59 | +
|
| 60 | +## 📸 Screenshots |
| 61 | + |
| 62 | +### Context Menu |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +<!-- 👆 Right-click menu screenshot --> |
| 67 | + |
| 68 | +## 🔧 Installation and Usage |
| 69 | + |
| 70 | +### Download and Install |
| 71 | + |
| 72 | +1. Download the latest version from the [Releases page](https://github.com/sansan0/ai-code-context-helper/releases) |
| 73 | +2. Extract the files to any location |
| 74 | +3. Run `AI Code Context Helper.exe` to launch the application |
| 75 | + |
| 76 | +### How to Use |
| 77 | + |
| 78 | +1. Click "Browse..." to select your project root directory |
| 79 | +2. Check the files or folders you want to share in the directory tree |
| 80 | +3. Right-click and select "Copy Path and Code" (or other copy options) |
| 81 | +4. Paste the copied content into your AI assistant (ChatGPT, Claude, etc.) |
| 82 | +5. Ask questions or request code modifications based on the provided context |
| 83 | + |
| 84 | +## ⚙️ Configuration Options |
| 85 | + |
| 86 | +### Interface Options |
| 87 | + |
| 88 | +- **Show Hidden Files**: Toggle display of hidden files and folders |
| 89 | +- **Show Files/Show Folders**: Control what appears in the tree view |
| 90 | +- **Preserve Tree State**: Maintain expansion/collapse state when resetting |
| 91 | +- **Use Relative Path**: Use paths relative to the root directory instead of absolute paths |
| 92 | +- **Max Depth**: Limit the display depth of the directory tree |
| 93 | +- **File Filter**: Filter displayed files using regular expressions |
| 94 | + |
| 95 | +## 🛠️ Building from Source |
| 96 | + |
| 97 | +### Requirements |
| 98 | + |
| 99 | +- Python 3.9+ |
| 100 | +- Poetry package manager |
| 101 | + |
| 102 | +### Install Dependencies |
| 103 | + |
| 104 | +```bash |
| 105 | +git clone https://github.com/sansan0/ai-code-context-helper.git |
| 106 | +cd ai-code-context-helper |
| 107 | +poetry install |
| 108 | +``` |
| 109 | + |
| 110 | +### Build Executable |
| 111 | + |
| 112 | +```bash |
| 113 | +poetry run python -m cx_Freeze build |
| 114 | +``` |
| 115 | + |
| 116 | +## 📄 License |
| 117 | + |
| 118 | +This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details. |
0 commit comments