Skip to main content

CLI tool for automatic code bug fixing powered by LLMs

Project description

AgentCrops

基于 LLM 的 AI 软件工程工具,支持自动代码修复、扫描、设计、开发、测试全流程。提供 CLI 命令行和 TUI 终端界面两种使用方式。

安装

pip install agentcrops

或从源码安装:

git clone <repo-url> AgentCrops
cd AgentCrops
pip install -e ".[dev]"

需要 Python >= 3.11。

快速开始

# 设置 API Key
export ANTHROPIC_API_KEY="sk-ant-..."

# 修复单个文件中的 bug
agentcrops fix src/app.py

# 扫描目录中的潜在问题
agentcrops scan src/

CLI 命令

命令 说明
agentcrops fix <文件> 分析并修复文件中的 bug(多 Agent 协作)
agentcrops scan [目录] 扫描目录中的潜在 bug
agentcrops design <需求.md> 根据需求生成架构设计文档
agentcrops develop <需求.md> 根据需求生成可运行代码
agentcrops test <目标> 为指定代码编写并运行测试
agentcrops build <需求.md> 运行完整构建流水线(设计→开发→测试)
agentcrops serve 启动 HTTP API 服务(供 TUI 使用)
agentcrops config show 查看当前配置
agentcrops config get <键> 获取指定配置项
agentcrops config set <键> <值> 设置配置项(仅运行时)
agentcrops skill list 列出已注册技能
agentcrops kb list 列出知识库适配器

TUI 终端界面(actui)

除了 CLI 命令行,AgentCrops 还提供了一个 Ink/React 构建的终端 UI,支持多 Agent 协作的可视化操作。

启动

# 方式 1:一键启动脚本(推荐)
./actui.sh

# 方式 2:手动分别启动
# 终端 1 — 启动后端服务
agentcrops serve

# 终端 2 — 启动 TUI
cd src/actui && npm run dev

功能

  • 多 Tab 切换 — 同时与多个 Agent(Leader / Architect / Coder / Tester / Reviewer)对话
  • 实时 SSE 流 — Agent 回复逐字显示,支持 tool call 可视化
  • 命令面板 — 输入 /fix/scan/build 等命令直接触发工作流
  • 团队面板 — 侧边栏实时显示各 Agent 状态和任务进度
  • 键盘快捷键Ctrl+C 退出,Alt+1~9 切换 Tab,Ctrl+B 切换侧边栏

连接自定义服务端

默认连接 http://localhost:8730,可通过环境变量修改:

ACTUI_SERVER_URL=http://192.168.1.100:8730 npm run dev

核心特性

  • 多 Agent 组队 — Leader 协调 + Architect / Coder / Tester / Reviewer 分工协作
  • 多后端支持 — Claude Agent SDK、Cursor SDK 或任意 OpenAI 兼容 API
  • 工具调用 — Agent 可读写文件、执行 shell、操作 git、运行测试
  • 技能系统 — 可插拔分析模块(静态分析、测试生成等)
  • 知识库 — 绑定团队文档、编码规范和 bug 历史以提升修复质量
  • 安全保护 — Shell 沙箱、文件访问边界控制、API Key 脱敏、自动备份

配置

AgentCrops 使用 .agentcrops.toml 配置文件,优先级从高到低:

环境变量                  (最高)
    ↓
项目 .agentcrops.toml
    ↓
用户 ~/.agentcrops/config.toml
    ↓
内置默认值               (最低)

详细配置参考见 docs/usage-guide.md

文档

License

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

agentcrops-0.2.0.tar.gz (5.0 MB view details)

Uploaded Source

Built Distribution

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

agentcrops-0.2.0-py3-none-any.whl (174.8 kB view details)

Uploaded Python 3

File details

Details for the file agentcrops-0.2.0.tar.gz.

File metadata

  • Download URL: agentcrops-0.2.0.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentcrops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0b47d382c9821932149b1d1579de3d277c9078272b35fac30a0d6be6af287e2a
MD5 3d54f0e80999f1233aeb17748f412589
BLAKE2b-256 75c4a9dcd8fb4fc609a303b0ddfd0c68319d87f1b6ba2904765b00eae3d86b43

See more details on using hashes here.

File details

Details for the file agentcrops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agentcrops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 174.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentcrops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a31850e53402629b8463ea028b4ddb963b20cab5a70b3f7586db343e92f09d19
MD5 b1623127f337357e70ec35992b8d0860
BLAKE2b-256 3e38fc740717656bac7a4c355174a3d8a84f81aba86c0e11d4f914f0e5f59ba9

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