Skip to main content

AI Coding Assistant - 代码缺陷修复和分析工具

Project description

Fix Agent

一个专业的代码缺陷修复协调专家,拥有三个专业子代理团队。

特性

  • 智能缺陷分析: 自动识别语法错误、逻辑问题、性能瓶颈和安全隐患
  • 精准代码修复: 基于AI的自动化代码修复方案
  • 全面验证机制: 确保修复有效且无新问题
  • 丰富动画效果: 现代化的CLI交互体验
  • 多语言支持: Python、JavaScript、C/C++、Java等

快速安装

pip install fix-agent

核心功能

专业子代理团队

  1. defect-analyzer

    • 语法分析:检查语法错误、类型错误、导入错误
    • 逻辑分析:识别逻辑漏洞、边界条件处理
    • 性能分析:发现性能瓶颈、资源泄漏
    • 安全分析:检查SQL注入、XSS、权限绕过
  2. code-fixer

    • 智能修复:基于分析报告自动修复代码
    • 策略优化:选择最佳修复方案
    • 兼容性保证:确保修复不破坏现有功能
  3. fix-validator 🛡

    • 测试验证:运行单元测试和集成测试
    • 静态分析:验证代码质量标准
    • 安全扫描:确保修复无安全风险

使用方法

基本命令

# 启动Fix Agent
fix-agent

# 或者使用别名
fixagent

# 显示帮助
fix-agent help

# 列出可用代理
fix-agent list

# 重置代理状态
fix-agent reset --agent my-agent

交互式使用

启动后,你可以:

  • 直接输入需要分析的代码问题
  • 使用 @文件路径 引用代码文件
  • 使用 /命令 执行系统操作
  • 使用 !命令 执行shell命令

开发模式安装

git clone https://github.com/yourusername/Fix_agent.git
cd Fix_agent
pip install -e .

系统要求

  • Python 3.11+
  • 支持的操作系统:Windows、macOS、Linux

配置

环境变量

# OpenAI API密钥
export OPENAI_API_KEY=your_openai_key

# Anthropic API密钥
export ANTHROPIC_API_KEY=your_anthropic_key

# Tavily搜索API密钥(可选)
export TAVILY_API_KEY=your_tavily_key

配置文件

创建 .env 文件:

OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
TAVILY_API_KEY=your_key_here

示例

分析代码缺陷

fix-agent
> 请分析这个Python文件的潜在问题 @app.py

修复特定问题

fix-agent
> 这个函数有内存泄漏,请帮我修复

批量代码审查

fix-agent
> 请审查整个src目录的代码质量

许可证

MIT License

相关链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fix_agent-0.1.0.tar.gz (93.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fix_agent-0.1.0-py3-none-any.whl (106.6 kB view details)

Uploaded Python 3

File details

Details for the file fix_agent-0.1.0.tar.gz.

File metadata

  • Download URL: fix_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 93.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fix_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f19ad43609bc2ff1934e3b441b755374e9e2d3d14e7e30c5f158d7b360f373a1
MD5 c93ab37d4a220fa7bfcd14f1d1a32d69
BLAKE2b-256 e334afcad270d44d9ec2f9a399435b50570bb2f7c15ec7f721d21587ae94b9a0

See more details on using hashes here.

File details

Details for the file fix_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fix_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 106.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fix_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 199801c40991f35a02b94cb76b63e398b8408f70aca31be78f66a2041fc6e4c9
MD5 e53217ff695f943806426b2277ba6dc3
BLAKE2b-256 31d7abefea7f77d086d155f6bed680b5a3870b1c3bbd6a559e6553cd51c07638

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page