[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-joshpxyne--gpt-migrate":3,"tool-joshpxyne--gpt-migrate":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,52],"视频",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[14,35],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":72,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":10,"env_os":90,"env_gpu":91,"env_ram":91,"env_deps":92,"category_tags":99,"github_topics":100,"view_count":32,"oss_zip_url":100,"oss_zip_packed_at":100,"status":17,"created_at":101,"updated_at":102,"faqs":103,"releases":144},4337,"joshpxyne\u002Fgpt-migrate","gpt-migrate","Easily migrate your codebase from one framework or language to another.","gpt-migrate 是一款专为开发者设计的开源工具，旨在利用大语言模型（LLM）的能力，轻松将代码库从一种编程语言或框架迁移到另一种。它主要解决了软件重构中成本高、耗时久且容易出错的痛点，通过自动化生成目标语言的完整代码及相应的单元测试，大幅降低了跨技术栈迁移的门槛。\n\n该工具特别适合需要处理遗留系统升级、技术栈转换或进行多语言代码研究的软件开发者和工程团队。其核心技术亮点在于能够理解现有项目的整体逻辑，不仅重写业务代码，还能智能生成验证迁移正确性的测试用例。此外，gpt-migrate 支持高度自定义，用户可通过参数灵活指定源目录、目标语言、使用的 AI 模型（推荐 GPT-4-32k 以获得更佳上下文理解）以及运行环境等。\n\n需要注意的是，由于涉及全量代码的重写与迭代，使用时建议结合人工审查以确保最终质量，并留意可能产生的 API 调用成本。作为社区驱动的项目，gpt-migrate 展现了当前 AI 技术在复杂工程任务中的巨大潜力，是现代化代码迁移工作的得力助手。","\u003Cdiv align=\"center\">\n\n# ◐ &nbsp; GPT-Migrate &nbsp; ◑\n\n**Easily migrate your codebase from one framework or language to another.**\n\n\u003Cp>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg alt=\"Github License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\">\u003Cimg alt=\"GitHub Repo stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002F0xpayne\u002Fgpt-migrate?style=social\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cbr \u002F>\n\n\u003C\u002Fdiv>\n\nIf you've ever faced the pain of migrating a codebase to a new framework or language, this project is for you.\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F25165841\u002F250232917-bcc99ce8-99b7-4e3d-a653-f89e163ed825.mp4\n\nMigration is a costly, tedious, and non-trivial problem. Do not trust the current version blindly and please use responsibly. Please also be aware that costs can add up quickly as GPT-Migrate is designed to write (and potentially re-write) the entirety of a codebase.\n\nHowever, with the collective brilliance of the OSS community and the current state of LLMs, it is also a very tractable problem.\n\n## ⚡️ Usage\n\n1. Install Docker and ensure that it's running. It's also recommended that you use at least GPT-4, preferably GPT-4-32k.\n\n## 📦 Installation using Poetry\n\n1. Install Poetry by following the instructions on the [official Poetry website](https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F#installation).\n\n2. Once Poetry is installed, navigate to the project directory and install the project dependencies using the following command:\n\n```bash\npoetry install\n```\n\nThis will create a virtual environment and install all the necessary dependencies in that environment.\n\n2. Set your [OpenRouter API key](https:\u002F\u002Fopenrouter.ai\u002Fdocs#api-keys) (default) and\u002For your [OpenAI API key](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys) (to use the OpenAI API directly...in this case, set --model to `gpt-4-32k` or your desired model) and install the python requirements:\n\n`export OPENROUTER_API_KEY=\u003Cyour key>`\n`export OPENAI_API_KEY=\u003Cyour key>`\n`pip install -r requirements.txt`\n\n3. Run the main script with the target language you want to migrate to:\n\n`python main.py --targetlang nodejs`\n\n4. (Optional) If you'd like GPT-Migrate to validate the unit tests it creates against your app before it tests the migrated app with them, please have your existing app exposed and use the `--sourceport` flag. For executing this against the benchmark, open a separate terminal, navigate to the `benchmarks\u002Flanguage-pair\u002Fsource` directory, and run `python app.py` after installing the requirements. It will expose on port 5000. Use this with the `--sourceport` flag.\n\nBy default, this script will execute the flask-nodejs benchmark. You can specify the language, source directory, and many other things using the options guide below.\n\n## 💡 Options\n\nYou can customize the behavior of GPT-Migrate by passing the following options to the `main.py` script:\n\n- `--model`: The Large Language Model to be used. Default is `\"gpt-4-32k\"`.\n\n- `--temperature`: Temperature setting for the AI model. Default is `0`.\n\n- `--sourcedir`: Source directory containing the code to be migrated. Default is `\"..\u002Fbenchmarks\u002Fflask-nodejs\u002Fsource\"`.\n\n- `--sourcelang`: Source language or framework of the code to be migrated. No default value.\n\n- `--sourceentry`: Entrypoint filename relative to the source directory. For instance, this could be an `app.py` or `main.py` file for Python. Default is `\"app.py\"`.\n\n- `--targetdir`: Directory where the migrated code will live. Default is `\"..\u002Fbenchmarks\u002Fflask-nodejs\u002Ftarget\"`.\n\n- `--targetlang`: Target language or framework for migration. Default is `\"nodejs\"`.\n\n- `--operating_system`: Operating system for the Dockerfile. Common options are `'linux'` or `'windows'`. Default is `'linux'`.\n\n- `--testfiles`: Comma-separated list of files that have functions to be tested. For instance, this could be an `app.py` or `main.py` file for a Python app where your REST endpoints are. Include the full relative path. Default is `\"app.py\"`.\n\n- `--sourceport`: (Optional) Port for testing the unit tests file against the original app. No default value. If not included, GPT-Migrate will not attempt to test the unit tests against your original app.\n\n- `--targetport`: Port for testing the unit tests file against the migrated app. Default is `8080`.\n\n- `--guidelines`: Stylistic or small functional guidelines that you'd like to be followed during the migration. For instance, \"Use tabs, not spaces\". Default is an empty string.\n\n- `--step`: Step to run. Options are `'setup'`, `'migrate'`, `'test'`, `'all'`. Default is `'all'`.\n\nFor example, to migrate a Python codebase to Node.js, you might run:\n\n```bash\npython main.py --sourcedir \u002Fpath\u002Fto\u002Fmy-python-app --sourceentry app.py --targetdir \u002Fpath\u002Fto\u002Fmy-nodejs-app --targetlang nodejs\n```\n\nThis will take the Python code in `.\u002Fmy-python-app`, migrate it to Node.js, and write the resulting code to `.\u002Fmy-nodejs-app`.\n\n#### GPT-assisted debugging\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F25165841\u002F250233075-eff1a535-f40e-42e4-914c-042c69ba9195.mp4\n\n## 🤖 How it Works\n\nFor migrating a repo from `--sourcelang` to `--targetlang`...\n\n1. GPT-Migrate first creates a Docker environment for `--targetlang`, which is either passed in or assessed automatically by GPT-Migrate.\n2. It evaluates your existing code recursively to identify 3rd-party `--sourcelang` dependencies and selects corresponding `--targetlang` dependencies.\n3. It recursively rebuilds new `--targetlang` code from your existing code starting from your designated `--sourceentry` file. This step can be started from with the `--step migrate` option.\n4. It spins up the Docker environment with the new codebase, exposing it on `--targetport` and iteratively debugging as needed.\n5. It develops unit tests using Python's unittest framework, and optionally tests these against your existing app if it's running and exposed on `--sourceport`, iteratively debugging as needed. This step can be started from with the `--step test` option.\n6. It tests the new code on `--targetport` against these unit tests.\n7. It iteratively debugs the code for for you with context from logs, error messages, relevant files, and directory structure. It does so by choosing one or more actions (move, create, or edit files) then executing them. If it wants to execute any sort of shell script (moving files around), it will first ask for clearance. Finally, if at any point it gets stuck or the user ends the debugging loop, it will output directions for the user to follow to move to the next step of the migration.\n8. The new codebase is completed and exists in `--targetdir`.\n\n### 📝 Prompt Design\n\nSubprompts are organized in the following fashion:\n\n- `HIERARCHY`: this defines the notion of preferences. There are 4 levels of preference, and each level prioritized more highly than the previous one.\n- `p1`: Preference Level 1. These are the most general prompts, and consist of broad guidelines.\n- `p2`: Preference Level 2. These are more specific prompts, and consist of guidelines for certain types of actions (e.g., best practices and philosophies for writing code).\n- `p3`: Preference Level 3. These are even more specific prompts, and consist of directions for specific actions (e.g., creating a certain file, debugging, writing tests).\n- `p4`: Preference Level 4. These are the most specific prompts, and consist of formatting for output.\n\nPrompts are a combination of subprompts. This concept of tagging and composability can be extended to other properties as well to make prompts even more robust. This is an area we're highly interested in actively exploring.\n\nIn this repo, the `prompt_constructor()` function takes in one or more subprompts and yields a string which may be formatted with variables, for example with `GUIDELINES` being a `p1`, `WRITE_CODE` being a `p2` etc:\n\n```python\nprompt = prompt_constructor(HIERARCHY, GUIDELINES, WRITE_CODE, DEBUG_TESTFILE, SINGLEFILE).format(targetlang=targetlang,buggyfile=buggyfile)\n```\n\n## 📈 Performance\n\nGPT-Migrate is currently in development alpha and is not yet ready for production use. For instance, on the relatively simple benchmarks, it gets through \"easy\" languages like python or javascript without a hitch ~50% of the time, and cannot get through more complex languages like C++ or Rust without some human assistance.\n\n## ✅ Benchmarks\n\nWe're actively looking to build up a robust benchmark repository. If you have a codebase that you'd like to contribute, please open a PR! The current benchmarks were built from scratch: REST API apps which have a few endpoints and dependency files.\n\n## 🧗 Roadmap\n\nBelow are improvements on the to-do list. If you'd like to knock any of these or others out, please submit a PR :)\n\n#### High urgency\n\n- Add logic for model input size limiting based on the window size. See issue [#2](https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\u002Fissues\u002F2).\n\n#### Med urgency\n\n- Add unit tests to the entire project for better reliability and CI\u002FCD\n- Add more benchmark examples, especially larger repos\n- Add functionality to let the LLM request access to dependency functions in other files as it debugs\n- Add support for other LLMs\n\n#### Low urgency\n\n- Enable internet search requests as the model debugs\n- Identify and compile language-specific issues + solve for them\n\n## 📣 Call to Action\n\nWe're looking for talented contributors. Whether you have a particular passion about a specific language or framework, want to help in creating a more robust test suite, or generally have interesting ideas on how to make this better, we'd love to have you!\n\n## 🛠 Expert-Assisted Migration\n\nDue to the inflow of requests, we've decided to create a standardized process for helping people with their migrations. If you're a company that needs help with a big migration or an expert that is willing to help with them, please visit the following website: [https:\u002F\u002Fgpt-migrate.com\u002F](https:\u002F\u002Fgpt-migrate.com\u002F)\n\n## Join the conversation on [Twitter](https:\u002F\u002Ftwitter.com\u002Fjoshpxyne\u002Fstatus\u002F1675254164165910528)!\n","\u003Cdiv align=\"center\">\n\n# ◐ &nbsp; GPT-Migrate &nbsp; ◑\n\n**轻松将您的代码库从一个框架或语言迁移到另一个框架或语言。**\n\n\u003Cp>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg alt=\"Github License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\">\u003Cimg alt=\"GitHub Repo stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002F0xpayne\u002Fgpt-migrate?style=social\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cbr \u002F>\n\n\u003C\u002Fdiv>\n\n如果您曾经为将代码库迁移到新的框架或语言而感到头疼，那么这个项目就是为您准备的。\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F25165841\u002F250232917-bcc99ce8-99b7-4e3d-a653-f89e163ed825.mp4\n\n迁移是一项成本高昂、繁琐且并不简单的任务。请不要盲目信任当前版本，请谨慎使用。同时请注意，由于 GPT-Migrate 的设计目的是编写（并可能重写）整个代码库，因此费用可能会迅速增加。\n\n然而，在开源社区的集体智慧和当前大语言模型技术的支持下，这一问题也是完全可以解决的。\n\n## ⚡️ 使用方法\n\n1. 安装 Docker 并确保其正在运行。建议您至少使用 GPT-4，最好是 GPT-4-32k。\n\n## 📦 使用 Poetry 安装\n\n1. 按照 [Poetry 官方网站](https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F#installation) 的说明安装 Poetry。\n\n2. Poetry 安装完成后，导航到项目目录，并使用以下命令安装项目依赖：\n\n```bash\npoetry install\n```\n\n这将创建一个虚拟环境，并在该环境中安装所有必要的依赖项。\n\n2. 设置您的 [OpenRouter API 密钥](https:\u002F\u002Fopenrouter.ai\u002Fdocs#api-keys)（默认）和\u002F或您的 [OpenAI API 密钥](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys)（以直接使用 OpenAI API……在这种情况下，将 `--model` 设置为 `gpt-4-32k` 或您所需的模型），并安装 Python 依赖项：\n\n`export OPENROUTER_API_KEY=\u003Cyour key>`\n`export OPENAI_API_KEY=\u003Cyour key>`\n`pip install -r requirements.txt`\n\n3. 运行主脚本，指定您想要迁移到的目标语言：\n\n`python main.py --targetlang nodejs`\n\n4. （可选）如果您希望 GPT-Migrate 在用单元测试测试迁移后的应用之前，先验证它生成的单元测试是否适用于您的现有应用，请确保您的现有应用已对外暴露，并使用 `--sourceport` 标志。要针对基准测试执行此操作，请打开另一个终端，导航到 `benchmarks\u002Flanguage-pair\u002Fsource` 目录，并在安装依赖项后运行 `python app.py`。它将在端口 5000 上暴露服务。请结合 `--sourceport` 标志使用。\n\n默认情况下，此脚本将执行 flask-nodejs 基准测试。您可以使用下面的选项指南指定语言、源目录以及其他许多内容。\n\n## 💡 选项\n\n您可以通过向 `main.py` 脚本传递以下选项来自定义 GPT-Migrate 的行为：\n\n- `--model`: 要使用的大型语言模型。默认值为 `\"gpt-4-32k\"`。\n\n- `--temperature`: AI 模型的温度设置。默认值为 `0`。\n\n- `--sourcedir`: 包含待迁移代码的源目录。默认值为 `\"..\u002Fbenchmarks\u002Fflask-nodejs\u002Fsource\"`。\n\n- `--sourcelang`: 待迁移代码的源语言或框架。无默认值。\n\n- `--sourceentry`: 源目录下的入口文件名。例如，对于 Python 应用程序，可能是 `app.py` 或 `main.py` 文件。默认值为 `\"app.py\"`。\n\n- `--targetdir`: 迁移后的代码将存放的目录。默认值为 `\"..\u002Fbenchmarks\u002Fflask-nodejs\u002Ftarget\"`。\n\n- `--targetlang`: 迁移的目标语言或框架。默认值为 `\"nodejs\"`。\n\n- `--operating_system`: Dockerfile 的操作系统。常见选项有 `'linux'` 或 `'windows'`。默认值为 `'linux'`。\n\n- `--testfiles`: 需要测试的函数所在的文件列表，以逗号分隔。例如，对于 Python 应用程序，这可能是包含 REST 端点的 `app.py` 或 `main.py` 文件。请提供完整的相对路径。默认值为 `\"app.py\"`。\n\n- `--sourceport`: （可选）用于将单元测试文件与原始应用程序进行测试的端口。无默认值。如果未指定，GPT-Migrate 将不会尝试将单元测试与您的原始应用程序进行测试。\n\n- `--targetport`: 用于将单元测试文件与迁移后的应用程序进行测试的端口。默认值为 `8080`。\n\n- `--guidelines`: 您希望在迁移过程中遵循的风格或小功能指南。例如，“使用制表符，而不是空格”。默认值为空字符串。\n\n- `--step`: 要执行的步骤。选项包括 `'setup'`、`'migrate'`、`'test'`、`'all'`。默认值为 `'all'`。\n\n例如，要将 Python 代码库迁移到 Node.js，您可以运行：\n\n```bash\npython main.py --sourcedir \u002Fpath\u002Fto\u002Fmy-python-app --sourceentry app.py --targetdir \u002Fpath\u002Fto\u002Fmy-nodejs-app --targetlang nodejs\n```\n\n这会将 `.\u002Fmy-python-app` 中的 Python 代码迁移到 Node.js，并将结果代码写入 `.\u002Fmy-nodejs-app`。\n\n#### GPT 辅助调试\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F25165841\u002F250233075-eff1a535-f40e-42e4-914c-042c69ba9195.mp4\n\n## 🤖 工作原理\n\n要将仓库从 `--sourcelang` 迁移到 `--targetlang`……\n\n1. GPT-Migrate 首先为 `--targetlang` 创建一个 Docker 环境，该环境可以由用户指定，也可以由 GPT-Migrate 自动评估。\n2. 它递归地评估您现有的代码，以识别第三方 `--sourcelang` 依赖项，并选择相应的 `--targetlang` 依赖项。\n3. 它从您指定的 `--sourceentry` 文件开始，递归地根据现有代码重建新的 `--targetlang` 代码。这一步可以通过 `--step migrate` 选项启动。\n4. 它启动包含新代码的 Docker 环境，在 `--targetport` 上暴露服务，并根据需要迭代调试。\n5. 它使用 Python 的 unittest 框架开发单元测试，并可选地在您的现有应用程序运行且在 `--sourceport` 上暴露的情况下，将其与现有应用程序进行测试，同样根据需要迭代调试。这一步可以通过 `--step test` 选项启动。\n6. 它使用这些单元测试在 `--targetport` 上测试新代码。\n7. 它会根据日志、错误信息、相关文件以及目录结构等上下文，为您迭代调试代码。它通过选择一项或多项操作（移动、创建或编辑文件）并执行它们来实现这一点。如果它需要执行任何类型的 shell 脚本（例如移动文件），它会先请求许可。最后，如果在任何时候它陷入僵局，或者用户终止了调试循环，它将输出指导用户如何进入迁移的下一步。\n8. 新的代码库完成，并存放在 `--targetdir` 中。\n\n### 📝 提示词设计\n\n子提示词按照以下方式组织：\n\n- `HIERARCHY`：定义了偏好概念。共有4个偏好级别，每个级别都比前一级别优先级更高。\n- `p1`：偏好级别1。这些是最通用的提示词，由宽泛的指导原则组成。\n- `p2`：偏好级别2。这些提示词更加具体，包含针对特定类型操作的指导（例如编写代码的最佳实践和理念）。\n- `p3`：偏好级别3。这些提示词更为具体，提供针对特定操作的指示（例如创建某个文件、调试、编写测试）。\n- `p4`：偏好级别4。这些是最高级别的具体提示词，用于指定输出格式。\n\n提示词是由多个子提示词组合而成的。这种标签化和可组合性的概念还可以扩展到其他属性上，从而使提示词更加健壮。这是我们非常感兴趣并积极探索的一个领域。\n\n在本仓库中，`prompt_constructor()` 函数接收一个或多个子提示词，并生成一个可以使用变量进行格式化的字符串，例如将 `GUIDELINES` 定义为 `p1`，`WRITE_CODE` 定义为 `p2` 等：\n\n```python\nprompt = prompt_constructor(HIERARCHY, GUIDELINES, WRITE_CODE, DEBUG_TESTFILE, SINGLEFILE).format(targetlang=targetlang,buggyfile=buggyfile)\n```\n\n## 📈 性能\n\nGPT-Migrate 目前仍处于开发 Alpha 阶段，尚未准备好投入生产环境使用。例如，在相对简单的基准测试中，它大约 50% 的时间能够顺利迁移 Python 或 JavaScript 等“简单”语言，而对于 C++ 或 Rust 等更复杂的语言，则需要一定的人工协助才能完成迁移。\n\n## ✅ 基准测试\n\n我们正在积极构建一个强大的基准测试库。如果您有一个希望贡献的代码库，请提交 Pull Request！目前的基准测试是从零开始构建的：包含几个端点和依赖文件的 REST API 应用程序。\n\n## 🧗 路线图\n\n以下是待办事项清单中的改进内容。如果您希望完成其中任何一项或其他任务，请提交 PR :)\n\n#### 高紧急程度\n\n- 根据模型输入窗口大小，添加限制输入长度的逻辑。详见问题 [#2](https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate\u002Fissues\u002F2)。\n\n#### 中等紧急程度\n\n- 为整个项目添加单元测试，以提高可靠性和 CI\u002FCD 流程。\n- 增加更多基准测试示例，尤其是大型代码库。\n- 添加功能，使 LLM 在调试时能够请求访问其他文件中的依赖函数。\n- 增加对其他 LLM 的支持。\n\n#### 低紧急程度\n\n- 在模型调试过程中启用互联网搜索功能。\n- 识别并整理特定语言的问题，并提出解决方案。\n\n## 📣 行动号召\n\n我们正在寻找优秀的贡献者。无论您对某种特定语言或框架充满热情，还是希望帮助我们构建更健壮的测试套件，亦或是对如何改进该项目有有趣的创意，我们都热烈欢迎您的加入！\n\n## 🛠 专家协助迁移\n\n由于请求量不断增加，我们决定制定一套标准化流程，以帮助大家完成代码迁移工作。如果您所在的公司需要大规模迁移的支持，或者您是一位愿意提供帮助的专家，请访问以下网站：[https:\u002F\u002Fgpt-migrate.com\u002F](https:\u002F\u002Fgpt-migrate.com\u002F)\n\n## 欢迎在 [Twitter](https:\u002F\u002Ftwitter.com\u002Fjoshpxyne\u002Fstatus\u002F1675254164165910528) 上参与讨论！","# GPT-Migrate 快速上手指南\n\nGPT-Migrate 是一个利用大语言模型（LLM）自动将代码库从一种框架或语言迁移到另一种框架或语言的工具。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：支持 Linux、macOS 或 Windows（需安装 WSL2 或兼容的 Docker 环境）。\n*   **Docker**：必须安装并正在运行。该工具依赖 Docker 来构建目标语言的运行环境。\n*   **Python**：建议安装 Python 3.8+。\n*   **Poetry**：用于管理 Python 项目依赖。\n    *   安装命令：`curl -sSL https:\u002F\u002Finstall.python-poetry.org | python3 -`\n*   **API Key**：\n    *   **OpenRouter API Key**（推荐默认使用）：访问 [OpenRouter](https:\u002F\u002Fopenrouter.ai\u002Fdocs#api-keys) 获取。\n    *   **OpenAI API Key**（可选）：若直接使用 OpenAI 接口，请访问 [OpenAI Platform](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys) 获取。\n    *   **模型建议**：强烈建议使用 **GPT-4**，最好是 **GPT-4-32k**，以处理较大的代码上下文。\n\n> **注意**：由于涉及大量 Token 调用，迁移整个代码库可能会产生较高的 API 费用，请谨慎使用并监控用量。\n\n## 安装步骤\n\n1.  **克隆项目并进入目录**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002F0xpayne\u002Fgpt-migrate.git\n    cd gpt-migrate\n    ```\n\n2.  **使用 Poetry 安装依赖**\n    这将创建虚拟环境并安装所需包：\n    ```bash\n    poetry install\n    ```\n\n3.  **配置 API 密钥**\n    根据您的选择导出环境变量（二选一或同时配置）：\n\n    *   使用 OpenRouter（默认）：\n        ```bash\n        export OPENROUTER_API_KEY=\u003Cyour_openrouter_key>\n        ```\n    *   直接使用 OpenAI（如需指定特定模型如 `gpt-4-32k`）：\n        ```bash\n        export OPENAI_API_KEY=\u003Cyour_openai_key>\n        ```\n\n4.  **安装 Python 依赖（备选）**\n    如果不使用 Poetry 激活的环境，可直接通过 pip 安装：\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## 基本使用\n\n以下是最简单的使用示例，将当前目录下的 Python Flask 应用迁移为 Node.js 应用。\n\n### 1. 执行迁移命令\n\n运行主脚本并指定目标语言（`--targetlang`）：\n\n```bash\npython main.py --targetlang nodejs\n```\n\n**参数说明：**\n*   默认情况下，脚本会读取 `..\u002Fbenchmarks\u002Fflask-nodejs\u002Fsource` 目录作为源代码。\n*   默认会将迁移后的代码输出到 `..\u002Fbenchmarks\u002Fflask-nodejs\u002Ftarget` 目录。\n*   默认使用的模型为 `gpt-4-32k`。\n\n### 2. 自定义源目录和目标语言\n\n如果您想迁移自己的项目，可以使用以下命令格式：\n\n```bash\npython main.py --sourcedir \u002Fpath\u002Fto\u002Fmy-python-app --sourceentry app.py --targetdir \u002Fpath\u002Fto\u002Fmy-nodejs-app --targetlang nodejs\n```\n\n*   `--sourcedir`: 源代码所在目录。\n*   `--sourceentry`: 入口文件名（如 `app.py` 或 `main.py`）。\n*   `--targetdir`: 迁移后代码的输出目录。\n*   `--targetlang`: 目标语言（如 `nodejs`, `go`, `rust` 等）。\n\n### 3. 工作流程简述\n\n执行命令后，GPT-Migrate 将自动执行以下步骤：\n1.  为目标语言创建 Docker 环境。\n2.  分析源代码依赖并映射到目标语言依赖。\n3.  递归重写代码。\n4.  启动容器并进行迭代调试。\n5.  生成单元测试并验证迁移后的应用。\n6.  最终在 `--targetdir` 输出完整的迁移代码。\n\n> **提示**：迁移过程是迭代进行的，如果遇到复杂逻辑，工具可能会请求用户确认文件操作或提供进一步的调试上下文。目前该工具处于 Alpha 阶段，对于复杂语言（如 C++、Rust）可能需要人工辅助。","某电商团队急需将核心订单系统的后端从老旧的 Python Flask 架构迁移至高性能的 Node.js 微服务，以应对大促期间的高并发流量。\n\n### 没有 gpt-migrate 时\n- **人力成本高昂**：资深工程师需逐行重写数万行业务逻辑，预计耗时数周，严重挤占新功能开发资源。\n- **逻辑一致性难保**：人工转换极易遗漏边缘情况或误解原有业务规则，导致新旧系统行为不一致，引发潜在资损。\n- **测试覆盖滞后**：迁移完成后需手动补写大量单元测试来验证功能，测试周期长，上线风险不可控。\n- **环境配置繁琐**：目标语言的项目脚手架、依赖管理及 Docker 容器化配置需从头摸索，易出现环境兼容性问题。\n\n### 使用 gpt-migrate 后\n- **自动化极速重构**：gpt-migrate 自动解析 Flask 源码并生成完整的 Node.js 代码及对应 Dockerfile，将数周工作量压缩至数小时。\n- **业务逻辑精准映射**：基于大模型对上下文的理解，工具能准确保留原有事务处理与异常捕获逻辑，确保核心业务流程无缝衔接。\n- **同步生成验证测试**：工具在迁移代码的同时自动生成配套的单元测试用例，并可对接原服务端口进行自动化回归验证，即时发现差异。\n- **开箱即用的工程结构**：直接输出符合 Node.js 最佳实践的项目目录结构与依赖配置，团队无需关心底层基建，聚焦业务验收即可。\n\ngpt-migrate 通过将繁琐的跨语言迁移转化为可控的自动化流程，让团队在零停机风险下完成了技术栈的现代化升级。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjoshpxyne_gpt-migrate_bed7c4d2.png","joshpxyne","Josh Payne","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fjoshpxyne_b02abca3.jpg","Those Alcubierre drives aren't going to build themselves!","@Coframe ","Stanford, CA","josh@payne.net","https:\u002F\u002Fpayne.net","https:\u002F\u002Fgithub.com\u002Fjoshpxyne",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,6993,507,"2026-04-03T07:35:59","MIT","Linux, Windows","未说明",{"notes":93,"python":94,"dependencies":95},"必须安装并运行 Docker；推荐使用 GPT-4 或 GPT-4-32k 模型（需配置 OpenRouter 或 OpenAI API Key）；项目处于 Alpha 开发阶段，不建议用于生产环境；复杂语言迁移可能需要人工协助。","未说明 (需安装 Poetry 或 pip)",[96,97,98],"poetry","openai","docker",[35,14],null,"2026-03-27T02:49:30.150509","2026-04-06T19:01:20.022814",[104,109,114,119,124,129,134,139],{"id":105,"question_zh":106,"answer_zh":107,"source_url":108},19719,"我没有 GPT-4 访问权限，可以使用该工具吗？","可以。虽然推荐使用 GPT-4 或 GPT-4-32k，但你可以通过 `--model` 参数指定使用 GPT-3.5（例如 `gpt-3.5-turbo-16k`）。需要注意的是，处理大文件时可能会遇到上下文窗口限制的问题。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F12",{"id":110,"question_zh":111,"answer_zh":112,"source_url":113},19720,"如何支持 OpenRouter 或其他非官方 API 端点？","项目已添加对 OpenRouter 的支持。如果遇到模型无法识别的问题，通常是因为 `requirements.txt` 中的 `litellm` 版本过旧。请运行 `pip install --upgrade litellm` 升级库，然后即可使用类似 `openrouter\u002Fopenai\u002Fgpt-4-32k` 的模型名称。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F39",{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},19721,"使用 OpenRouter 时遇到 'Request Entity Too Large' (HTTP 413) 错误怎么办？","这通常是因为生成的提示词过大超出了 API 限制。有用户反馈禁用“网络搜索”（web search）功能可以解决此问题。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F44",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},19722,"为什么提示找不到 `gpt-4-32k` 模型？","GPT-4 和 GPT-4-32k 的访问权限是分开授予的。即使你拥有 GPT-4 的访问权，也可能尚未获得 GPT-4-32k 的权限。你需要单独申请或等待 OpenAI 逐步开放该模型的访问。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F25",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},19723,"遇到 OpenAI Rate Limit Error（速率限制错误）如何解决？","这是由于你的 OpenAI 账户达到了每分钟 Token 的使用上限（例如默认限制为 180,000 tokens\u002Fmin）。这不是工具的 Bug，而是账户限制。解决方法包括：等待限额重置、升级 OpenAI 账户层级以提高限额，或者切换到限制更宽松的模型。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F15",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},19724,"迁移后的代码没有正确调用内部函数（如缺少 import）怎么办？","这是一个已知的非确定性问题。由于 AI 生成的随机性，重试运行工具或让调试器自动修复通常能解决问题。目前建议多次尝试直到生成正确的导入语句。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F26",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},19725,"未来会支持本地运行的 AI 模型吗？","是的，支持本地模型已在项目的路线图（Roadmap）中，具体信息可以在 README 文件中查看。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F22",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},19726,"工具声称需要极高的 Token 数量（如 320k），这是正常的吗？","工具在处理大型项目时确实会消耗大量 Token，这在免责声明和 README 中已有说明。如果认为 Token 使用不合理，可能是项目结构复杂导致的。对于私有仓库，建议检查是否有不必要的大文件被包含在上下文中。","https:\u002F\u002Fgithub.com\u002Fjoshpxyne\u002Fgpt-migrate\u002Fissues\u002F27",[]]