|
1 | | -<p align="center">English | <a href="README_zh.md">中文</a><p> |
| 1 | +<p align="center"><a href="README_en.md">English</a> | 中文<p> |
2 | 2 |
|
3 | | -## 📝 Introduction |
| 3 | +## 📝 简介 |
4 | 4 |
|
5 | | -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. |
| 5 | +AI Code Context Helper 是一款轻量级桌面应用,为所有需要理解、学习和开发代码的人设计。无论您是编程初学者、职业开发者还是教育工作者,它都能帮助您轻松提取代码上下文,与 AI 助手高效交流。通过可视化的项目结构展示和一键代码导出功能,它让理解复杂代码、获取 AI 编程建议和进行代码审查变得前所未有的简单。无论您是在学习理解代码、开发新功能,还是寻求代码改进建议。这个简单而强大的工具帮助初学者加速学习曲线,同时为专业开发者提高工作效率。 |
6 | 6 |
|
7 | 7 | <p align="center"> |
8 | | - <img src="./_images/app_overview.png" width="60%" alt="Application Overview"> |
| 8 | + <img src="./_images/app.gif" width="50%" alt="动图"> |
9 | 9 | </p> |
10 | 10 |
|
11 | | -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. |
| 11 | +## 💡 核心使用场景 |
12 | 12 |
|
13 | | -<p align="center"> |
14 | | - <img src="./_images/app.gif" width="60%" alt="gif"> |
15 | | -</p> |
| 13 | +### 1. 代码学习与分析 |
| 14 | + |
| 15 | +轻松让 AI 帮你理解复杂代码库的工作原理: |
16 | 16 |
|
17 | | -## ✨ Key Features |
| 17 | +1. **选择目标项目目录**:打开你想分析的项目 |
| 18 | +2. **复制完整项目结构**:使用"复制目录树"功能,让 AI 先了解整体架构 |
| 19 | +3. **提供核心代码文件**:选择关键文件,使用"复制路径与代码"一次性提供所有代码 |
| 20 | +4. **询问 AI 分析**:请求 AI 分析代码结构、解释工作原理或提供学习路径 |
18 | 21 |
|
19 | | -### Intelligent File Management |
| 22 | +> 以往理解一个复杂开源项目可能需要数天,现在可以先让 AI 提供整体概览和关键部分解析,大幅提升学习效率! |
20 | 23 |
|
21 | | -- **Directory Tree Visualization**: Display project file structure in tree view |
22 | | -- **File Type Recognition**: Automatically detect text file encodings and distinguish between text and binary files |
23 | | -- **Advanced Filtering**: Support for regex filtering, .gitignore rules, and directory depth limitation for handling large projects |
| 24 | +### 2. 代码修改与开发 |
24 | 25 |
|
25 | | -### Flexible Selection and Export |
| 26 | +快速获取 AI 编程辅助而不破坏现有工作流: |
26 | 27 |
|
27 | | -- **Multi-selection Support**: Select individual files, multiple files, or entire directories with subdirectories |
28 | | -- **Mouse Selection Mode**: Drag to select/deselect multiple files at once |
29 | | -- **Batch Export**: Export paths, code, or both for selected content |
30 | | -- **Context Menu**: Multiple copy options for different development scenarios |
| 28 | +1. **定位需要修改的模块**:通过可视化树形结构找到相关文件 |
| 29 | +2. **导出相关代码上下文**:同时选择相关的多个文件(如模型、控制器和视图) |
| 30 | +3. **描述修改需求**:向 AI 清晰描述你想实现的功能或修复的问题 |
| 31 | +4. **获取完整实现方案**:AI 会基于完整上下文提供准确的代码修改建议 |
31 | 32 |
|
32 | | -### Integration and Accessibility |
| 33 | +> 相比单文件编辑器集成,这种方式能提供更完整的项目上下文,产生更准确、更具可操作性的代码建议 |
33 | 34 |
|
34 | | -- **System Tray Integration**: Minimize to system tray to keep the tool readily available without cluttering your desktop |
35 | | -- **Global Hotkey**: Press Ctrl+2 anywhere to show/hide the application window |
36 | | -- **Always On Top Option**: Keep the window visible while working with other applications |
37 | | -- **File System Integration**: Open folders in Explorer or launch terminal directly from the context menu |
| 35 | +### 3. 代码审查与重构 |
38 | 36 |
|
39 | | -### Customization and Ease of Use |
| 37 | +让 AI 成为你的代码审查助手: |
40 | 38 |
|
41 | | -- **Multilingual Support**: Switch between English and Chinese interfaces |
42 | | -- **Output Format Customization**: Configure prefix and suffix formats for code and paths |
43 | | -- **Advanced Settings Toggle**: Show/hide advanced options to maximize space for directory tree |
44 | | -- **Lightweight Implementation**: Low resource consumption, quick startup, seamlessly integrates with existing development workflows |
| 39 | +1. **选择待审查模块**:框选整个功能模块的所有文件 |
| 40 | +2. **一键复制所有相关代码**:包含完整的实现细节和文件路径 |
| 41 | +3. **请求 AI 审查**:获取关于代码质量、潜在问题和改进建议的反馈 |
| 42 | +4. **实施重构建议**:应用 AI 提供的优化方案 |
45 | 43 |
|
46 | | -## 🔑 Shortcuts and Special Features |
| 44 | +> 如果代码总量在 5000 行以内,可以一次性复制给主流 AI 助手进行全面分析,比传统代码审查更快、更全面 |
47 | 45 |
|
48 | | -- **Ctrl+C**: Copy path and code of selected files |
49 | | -- **Ctrl+B**: Copy filename of selected files |
50 | | -- **Ctrl+F**: Open selected folder in file explorer |
51 | | -- **Ctrl+T**: Open command line in selected folder |
52 | | -- **Ctrl+2**: Global hotkey to show/hide the application from anywhere |
53 | | -- **Tree State Preservation**: Application remembers the expanded state of each project directory between sessions |
| 46 | +### 本地运行,保障隐私 |
54 | 47 |
|
55 | | -## 💡 Usage Tips |
| 48 | +- **完全离线工作**:软件在本地运行,不需要联网,不会上传任何代码 |
| 49 | +- **隐私保护**:您的代码仅在您主动复制时才会离开您的电脑 |
| 50 | +- **与任何 AI 助手兼容**:您可以自由选择使用哪种 AI 服务,完全由您控制代码分享范围 |
| 51 | + |
| 52 | +<p align="center"> |
| 53 | + <img src="./_images/app_overview.png" width="50%" alt="应用概览截图"> |
| 54 | +</p> |
56 | 55 |
|
57 | | -### Best Practice: Combining Project Structure with Code Content |
| 56 | +## ✨ 主要特性 |
58 | 57 |
|
59 | | -For better AI comprehension of your project, follow these steps: |
| 58 | +### 智能文件管理 |
60 | 59 |
|
61 | | -1. **First Share Project Structure**: |
| 60 | +- **目录树可视化**:树形视图显示项目文件结构 |
| 61 | +- **文件类型识别**:自动检测文本文件编码,区分文本与二进制文件 |
| 62 | +- **高级筛选**:支持正则表达式过滤、.gitignore 规则应用和目录深度限制,便于处理大型项目 |
62 | 63 |
|
63 | | - - Select the root directory and use the "Copy Tree" function |
64 | | - - Paste the directory tree to the AI to provide overall project architecture |
| 64 | +### 灵活选择与导出 |
65 | 65 |
|
66 | | -2. **Then Share Key Files**: |
| 66 | +- **多选支持**:可选择单个文件、多个文件或整个目录及其子目录 |
| 67 | +- **鼠标框选模式**:通过拖动鼠标一次性选择/取消选择多个文件 |
| 68 | +- **批量导出**:支持导出选中内容的路径、代码或两者兼有 |
| 69 | +- **上下文菜单**:提供多种复制选项,适用于不同开发场景 |
67 | 70 |
|
68 | | - - Select relevant files based on your requirements (multiple files or directories) |
69 | | - - Use "Copy Path and Code" to provide all necessary files at once |
| 71 | +### 集成与便捷性 |
70 | 72 |
|
71 | | -3. **Reference File Paths in Requirements**: |
72 | | - - Example: "Please modify the `authenticate` method in `models/user.py` to add two-factor authentication" |
73 | | - - Clear path references help AI locate relevant code accurately |
| 73 | +- **系统托盘集成**:最小化到系统托盘,随时可用但不占用桌面空间 |
| 74 | +- **全局热键**:在任何应用中按下 Ctrl+2 快捷键即可显示/隐藏应用窗口 |
| 75 | +- **窗口置顶选项**:使窗口保持在其他应用之上,便于操作 |
| 76 | +- **文件系统集成**:直接从上下文菜单在资源管理器中打开文件夹或启动命令行终端 |
74 | 77 |
|
75 | | -### Module-Level Modifications |
| 78 | +### 定制化与易用性 |
76 | 79 |
|
77 | | -When modifying an entire functional module: |
| 80 | +- **多语言支持**:支持中英文切换 |
| 81 | +- **输出格式定制**:可配置代码和路径的前缀后缀格式 |
| 82 | +- **高级选项切换**:可隐藏/显示高级设置,最大化目录树显示空间 |
| 83 | +- **轻量实现**:低资源占用,启动迅速,无缝融入现有开发工作流 |
78 | 84 |
|
79 | | -1. Select the module directory (e.g., `authentication/` folder) |
80 | | -2. Right-click and choose "Copy Path and Code" to include all files in the directory |
81 | | -3. Describe to the AI: "Please analyze this authentication module and suggest improvements" |
| 85 | +## 🔑 快捷键与特殊功能 |
82 | 86 |
|
83 | | -> 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. |
| 87 | +- **Ctrl+C**:复制选中文件的路径和代码 |
| 88 | +- **Ctrl+B**:复制选中文件的文件名 |
| 89 | +- **Ctrl+F**:在资源管理器中打开选中文件夹 |
| 90 | +- **Ctrl+T**:在选中文件夹中打开命令行终端 |
| 91 | +- **Ctrl+2**:全局热键,从任何地方显示/隐藏应用程序 |
| 92 | +- **树状态保持**:应用程序会在会话之间记住每个项目目录的展开状态 |
84 | 93 |
|
85 | | -## 📸 Screenshots |
| 94 | +## 📸 应用截图 |
86 | 95 |
|
87 | | -### Context Menu |
| 96 | +### 目录树菜单 |
88 | 97 |
|
89 | 98 | <p align="center"> |
90 | | - <img src="./_images/context_menu.png" width="60%" alt="Right-click Menu"> |
| 99 | + <img src="./_images/context_menu.png" width="60%" alt="右键菜单"> |
91 | 100 | </p> |
92 | 101 |
|
93 | | -## 🔧 Installation and Usage |
| 102 | +## 🔧 安装与使用 |
94 | 103 |
|
95 | | -### Download and Install |
| 104 | +### 下载安装 |
96 | 105 |
|
97 | | -1. Download the latest version from the [Releases page](https://github.com/sansan0/ai-code-context-helper/releases) |
98 | | -2. Extract the files to any location |
99 | | -3. Run `AI Code Context Helper.exe` to launch the application |
| 106 | +1. 从[Releases 页面](https://github.com/sansan0/ai-code-context-helper/releases)下载最新版本 |
| 107 | +2. 解压缩下载的文件到任意位置 |
| 108 | +3. 运行`AI Code Context Helper.exe`启动应用 |
100 | 109 |
|
101 | | -### How to Use |
| 110 | +### 使用方法 |
102 | 111 |
|
103 | | -1. Click "Browse..." to select your project root directory |
104 | | -2. Check the files or folders you want to share in the directory tree |
105 | | -3. Right-click and select "Copy Path and Code" (or other copy options) |
106 | | -4. Paste the copied content into your AI assistant (ChatGPT, Claude, etc.) |
107 | | -5. Ask questions or request code modifications based on the provided context |
| 112 | +1. 点击"浏览..."按钮选择项目根目录 |
| 113 | +2. 在目录树中勾选需要分享的文件或文件夹 |
| 114 | +3. 右键点击选择"复制路径与代码"(或使用其他复制选项) |
| 115 | +4. 将复制的内容粘贴到 AI 助手(如 ChatGPT、Claude 等)对话中 |
| 116 | +5. 根据复制的代码上下文,向 AI 提问或请求代码修改建议 |
108 | 117 |
|
109 | | -## ⚙️ Configuration Options |
| 118 | +## ⚙️ 配置选项 |
110 | 119 |
|
111 | | -### Interface Options |
| 120 | +### 界面选项 |
112 | 121 |
|
113 | | -- **Show Hidden Files**: Toggle display of hidden files and folders |
114 | | -- **Show Files/Show Folders**: Control what appears in the tree view |
115 | | -- **Use Relative Path**: Use paths relative to the root directory instead of absolute paths |
116 | | -- **Filter by .gitignore**: Apply rules from project's .gitignore file |
117 | | -- **Mouse Selection Mode**: Enable drag selection for easier batch operations |
118 | | -- **Max Depth**: Limit the display depth of the directory tree |
119 | | -- **File Filter**: Filter displayed files using regular expressions |
120 | | -- **Keep on Top**: Keep the window above all other applications |
121 | | -- **Advanced Options Toggle**: Hide/show advanced settings to maximize tree display space |
| 122 | +- **显示隐藏文件**:是否显示隐藏文件和文件夹 |
| 123 | +- **显示文件/显示文件夹**:控制树视图中的显示内容 |
| 124 | +- **使用相对路径**:复制时使用相对路径而非绝对路径 |
| 125 | +- **根据.gitignore 过滤**:应用项目.gitignore 文件中的规则 |
| 126 | +- **鼠标框选模式**:启用拖动选择功能,方便批量操作 |
| 127 | +- **最大深度**:限制目录树的显示深度 |
| 128 | +- **文件过滤**:使用正则表达式过滤显示的文件 |
| 129 | +- **窗口置顶**:使窗口保持在所有其他应用之上 |
| 130 | +- **高级选项切换**:隐藏/显示高级设置,最大化树显示空间 |
122 | 131 |
|
123 | | -## 🛠️ Building from Source |
| 132 | +## 🛠️ 从源码构建 |
124 | 133 |
|
125 | | -### Requirements |
| 134 | +### 环境要求 |
126 | 135 |
|
127 | 136 | - Python 3.9+ |
128 | | -- Poetry package manager |
| 137 | +- Poetry 包管理工具 |
129 | 138 |
|
130 | | -### Install Dependencies |
| 139 | +### 安装依赖 |
131 | 140 |
|
132 | 141 | ```bash |
133 | 142 | git clone https://github.com/sansan0/ai-code-context-helper.git |
134 | 143 | cd ai-code-context-helper |
135 | 144 | poetry install |
136 | 145 | ``` |
137 | 146 |
|
138 | | -### Build Executable |
| 147 | +### 构建可执行文件 |
139 | 148 |
|
140 | 149 | ```bash |
141 | 150 | poetry run python -m cx_Freeze build |
142 | 151 | ``` |
143 | 152 |
|
144 | | -## 📄 License |
| 153 | +## 📄 许可证 |
145 | 154 |
|
146 | | -This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details. |
| 155 | +本项目采用 GPL-3.0 许可证 - 详见 [LICENSE](LICENSE) 文件 |
0 commit comments