[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-qodo-ai--qodo-cover":3,"tool-qodo-ai--qodo-cover":61},[4,18,26,36,44,52],{"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 真正成长为懂上",141543,2,"2026-04-06T11:32:54",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[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},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"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,60],"视频",{"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":76,"owner_email":77,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":118,"forks":119,"last_commit_at":120,"license":121,"difficulty_score":32,"env_os":122,"env_gpu":123,"env_ram":123,"env_deps":124,"category_tags":133,"github_topics":134,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":139,"updated_at":140,"faqs":141,"releases":170},4376,"qodo-ai\u002Fqodo-cover","qodo-cover","Qodo-Cover: An AI-Powered Tool for Automated Test Generation and Code Coverage Enhancement! 💻🤖🧪🐞","Qodo-Cover 是一款基于生成式人工智能的开源工具，旨在自动化生成单元测试并提升代码覆盖率。它通过智能分析现有代码库，自动构建测试用例，帮助开发者快速填补测试空白，从而确保软件质量与可靠性。\n\n该工具主要解决了人工编写单元测试耗时费力、难以全面覆盖代码逻辑的痛点。在传统开发流程中，维持高覆盖率往往需要大量重复劳动，而 Qodo-Cover 能够自动识别待测文件、收集上下文信息，并持续生成符合要求的测试脚本，显著简化了测试流程。\n\nQodo-Cover 非常适合软件开发者、测试工程师以及希望探索自动化测试新技术的研究人员使用。它既支持作为命令行工具在本地运行，也能集成到 GitHub CI 工作流中，灵活适配各种开发环境。\n\n其核心技术亮点在于模块化的智能架构：包含测试执行器、覆盖率解析器、提示词构建器和 AI 调用器。这一机制确保了生成的测试不仅语法正确，还能切实提升覆盖率指标。值得注意的是，该项目目前处于非维护状态，但其开源代码仍为社区提供了宝贵的参考实现，适合有能力的团队进行二次开发或定制使用。","\n\n\n\n\u003Cdiv align=\"center\">\n\u003Cdiv align=\"center\">\n\n \u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fwww.qodo.ai\u002Fwp-content\u002Fuploads\u002F2025\u002F02\u002FQodoCover-Light.png\" width=\"330\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fwww.qodo.ai\u002Fwp-content\u002Fuploads\u002F2025\u002F02\u002FQodoCover-Dark.png\" width=\"330\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_5cff1b072f90.png\" alt=\"logo\" width=\"330\"> \n\n\u003C\u002Fpicture>\n\u003Cbr\u002F>\u003Cbr\u002F>\nQodo Cover aims to help efficiently increase code coverage, by automatically generating qualified tests to extend code coverage. Qodo Cover can run in your GitHub CI workflow or locally as a CLI tool.\n\u003C\u002Fdiv>\n\n[![GitHub license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-AGPL_3.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fblob\u002Fmain\u002FLICENSE)\n[![Discord](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_c6eb98446236.png)](https:\u002F\u002Fdiscord.gg\u002FcYsvFJJbdM)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fqodoai)](https:\u002F\u002Ftwitter.com\u002Fqodoai)\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodium-ai\u002Fcover-agent\u002Fcommits\u002Fmain\">\n    \u003Cimg alt=\"GitHub\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flast-commit\u002Fqodo-ai\u002Fqodo-cover\u002Fmain?style=for-the-badge\" height=\"20\">\n    \u003C\u002Fa>\u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F10328\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_4a68feb902da.png\" alt=\"Codium-ai\u002Fcover-agent | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Table of Contents\n* [News and Updates](#news-and-updates)\n* [Overview](#overview)\n* [Installation and Usage](#installation-and-usage)\n* [Contributing](#contributing)\n* [Documentation](#documentation)\n* [Roadmap](#roadmap)\n\n\n## News and Updates\n### 2025-06-15\n> **⚠️ This repository is no longer maintained. Please fork it if you wish to continue development or use it in your own projects.**\n\n### 2024-12-04:\nNew mode - [Run Qodo Cover Pro in your GitHub CI workflow](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-ci). Currently in preview and available for free for a limited time for Python projects, leveraging your own LLM API key from your favorite LLM provider. It's a practical way to improve code quality and reliability. For more details, reach out to the [Qodo team](https:\u002F\u002Fwww.qodo.ai\u002Fbook-a-demo).\n\n### 2024-11-05:\nNew mode - scan an entire repo, auto identify the test files, auto collect context for each test file, and extend the test suite with new tests.\nSee more details [here](docs\u002Frepo_coverage.md).\n\n\n# Qodo-Cover\nWelcome to Qodo-Cover. This focused project utilizes Generative AI to automate and enhance the generation of tests (currently mostly unit tests), aiming to streamline development workflows. Qodo-Cover can run via a terminal, and is planned to be integrated into popular CI platforms.\n\nWe invite the community to collaborate and help extend the capabilities of Qodo Cover, continuing its development as a cutting-edge solution in the automated unit test generation domain. We also wish to inspire researchers to leverage this open-source tool to explore new test-generation techniques.\n\n\n## Overview\nThis tool is part of a broader suite of utilities designed to automate the creation of unit tests for software projects. Utilizing advanced Generative AI models, it aims to simplify and expedite the testing process, ensuring high-quality software development. The system comprises several components:\n1. **Test Runner:** Executes the command or scripts to run the test suite and generate code coverage reports.\n2. **Coverage Parser:** Validates that code coverage increases as tests are added, ensuring that new tests contribute to the overall test effectiveness.\n3. **Prompt Builder:** Gathers necessary data from the codebase and constructs the prompt to be passed to the Large Language Model (LLM).\n4. **AI Caller:** Interacts with the LLM to generate tests based on the prompt provided.\n\n\n## Installation and Usage\n### Requirements\nBefore you begin, make sure you have the following:\n- `OPENAI_API_KEY` set in your environment variables, which is required for calling the OpenAI API.\n- Code Coverage tool: A Cobertura XML code coverage report is required for the tool to function correctly.\n  - For example, in Python one could use `pytest-cov`. Add the `--cov-report=xml` option when running Pytest.\n  - Note: We are actively working on adding more coverage types but please feel free to open a PR and contribute to `cover_agent\u002FCoverageProcessor.py`\n\nIf running directly from the repository you will also need:\n- Python installed on your system.\n- Poetry installed for managing Python package dependencies. Installation instructions for Poetry can be found at [https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F](https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F).\n\n### Standalone Runtime\nQodo Cover can be installed as a Python Pip package or run as a standalone executable.\n\n#### Python Pip\nTo install the Python Pip package directly via GitHub run the following command:\n```shell\npip install git+https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover.git\n```\n\n#### Binary\nThe binary can be run without any Python environment installed on your system (e.g. within a Docker container that does not contain Python). You can download the release for your system by navigating to the project's [release page](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Freleases).\n\n### Repository Setup\nRun the following command to install all the dependencies and run the project from source:\n```shell\npoetry install\n```\n\n### Running the Code\nAfter downloading the executable or installing the Pip package you can run the Cover Agent to generate and validate unit tests. Execute it from the command line by using the following command:\n```shell\ncover-agent \\\n  --source-file-path \"\u003Cpath_to_source_file>\" \\\n  --test-file-path \"\u003Cpath_to_test_file>\" \\\n  --project-root \"\u003Cpath_to_project_root>\" \\\n  --code-coverage-report-path \"\u003Cpath_to_coverage_report>\" \\\n  --test-command \"\u003Ctest_command_to_run>\" \\\n  --test-command-dir \"\u003Cdirectory_to_run_test_command>\" \\\n  --coverage-type \"\u003Ctype_of_coverage_report>\" \\\n  --desired-coverage \u003Cdesired_coverage_between_0_and_100> \\\n  --max-iterations \u003Cmax_number_of_llm_iterations> \\\n  --included-files \"\u003Coptional_list_of_files_to_include>\"\n```\n\nYou can use the example code below to try out the Cover Agent.\n(Note that the [usage_examples](docs\u002Fusage_examples.md) file provides more elaborate examples of how to use the Cover Agent)\n\n#### Python\n\nFollow the steps in the README.md file located in the `templated_tests\u002Fpython_fastapi\u002F` directory to setup an environment, then return to the root of the repository, and run the following command to add tests to the **python fastapi** example:\n```shell\ncover-agent \\\n  --source-file-path \"templated_tests\u002Fpython_fastapi\u002Fapp.py\" \\\n  --test-file-path \"templated_tests\u002Fpython_fastapi\u002Ftest_app.py\" \\\n  --project-root \"templated_tests\u002Fpython_fastapi\" \\\n  --code-coverage-report-path \"templated_tests\u002Fpython_fastapi\u002Fcoverage.xml\" \\\n  --test-command \"pytest --cov=. --cov-report=xml --cov-report=term\" \\\n  --test-command-dir \"templated_tests\u002Fpython_fastapi\" \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 10\n```\n\n#### Go\nFor an example using **go** `cd` into `templated_tests\u002Fgo_webservice`, set up the project following the `README.md`.\nTo work with coverage reporting, you need to install `gocov` and `gocov-xml`. Run the following commands to install these tools:\n```shell\ngo install github.com\u002Faxw\u002Fgocov\u002Fgocov@v1.1.0\ngo install github.com\u002FAlekSi\u002Fgocov-xml@v1.1.0\n```\nand then run the following command:\n```shell\ncover-agent \\\n  --source-file-path \"app.go\" \\\n  --test-file-path \"app_test.go\" \\\n  --code-coverage-report-path \"coverage.xml\" \\\n  --test-command \"go test -coverprofile=coverage.out && gocov convert coverage.out | gocov-xml > coverage.xml\" \\\n  --test-command-dir $(pwd) \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 1\n```\n\n#### Java\nFor an example using **java** `cd` into `templated_tests\u002Fjava_gradle`, set up the project following the [README.md](templated_tests\u002Fjava_gradle\u002FREADME.md).\nTo work with jacoco coverage reporting, follow the [README.md](templated_tests\u002Fjava_gradle\u002FREADME.md) Requirements section:\nand then run the following command:\n```shell\ncover-agent \\\n  --source-file-path=\"src\u002Fmain\u002Fjava\u002Fcom\u002Fdavidparry\u002Fcover\u002FSimpleMathOperations.java\" \\\n  --test-file-path=\"src\u002Ftest\u002Fgroovy\u002Fcom\u002Fdavidparry\u002Fcover\u002FSimpleMathOperationsSpec.groovy\" \\\n  --code-coverage-report-path=\"build\u002Freports\u002Fjacoco\u002Ftest\u002FjacocoTestReport.csv\" \\\n  --test-command=\".\u002Fgradlew clean test jacocoTestReport\" \\\n  --test-command-dir=$(pwd) \\\n  --coverage-type=\"jacoco\" \\\n  --desired-coverage=70 \\\n  --max-iterations=1\n```\n\n### Record & Replay Feature\nTo save LLM service credits, a response recording mode is available. The starting point is a group hash, generated from the hashes of the source and test files used in each test run. If either file changes, the corresponding LLM responses should be re-recorded. \nRun the following command to execute all tests with LLM response recording enabled:\n```shell\npoetry run python tests_integration\u002Frun_test_all.py --record-mode\n```\n\nIf you run the same command without the `--record-mode` flag:\n```shell\npoetry run python tests_integration\u002Frun_test_all.py\n```\nit will use the recorded responses to generate tests without calling the LLM if recordings are available. Otherwise, it will call the LLM to run the tests.\n\nYou may also record LLM responses from a separate test run. Run a test as you normally would, and add the `--record-mode` flag to the command:\n```shell\npoetry run python tests_integration\u002Frun_test_with_docker.py \\\n  --docker-image \"embeddeddevops\u002Fpython_fastapi:latest\" \\\n  --source-file-path \"app.py\" \\\n  --test-file-path \"test_app.py\" \\\n  --code-coverage-report-path \"coverage.xml\" \\\n  --test-command \"pytest --cov=. --cov-report=xml --cov-report=term\" \\\n  --coverage-type \"cobertura\" \\\n  --model \"gpt-4o-mini\" \\\n  --record-mode\n```\n\nThe table below explains the behavior of the test runner depending on whether the `--record-mode` flag is set and whether a recorded file already exists:\n\n|    Flag     | Record File | Result                                |\n|:-----------:|:-----------:|:--------------------------------------|\n|      ❌      |      ❌      | Regular test run (file not recorded)  |\n|      ✅      |      ❌      | Records a new file                    |\n|      ✅      |      ✅      | Overwrites an existing file           |\n|      ❌      |      ✅      | Replays a recorded file               |\n\nRecorded responses are stored in the `stored_responses` folder. Files are named based on the test name and a hash value that depends on the contents of the source and test files.\n```shell\n\u003Ctest_name>_responses_\u003Chash_value>.yml\n\n# i.e.\npython_fastapi_responses_a9d9de927a82a7d776889738d2880bec7166c5f69d3518837183a20ef48b2a37.yml\n```\nA response file corresponding to the same source and test files group hash in a file name is updated during each recording session with new prompt hash entries.\nTo regenerate it from scratch, you can delete the existing response file and run a new recording session. \n\n### Outputs\nA few debug files will be outputted locally within the repository (that are part of the `.gitignore`)\n* `run.log`: A copy of the logger that gets dumped to your `stdout`\n* `test_results.html`: A results table that contains the following for each generated test:\n  * Test status\n  * Failure reason (if applicable)\n  * Exit code, \n  * `stderr`\n  * `stdout`\n  * Generated test\n\nYou can suppress logs using the `--suppress-log-files` flag. This prevents the creation of the `run.log`, `test_results.html`, and the test results `db` files.\n\n### Additional logging\nIf you set an environment variable `WANDB_API_KEY`, the prompts, responses, and additional information will be logged to [Weights and Biases](https:\u002F\u002Fwandb.ai\u002F).\n\n### Using other LLMs\nThis project uses LiteLLM to communicate with OpenAI and other hosted LLMs (supporting 100+ LLMs to date). To use a different model other than the OpenAI default you'll need to:\n1. Export any environment variables needed by the supported LLM [following the LiteLLM instructions](https:\u002F\u002Flitellm.vercel.app\u002Fdocs\u002Fproxy\u002Fquick_start#supported-llms).\n2. Call the name of the model using the `--model` option when calling Cover Agent.\n\nFor example (as found in the [LiteLLM Quick Start guide](https:\u002F\u002Flitellm.vercel.app\u002Fdocs\u002Fproxy\u002Fquick_start#supported-llms)):\n```shell\nexport VERTEX_PROJECT=\"hardy-project\"\nexport VERTEX_LOCATION=\"us-west\"\n\ncover-agent \\\n  ...\n  --model \"vertex_ai\u002Fgemini-pro\"\n```\n\n#### OpenAI Compatible Endpoint\n```shell\nexport OPENAI_API_KEY=\"\u003Cyour api key>\" # If \u003Cyour-api-base> requires an API KEY, set this value.\n\ncover-agent \\\n  ...\n  --model \"openai\u002F\u003Cyour model name>\" \\\n  --api-base \"\u003Cyour-api-base>\"\n```\n\n#### Azure OpenAI Compatible Endpoint\n```shell\nexport AZURE_API_BASE=\"\u003Cyour api base>\" # azure api base\nexport AZURE_API_VERSION=\"\u003Cyour api version>\" # azure api version (optional)\nexport AZURE_API_KEY=\"\u003Cyour api key>\" # azure api key\n\ncover-agent \\\n  ...\n  --model \"azure\u002F\u003Cyour deployment name>\"\n```\n\n\n## Contributing\nSee [Contributing](CONTRIBUTING.md) for more information on how to contribute to this project.\n\n## Documentation\n* [Instructions for Adding Another Coverage Type to the `CoverageProcessor` Class](docs\u002Fadd_new_coverage_type_instructions.md)\n* [Using a Test Database with Cover Agent](docs\u002Fdatabase_usage.md)\n* [Cover Agent Feature Flags](docs\u002Ffeatures.md)\n* [Repo Coverage](docs\u002Frepo_coverage.md)\n* [Top Level Sequence Diagram](docs\u002Ftop_level_sequence_diagram.md)\n* [Usage Examples](docs\u002Fusage_examples.md)\n\n\n## Roadmap\nBelow is the roadmap of planned features, with the current implementation status:\n\n- [x] Automatically generates unit tests for your software projects, utilizing advanced AI models to ensure comprehensive test coverage and quality assurance. (similar to Meta)\n  - [x] Being able to generate tests for different programming languages\n  - [ ] Being able to deal with a large variety of testing scenarios\n  - [ ] Generate a behavior analysis for the code under test, and generate tests accordingly\n  - [x] Check test flakiness, e.g. by running 5 times as suggested by TestGen-LLM\n- [ ] Cover more test generation pains\n  - [ ] Generate new tests that are focused on the PR changeset\n  - [ ] Run over an entire repo\u002Fcode-base and attempt to enhance all existing test suites\n- [ ] Improve usability\n  - [ ] Connectors for GitHub Actions, Jenkins, CircleCI, Travis CI, and more\n  - [ ] Integrate into databases, APIs, OpenTelemetry and other sources of data to extract relevant i\u002Fo for the test generation\n  - [ ] Add a setting file\n\n\n## QodoAI\nQodoAI's mission is to enable busy dev teams to increase and maintain their code integrity.\nWe offer various tools, including \"Pro\" versions of our open-source tools, which are meant to handle enterprise-level code complexity and are multi-repo codebase aware.\n\n**Try the pro version of [Qodo Cover in a GitHub Action](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-ci)!**\n","\u003Cdiv align=\"center\">\n\u003Cdiv align=\"center\">\n\n \u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fwww.qodo.ai\u002Fwp-content\u002Fuploads\u002F2025\u002F02\u002FQodoCover-Light.png\" width=\"330\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fwww.qodo.ai\u002Fwp-content\u002Fuploads\u002F2025\u002F02\u002FQodoCover-Dark.png\" width=\"330\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_5cff1b072f90.png\" alt=\"logo\" width=\"330\"> \n\n\u003C\u002Fpicture>\n\u003Cbr\u002F>\u003Cbr\u002F>\nQodo Cover 的目标是通过自动生成高质量的测试用例来扩展代码覆盖率，从而高效提升代码覆盖率。Qodo Cover 可以在你的 GitHub CI 工作流中运行，也可以作为 CLI 工具在本地使用。\n\u003C\u002Fdiv>\n\n[![GitHub 许可证](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-AGPL_3.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fblob\u002Fmain\u002FLICENSE)\n[![Discord](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_c6eb98446236.png)](https:\u002F\u002Fdiscord.gg\u002FcYsvFJJbdM)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fqodoai)](https:\u002F\u002Ftwitter.com\u002Fqodoai)\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodium-ai\u002Fcover-agent\u002Fcommits\u002Fmain\">\n    \u003Cimg alt=\"GitHub\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flast-commit\u002Fqodo-ai\u002Fqodo-cover\u002Fmain?style=for-the-badge\" height=\"20\">\n    \u003C\u002Fa>\u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F10328\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_readme_4a68feb902da.png\" alt=\"Codium-ai\u002Fcover-agent | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## 目录\n* [新闻与更新](#news-and-updates)\n* [概述](#overview)\n* [安装与使用](#installation-and-usage)\n* [贡献](#contributing)\n* [文档](#documentation)\n* [路线图](#roadmap)\n\n\n## 新闻与更新\n### 2025-06-15\n> **⚠️ 此仓库已不再维护。如果您希望继续开发或在自己的项目中使用，请将其 fork。**\n\n### 2024-12-04:\n新增模式 - [在你的 GitHub CI 工作流中运行 Qodo Cover Pro](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-ci)。目前处于预览阶段，限时免费提供给 Python 项目使用，支持你从心仪的 LLM 提供商处获取并使用自己的 LLM API 密钥。这是一种切实可行的方式，可以提升代码质量和可靠性。更多详情请联系 [Qodo 团队](https:\u002F\u002Fwww.qodo.ai\u002Fbook-a-demo)。\n\n### 2024-11-05:\n新增模式 - 扫描整个代码库，自动识别测试文件，自动收集每个测试文件的上下文，并通过新增测试用例扩展测试套件。\n更多详情请参见 [这里](docs\u002Frepo_coverage.md)。\n\n\n# Qodo-Cover\n欢迎来到 Qodo-Cover。该项目专注于利用生成式 AI 自动化并优化测试用例的生成（目前主要为单元测试），旨在简化开发流程。Qodo-Cover 可通过终端运行，并计划集成到主流的 CI 平台中。\n\n我们诚邀社区共同协作，帮助扩展 Qodo Cover 的功能，持续将其打造为自动化单元测试生成领域的前沿解决方案。同时，我们也希望激励研究人员利用这一开源工具探索新的测试生成技术。\n\n\n## 概述\n该工具是更广泛的软件自动化单元测试生成工具集的一部分。它利用先进的生成式 AI 模型，旨在简化和加速测试过程，确保高质量的软件开发。系统由多个组件组成：\n1. **测试运行器：** 执行命令或脚本以运行测试套件并生成代码覆盖率报告。\n2. **覆盖率解析器：** 验证随着测试用例的增加，代码覆盖率是否提升，确保新测试确实提高了整体测试效果。\n3. **提示构建器：** 从代码库中收集必要数据，并构建传递给大型语言模型（LLM）的提示。\n4. **AI 调用器：** 与 LLM 交互，根据提供的提示生成测试用例。\n\n\n## 安装与使用\n### 需求\n在开始之前，请确保您已具备以下条件：\n- 在环境变量中设置 `OPENAI_API_KEY`，这是调用 OpenAI API 所必需的。\n- 代码覆盖率工具：工具正常运行需要 Cobertura XML 格式的代码覆盖率报告。\n  - 例如，在 Python 中可以使用 `pytest-cov`。运行 Pytest 时添加 `--cov-report=xml` 选项即可。\n  - 注意：我们正在积极支持更多类型的覆盖率格式，但欢迎您提交 PR 并参与 `cover_agent\u002FCoverageProcessor.py` 的开发。\n\n如果直接从仓库运行，您还需要：\n- 系统上已安装 Python。\n- 安装 Poetry 来管理 Python 包依赖。Poetry 的安装说明可在 [https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F](https:\u002F\u002Fpython-poetry.org\u002Fdocs\u002F) 查阅。\n\n### 独立运行\nQodo Cover 可以作为 Python Pip 包安装，也可以作为独立可执行文件运行。\n\n#### Python Pip\n要直接通过 GitHub 安装 Python Pip 包，请运行以下命令：\n```shell\npip install git+https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover.git\n```\n\n#### 二进制文件\n二进制文件无需在您的系统上安装任何 Python 环境即可运行（例如，在不包含 Python 的 Docker 容器中）。您可以前往项目的 [发布页面](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Freleases) 下载适用于您系统的版本。\n\n### 代码库设置\n运行以下命令以安装所有依赖项并从源码运行项目：\n```shell\npoetry install\n```\n\n### 运行代码\n下载可执行文件或安装 Pip 包后，您可以运行 Cover Agent 来生成和验证单元测试。通过以下命令在命令行中执行：\n```shell\ncover-agent \\\n  --source-file-path \"\u003C源文件路径>\" \\\n  --test-file-path \"\u003C测试文件路径>\" \\\n  --project-root \"\u003C项目根目录>\" \\\n  --code-coverage-report-path \"\u003C覆盖率报告路径>\" \\\n  --test-command \"\u003C要运行的测试命令>\" \\\n  --test-command-dir \"\u003C运行测试命令的目录>\" \\\n  --coverage-type \"\u003C覆盖率报告类型>\" \\\n  --desired-coverage \u003C期望的覆盖率，范围为0到100> \\\n  --max-iterations \u003CLLM的最大迭代次数> \\\n  --included-files \"\u003C可选的要包含的文件列表>\"\n```\n\n您可以使用下面的示例代码来试用 Cover Agent。\n（请注意，[usage_examples](docs\u002Fusage_examples.md) 文件提供了更详细的 Cover Agent 使用示例）\n\n#### Python\n\n按照 `templated_tests\u002Fpython_fastapi\u002F` 目录下的 README.md 文件中的步骤设置环境，然后返回到仓库根目录，运行以下命令为 **python fastapi** 示例添加测试：\n```shell\ncover-agent \\\n  --source-file-path \"templated_tests\u002Fpython_fastapi\u002Fapp.py\" \\\n  --test-file-path \"templated_tests\u002Fpython_fastapi\u002Ftest_app.py\" \\\n  --project-root \"templated_tests\u002Fpython_fastapi\" \\\n  --code-coverage-report-path \"templated_tests\u002Fpython_fastapi\u002Fcoverage.xml\" \\\n  --test-command \"pytest --cov=. --cov-report=xml --cov-report=term\" \\\n  --test-command-dir \"templated_tests\u002Fpython_fastapi\" \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 10\n```\n\n#### Go\n对于使用 **go** 的示例，进入 `templated_tests\u002Fgo_webservice` 目录，按照 `README.md` 设置项目。\n为了使用覆盖率报告功能，您需要安装 `gocov` 和 `gocov-xml`。运行以下命令安装这些工具：\n```shell\ngo install github.com\u002Faxw\u002Fgocov\u002Fgocov@v1.1.0\ngo install github.com\u002FAlekSi\u002Fgocov-xml@v1.1.0\n```\n然后运行以下命令：\n```shell\ncover-agent \\\n  --source-file-path \"app.go\" \\\n  --test-file-path \"app_test.go\" \\\n  --code-coverage-report-path \"coverage.xml\" \\\n  --test-command \"go test -coverprofile=coverage.out && gocov convert coverage.out | gocov-xml > coverage.xml\" \\\n  --test-command-dir $(pwd) \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 1\n```\n\n#### Java\n对于使用 **java** 的示例，进入 `templated_tests\u002Fjava_gradle` 目录，按照 [README.md](templated_tests\u002Fjava_gradle\u002FREADME.md) 设置项目。\n为了使用 jacoco 覆盖率报告功能，请遵循 [README.md](templated_tests\u002Fjava_gradle\u002FREADME.md) 中的“要求”部分：\n然后运行以下命令：\n```shell\ncover-agent \\\n  --source-file-path=\"src\u002Fmain\u002Fjava\u002Fcom\u002Fdavidparry\u002Fcover\u002FSimpleMathOperations.java\" \\\n  --test-file-path=\"src\u002Ftest\u002Fgroovy\u002Fcom\u002Fdavidparry\u002Fcover\u002FSimpleMathOperationsSpec.groovy\" \\\n  --code-coverage-report-path=\"build\u002Freports\u002Fjacoco\u002Ftest\u002FjacocoTestReport.csv\" \\\n  --test-command=\".\u002Fgradlew clean test jacocoTestReport\" \\\n  --test-command-dir=$(pwd) \\\n  --coverage-type=\"jacoco\" \\\n  --desired-coverage=70 \\\n  --max-iterations=1\n```\n\n### 录制与回放功能\n为了节省 LLM 服务费用，提供响应录制模式。起点是一个组哈希值，由每次测试运行中使用的源文件和测试文件的哈希值生成。如果任一文件发生变化，相应的 LLM 响应都应重新录制。\n运行以下命令以启用 LLM 响应录制模式执行所有测试：\n```shell\npoetry run python tests_integration\u002Frun_test_all.py --record-mode\n```\n\n如果您不带 `--record-mode` 标志运行相同命令：\n```shell\npoetry run python tests_integration\u002Frun_test_all.py\n```\n它将使用已录制的响应生成测试，而无需调用 LLM；如果未录制，则会调用 LLM 来运行测试。\n\n您也可以从单独的测试运行中录制 LLM 响应。像平常一样运行测试，并在命令中添加 `--record-mode` 标志：\n```shell\npoetry run python tests_integration\u002Frun_test_with_docker.py \\\n  --docker-image \"embeddeddevops\u002Fpython_fastapi:latest\" \\\n  --source-file-path \"app.py\" \\\n  --test-file-path \"test_app.py\" \\\n  --code-coverage-report-path \"coverage.xml\" \\\n  --test-command \"pytest --cov=. --cov-report=xml --cov-report=term\" \\\n  --coverage-type \"cobertura\" \\\n  --model \"gpt-4o-mini\" \\\n  --record-mode\n```\n\n下表说明了测试运行程序的行为，取决于是否设置了 `--record-mode` 标志以及是否已存在录制文件：\n\n|    标志     | 录制文件 | 结果                                |\n|:-----------:|:-----------:|:--------------------------------------|\n|      ❌      |      ❌      | 普通测试运行（未录制文件）  |\n|      ✅      |      ❌      | 录制新文件                    |\n|      ✅      |      ✅      | 覆盖现有文件           |\n|      ❌      |      ✅      | 回放已录制文件               |\n\n录制的响应存储在 `stored_responses` 文件夹中。文件名基于测试名称以及一个依赖于源文件和测试文件内容的哈希值。\n```shell\n\u003C测试名称>_responses_\u003C哈希值>.yml\n\n# 例如：\npython_fastapi_responses_a9d9de927a82a7d776889738d2880bec7166c5f69d3518837183a20ef48b2a37.yml\n```\n与同一源文件和测试文件组哈希值对应的响应文件会在每次录制会话中更新，添加新的提示哈希条目。\n要从头重新生成该文件，您可以删除现有的响应文件并开始新的录制会话。\n\n### 输出\n一些调试文件将在仓库本地输出（这些文件包含在 `.gitignore` 中）：\n* `run.log`：记录器的副本，会转储到您的 `stdout`；\n* `test_results.html`：结果表格，包含每个生成测试的以下信息：\n  * 测试状态\n  * 失败原因（如适用）\n  * 退出代码\n  * `stderr`\n  * `stdout`\n  * 生成的测试\n\n您可以使用 `--suppress-log-files` 标志来抑制日志输出。这将阻止创建 `run.log`、`test_results.html` 以及测试结果的 `db` 文件。\n\n### 额外的日志记录\n如果您设置环境变量 `WANDB_API_KEY`，提示、响应以及其他附加信息将会被记录到 [Weights and Biases](https:\u002F\u002Fwandb.ai\u002F) 上。\n\n### 使用其他大模型\n本项目使用 LiteLLM 与 OpenAI 及其他托管的大模型进行通信（目前已支持 100 多种大模型）。要使用除 OpenAI 默认模型之外的其他模型，您需要：\n1. 导出受支持大模型所需的任何环境变量 [按照 LiteLLM 的说明](https:\u002F\u002Flitellm.vercel.app\u002Fdocs\u002Fproxy\u002Fquick_start#supported-llms)。\n2. 在调用 Cover Agent 时，使用 `--model` 选项指定模型名称。\n\n例如（如 [LiteLLM 快速入门指南](https:\u002F\u002Flitellm.vercel.app\u002Fdocs\u002Fproxy\u002Fquick_start#supported-llms) 所示）：\n```shell\nexport VERTEX_PROJECT=\"hardy-project\"\nexport VERTEX_LOCATION=\"us-west\"\n\ncover-agent \\\n  ...\n  --model \"vertex_ai\u002Fgemini-pro\"\n```\n\n#### OpenAI 兼容端点\n```shell\nexport OPENAI_API_KEY=\"\u003C您的 API 密钥>\" # 如果 \u003C您的 API 基础地址> 需要 API 密钥，请设置此值。\n\ncover-agent \\\n  ...\n  --model \"openai\u002F\u003C您的模型名称>\" \\\n  --api-base \"\u003C您的 API 基础地址>\"\n```\n\n#### Azure OpenAI 兼容端点\n```shell\nexport AZURE_API_BASE=\"\u003C您的 API 基础地址>\" # Azure API 基础地址\nexport AZURE_API_VERSION=\"\u003C您的 API 版本>\" # Azure API 版本（可选）\nexport AZURE_API_KEY=\"\u003C您的 API 密钥>\" # Azure API 密钥\n\ncover-agent \\\n  ...\n  --model \"azure\u002F\u003C您的部署名称>\"\n```\n\n\n## 贡献\n有关如何为本项目做出贡献的更多信息，请参阅 [Contributing](CONTRIBUTING.md)。\n\n## 文档\n* [向 `CoverageProcessor` 类添加另一种保险类型的方法](docs\u002Fadd_new_coverage_type_instructions.md)\n* [在 Cover Agent 中使用测试数据库](docs\u002Fdatabase_usage.md)\n* [Cover Agent 功能标志](docs\u002Ffeatures.md)\n* [仓库覆盖率](docs\u002Frepo_coverage.md)\n* [顶层序列图](docs\u002Ftop_level_sequence_diagram.md)\n* [使用示例](docs\u002Fusage_examples.md)\n\n\n## 路线图\n以下是计划功能的路线图及当前实现状态：\n\n- [x] 自动为您的软件项目生成单元测试，利用先进的人工智能模型确保全面的测试覆盖和质量保证。（类似于 Meta）\n  - [x] 能够为不同编程语言生成测试\n  - [ ] 能够应对各种复杂的测试场景\n  - [ ] 对被测代码进行行为分析，并据此生成测试\n  - [x] 检查测试的不稳定性，例如按照 TestGen-LLM 的建议运行 5 次\n- [ ] 解决更多测试生成方面的痛点\n  - [ ] 生成专注于 PR 变更集的新测试\n  - [ ] 遍历整个代码库并尝试增强所有现有的测试套件\n- [ ] 提升易用性\n  - [ ] 与 GitHub Actions、Jenkins、CircleCI、Travis CI 等集成\n  - [ ] 集成数据库、API、OpenTelemetry 等数据源，以提取用于测试生成的相关输入输出\n  - [ ] 添加配置文件\n\n\n## QodoAI\nQodoAI 的使命是帮助繁忙的开发团队提升并持续维护代码质量。\n我们提供多种工具，包括开源工具的“Pro”版本，这些版本专为企业级代码复杂度设计，并能感知多仓库代码库。\n\n**立即试用 [Qodo Cover 的 GitHub Action Pro 版本](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-ci)!**","# Qodo-Cover 快速上手指南\n\nQodo-Cover 是一款利用生成式 AI 自动编写单元测试以提升代码覆盖率的开源工具。它支持在本地 CLI 或 GitHub CI 工作流中运行，目前主要支持 Python、Go 和 Java 等项目。\n\n> **⚠️ 重要提示**：根据官方最新公告（2025-06-15），该仓库已不再维护。如需继续使用或开发，请自行 Fork 该项目。\n\n## 环境准备\n\n在开始之前，请确保满足以下前置条件：\n\n### 1. 系统与环境\n- **Python**: 已安装 Python 环境（若使用 Pip 安装或源码运行）。\n- **Poetry**: 若从源码运行，需安装 Poetry 用于依赖管理。\n- **API Key**: 必须设置环境变量 `OPENAI_API_KEY`（或其他支持的 LLM Provider Key），用于调用大模型服务。\n\n### 2. 代码覆盖率工具\n工具需要读取 Cobertura XML 格式的覆盖率报告。请根据你的编程语言安装相应工具：\n- **Python**: 推荐使用 `pytest-cov`。运行测试时需添加 `--cov-report=xml` 参数。\n- **Go**: 需安装 `gocov` 和 `gocov-xml` 将覆盖率转换为 XML 格式。\n- **Java**: 需配置 `Jacoco` 生成覆盖率报告。\n\n## 安装步骤\n\n你可以选择通过 Pip 直接安装，或下载二进制文件运行。\n\n### 方式一：通过 Pip 安装（推荐）\n直接使用 GitHub 源安装最新版本的 Python 包：\n\n```shell\npip install git+https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover.git\n```\n\n### 方式二：使用二进制文件\n如果你希望在无 Python 环境（如精简版 Docker 容器）中运行，可前往项目的 [Release 页面](https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Freleases) 下载对应系统的可执行文件。\n\n### 方式三：源码运行（开发者模式）\n克隆仓库并安装依赖：\n\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover.git\ncd qodo-cover\npoetry install\n```\n\n## 基本使用\n\n安装完成后，使用 `cover-agent` 命令即可自动生成测试。你需要指定源文件、测试文件路径、测试命令以及期望的覆盖率目标。\n\n### 通用命令格式\n\n```shell\ncover-agent \\\n  --source-file-path \"\u003C源文件路径>\" \\\n  --test-file-path \"\u003C测试文件路径>\" \\\n  --project-root \"\u003C项目根目录>\" \\\n  --code-coverage-report-path \"\u003C覆盖率报告 XML 路径>\" \\\n  --test-command \"\u003C运行测试的命令>\" \\\n  --test-command-dir \"\u003C运行测试的目录>\" \\\n  --coverage-type \"\u003C覆盖率类型，如 cobertura>\" \\\n  --desired-coverage \u003C目标覆盖率数值 0-100> \\\n  --max-iterations \u003C最大 AI 迭代次数>\n```\n\n### 示例：Python 项目 (FastAPI)\n\n假设你有一个 FastAPI 项目，想要为 `app.py` 生成测试并达到 70% 的覆盖率：\n\n```shell\ncover-agent \\\n  --source-file-path \"templated_tests\u002Fpython_fastapi\u002Fapp.py\" \\\n  --test-file-path \"templated_tests\u002Fpython_fastapi\u002Ftest_app.py\" \\\n  --project-root \"templated_tests\u002Fpython_fastapi\" \\\n  --code-coverage-report-path \"templated_tests\u002Fpython_fastapi\u002Fcoverage.xml\" \\\n  --test-command \"pytest --cov=. --cov-report=xml --cov-report=term\" \\\n  --test-command-dir \"templated_tests\u002Fpython_fastapi\" \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 10\n```\n\n### 示例：Go 项目\n\n对于 Go 项目，需先确保已安装 `gocov` 和 `gocov-xml`，然后运行：\n\n```shell\ncover-agent \\\n  --source-file-path \"app.go\" \\\n  --test-file-path \"app_test.go\" \\\n  --code-coverage-report-path \"coverage.xml\" \\\n  --test-command \"go test -coverprofile=coverage.out && gocov convert coverage.out | gocov-xml > coverage.xml\" \\\n  --test-command-dir $(pwd) \\\n  --coverage-type \"cobertura\" \\\n  --desired-coverage 70 \\\n  --max-iterations 1\n```\n\n### 运行结果\n执行成功后，工具会在当前目录生成以下调试文件（除非使用 `--suppress-log-files` 禁用）：\n- `run.log`: 运行日志。\n- `test_results.html`: 包含生成的测试用例、状态、失败原因及输出信息的详细报表。\n\n> **提示**: 若需节省 LLM 调用成本，可使用 `--record-mode` 录制 AI 响应，后续相同代码变更时可重放记录而不消耗 Token。","某电商初创团队的后端工程师小李，正面临核心订单模块代码覆盖率长期低于 60% 的困境，且临近上线截止日期，急需补充大量单元测试以确保系统稳定性。\n\n### 没有 qodo-cover 时\n- **人工编写效率低下**：面对数千行遗留代码，手动逐行分析逻辑并编写测试用例耗时数天，严重挤占功能开发时间。\n- **边界场景覆盖不全**：人工思维容易忽略极端输入或异常分支，导致测试盲区，线上仍偶发难以复现的 Bug。\n- **维护成本高昂**：每当业务逻辑微调，需人工同步修改大量测试断言，容易出现测试代码与业务代码不同步的情况。\n- **覆盖率提升瓶颈**：传统手段难以快速定位未覆盖的代码行，只能凭经验盲目补充测试，覆盖率增长缓慢且停滞不前。\n\n### 使用 qodo-cover 后\n- **自动化批量生成**：qodo-cover 自动扫描订单模块，基于现有代码逻辑瞬间生成数百个高质量的单元测试用例，将原本几天的工作量缩短至小时级。\n- **智能补全盲区**：工具利用大模型深度分析控制流，自动识别并生成了针对空指针、超时等边缘情况的测试，显著提升了代码鲁棒性。\n- **动态同步更新**：当订单状态机逻辑变更时，qodo-cover 能感知差异并自动调整相关测试用例，确保持续集成流水线中的测试始终有效。\n- **精准提升覆盖率**：通过内置的覆盖率解析器，qodo-cover 定向生成缺失部分的测试，帮助团队在短时间内将核心模块覆盖率从 58% 提升至 92%。\n\nqodo-cover 通过将繁琐的单元测试编写转化为自动化流程，让开发团队在保障代码质量的同时，得以专注于核心业务价值的交付。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fqodo-ai_qodo-cover_8a9f3e0f.png","qodo-ai","Qodo","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fqodo-ai_4b0dadce.png","The AI Code Quality Platform",null,"support@qodo.ai","QodoAI","qodo.ai","https:\u002F\u002Fgithub.com\u002Fqodo-ai",[82,86,90,94,97,101,105,108,111,115],{"name":83,"color":84,"percentage":85},"Python","#3572A5",90.9,{"name":87,"color":88,"percentage":89},"Tree-sitter Query","#8ea64c",1.9,{"name":91,"color":92,"percentage":93},"Shell","#89e051",1.3,{"name":95,"color":96,"percentage":93},"JavaScript","#f1e05a",{"name":98,"color":99,"percentage":100},"TypeScript","#3178c6",0.9,{"name":102,"color":103,"percentage":104},"Java","#b07219",0.5,{"name":106,"color":107,"percentage":104},"Dockerfile","#384d54",{"name":109,"color":110,"percentage":104},"HTML","#e34c26",{"name":112,"color":113,"percentage":114},"Go","#00ADD8",0.3,{"name":116,"color":117,"percentage":114},"C","#555555",5350,504,"2026-04-06T03:48:33","AGPL-3.0","Linux, macOS, Windows","未说明",{"notes":125,"python":126,"dependencies":127},"1. 该工具主要通过调用外部 LLM API（如 OpenAI）运行，本地无需 GPU 或大显存，但需设置 OPENAI_API_KEY 环境变量。\n2. 必须安装代码覆盖率工具并生成 Cobertura XML 格式报告（不同语言需对应工具，如 Python 用 pytest-cov）。\n3. 提供独立二进制文件版本，可在无 Python 环境（如特定 Docker 容器）中直接运行。\n4. 若从源码运行，需使用 Poetry 管理依赖。\n5. 该项目已于 2025 年 6 月 15 日声明不再维护。","未说明 (需安装 Python 及 Poetry)",[128,129,130,131,132],"pytest-cov (Python 示例)","gocov, gocov-xml (Go 示例)","Jacoco (Java 示例)","LiteLLM","Poetry",[15,14,13],[135,136,137,138],"agents","ai","test-automation","testing","2026-03-27T02:49:30.150509","2026-04-06T20:08:50.881936",[142,147,152,157,161,166],{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},19898,"为什么生成的 Java 测试代码被追加到了类定义之外，导致编译失败？","这是一个已知问题，通常是因为 LLM 返回的插入行号（relevant_line_number_to_insert_tests_after）指向了文件末尾而非类内部。解决方案包括：\n1. 使用更强大的模型（如 GPT-4o 或 o1-preview），它们在推理插入位置方面表现更好。\n2. 在代码生成阶段预定义类和方法的边界，并在提示中指示 LLM 仅在特定部分填充代码。例如，可以在测试文件中添加注释 `\u002F\u002F Additional tests will be inserted here` 作为插入点标记。\n3. 项目维护者已集成 Java 项目的回归测试以确保持续支持。","https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fissues\u002F38",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},19899,"Cover-agent 是否支持 Ruby 语言？生成的测试为何是 Python 格式？","是的，Cover-agent 现已正式支持 Ruby。早期版本可能存在生成错误语言格式测试的问题，但通过 PR #33 的改进以及将 Ruby 示例（基于 Sinatra）添加到模板测试和夜间回归测试中，该问题已得到解决。如果您仍遇到生成 Python 测试的情况，请确保使用的是最新版本的 cover-agent。","https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fissues\u002F17",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},19900,"LLM 生成的 Go 或 Java 测试文件中，导入语句（imports）位置错误导致无法编译怎么办？","这是因为 LLM 默认将导入语句添加到文件顶部，而在 Go 和 Java 中，导入语句必须位于包声明（package declaration）之后。解决方案是更新后的 cover-agent 现在会请求 LLM 提供一个具体的行号（relevant_line_number_to_insert_imports_after），以便在正确的位置插入导入语句。此功能已通过 PR #82 合并到主分支，建议升级使用最新版本以获得修复。","https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fissues\u002F74",{"id":158,"question_zh":159,"answer_zh":160,"source_url":146},19901,"应该使用什么样的大语言模型（LLM）才能获得最佳效果？开源模型可用吗？","该项目旨在仅与 GPT-4 级别的模型（如 GPT-4, Claude, Gemini）配合使用。开源模型（如 Llama, Code Llama 等）在代码理解和遵循指令方面表现显著较差，经常导致生成错误的代码或忽略提示要求。虽然某些开源模型可能偶尔能工作，但不保证稳定性。如果 GPT-4 级别模型出现问题，维护者会优先解决；只有当开源模型达到同等水平时才会被推荐。",{"id":162,"question_zh":163,"answer_zh":164,"source_url":165},19902,"如何解决 LLM 为 Java 测试返回错误的插入行号（relevant_line_number_to_insert_tests_after）导致死循环的问题？","该问题多见于非 OpenAI 的模型（包括部分商业大模型和开源模型）。解决方法有：\n1. 切换到性能更强的模型，如 GPT-4o 或 o1-preview，这些模型在推理引擎上有显著改进，能更准确地识别插入位置。\n2. 优化提示词（Prompt），明确指示 LLM 必须在类定义的大括号内插入测试代码。\n3. 在源代码中预设插入点注释（如 `\u002F\u002F Additional tests will be inserted here`），引导 LLM 在该行之后插入代码，避免其随意选择文件末尾。","https:\u002F\u002Fgithub.com\u002Fqodo-ai\u002Fqodo-cover\u002Fissues\u002F128",{"id":167,"question_zh":168,"answer_zh":169,"source_url":146},19903,"如何使用 DeepSeek 等其他模型运行 cover-agent？配置命令是怎样的？","可以通过指定 `--model` 和 `--api-base` 参数来使用 DeepSeek 等非 OpenAI 模型。示例命令如下：\ncover-agent \\\n--source-file-path \"src\u002Fmain\u002Fkotlin\u002FUtils.kt\" \\\n--test-file-path \"src\u002Ftest\u002Fkotlin\u002FTestUtils.kt\" \\\n--code-coverage-report-path \"build\u002Freports\u002Fkover\u002Fxml\u002Freport.xml\" \\\n--test-command \"gradle clean koverXmlReport\" \\\n--test-command-dir \".\u002F\" \\\n--coverage-type \"cobertura\" \\\n--desired-coverage 80 \\\n--max-iterations 1 \\\n--model \"openai\u002Fdeepseek-coder\" \\\n--api-base \"https:\u002F\u002Fapi.deepseek.com\"\n注意：由于开源或次级模型可能在理解指令上存在缺陷，使用时可能会遇到生成代码位置错误或格式不对的问题，建议优先使用 GPT-4 级别模型。",[171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247],{"id":172,"version":173,"summary_zh":76,"released_at":174},117941,"0.3.10","2025-05-21T02:02:58",{"id":176,"version":177,"summary_zh":76,"released_at":178},117942,"0.3.9","2025-05-15T04:02:46",{"id":180,"version":181,"summary_zh":76,"released_at":182},117943,"0.3.8","2025-05-12T16:16:15",{"id":184,"version":185,"summary_zh":76,"released_at":186},117944,"0.3.7","2025-02-26T22:56:27",{"id":188,"version":189,"summary_zh":76,"released_at":190},117945,"0.3.6","2025-02-26T00:17:46",{"id":192,"version":193,"summary_zh":76,"released_at":194},117946,"0.3.5","2025-02-25T23:08:31",{"id":196,"version":197,"summary_zh":76,"released_at":198},117947,"0.3.4","2025-02-21T06:07:05",{"id":200,"version":201,"summary_zh":76,"released_at":202},117948,"0.3.3","2025-02-21T01:00:32",{"id":204,"version":205,"summary_zh":76,"released_at":206},117949,"0.3.2","2025-02-21T00:14:41",{"id":208,"version":209,"summary_zh":76,"released_at":210},117950,"0.3.1","2025-02-20T23:12:44",{"id":212,"version":213,"summary_zh":76,"released_at":214},117951,"0.3.0","2025-02-20T20:17:00",{"id":216,"version":217,"summary_zh":76,"released_at":218},117952,"0.2.22","2025-02-20T02:03:48",{"id":220,"version":221,"summary_zh":76,"released_at":222},117953,"0.2.21","2025-02-06T02:04:19",{"id":224,"version":225,"summary_zh":76,"released_at":226},117954,"0.2.20","2025-02-03T18:50:59",{"id":228,"version":229,"summary_zh":76,"released_at":230},117955,"0.2.17","2025-01-14T17:38:01",{"id":232,"version":233,"summary_zh":76,"released_at":234},117956,"0.2.16","2025-01-12T03:15:02",{"id":236,"version":237,"summary_zh":76,"released_at":238},117957,"0.2.15","2025-01-07T05:57:41",{"id":240,"version":241,"summary_zh":76,"released_at":242},117958,"0.2.14","2025-01-07T05:02:29",{"id":244,"version":245,"summary_zh":76,"released_at":246},117959,"0.2.13","2025-01-07T04:17:26",{"id":248,"version":249,"summary_zh":76,"released_at":250},117960,"0.2.12","2025-01-03T04:36:40"]